merge changed from 18.11 into trunk.

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@2151 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
jfiat
2019-05-19 11:13:05 +00:00
parent 3a7702582d
commit 2c8d6d6f35
17 changed files with 180 additions and 129 deletions

View File

@@ -1,5 +1,7 @@
[[Property:title|Eiffel Inspector - Analyzing Results]]
[[Property:link_title|Analyzing Results]]
[[Property:modification_date|Mon, 24 Dec 2018 07:44:49 GMT]]
[[Property:publication_date|Mon, 24 Dec 2018 07:44:49 GMT]]
[[Property:title|Code Analyzer: Interpreting Results]]
[[Property:link_title|Interpreting Results]]
[[Property:weight|-13]]
[[Property:uuid|e4670791-7885-b9a0-6a1c-0d9611eb5f5d]]
= Sorting and Filtering =

View File

@@ -1,10 +1,12 @@
[[Property:title|Eiffel Inspector - Customization]]
[[Property:modification_date|Mon, 24 Dec 2018 07:52:18 GMT]]
[[Property:publication_date|Mon, 24 Dec 2018 07:52:18 GMT]]
[[Property:title|Code Analyzer: Customization]]
[[Property:link_title|Customization]]
[[Property:weight|-12]]
[[Property:uuid|ed86093e-fed0-04b8-6fd4-b05d5de849fc]]
= General Preferences =
The ''Preferences'' button in the toolbar opens a dialog containing all preferences for the Eiffel Inspector. There you can enable and disable all rules of a certain severity, you can choose colors for the results, and there are many preferences that control the behavior of individual rules.
The ''Preferences'' button in the toolbar opens a dialog containing all preferences for the Code Analyzer. There you can enable and disable all rules of a certain severity, you can choose colors for the results, and there are many preferences that control the behavior of individual rules.
[[Image:CA Preference Dialog|center|640px|Preferences]]
@@ -18,15 +20,15 @@ The rule-specific preferences are located in the ''Rules'' subfolder. Two prefer
Using the buttons in the preferences dialog one can export these preferences to an XML file or import them. This can be used for creating profiles that stretch across multiple machines. Just set the desired preferences on one machine, export them to a file, distribute this file, and import it.
{{note| The Eiffel Inspector preferences are separate from the general EiffelStudio preferences. Pressing ''Restore Defaults'', ''Import ...'', or ''Export ...'' ''only'' affects preferences for the Eiffel Inspector.''}}
{{note| The Code Analyzer preferences are separate from the general EiffelStudio preferences. Pressing ''Restore Defaults'', ''Import ...'', or ''Export ...'' ''only'' affects preferences for the Code Analyzer.''}}
= Class Options =
There are cases in which you might want to customize the Eiffel Inspector for ''parts of your code'' only. The Eiffel Inspector provides a way to set options ''per class''. You can exclude a class from being checked by certain rules. Also you can declare a class to be a ''library'' or a ''non-library'' class. All class-wide options for the Eiffel Inspector are set in the ''note clause'' (after the <e>note</e> keyword).
There are cases in which you might want to customize the Code Analyzer for ''parts of your code'' only. The Code Analyzer provides a way to set options ''per class''. You can exclude a class from being checked by certain rules. Also you can declare a class to be a ''library'' or a ''non-library'' class. All class-wide options for the Code Analyzer are set in the ''note clause'' (after the <e>note</e> keyword).
== Library and Non-Library Classes ==
If the programmer uses the default values then a rule checks all classes. But a rule can be defined (hard-coded) not to check either ''library'' or ''non-library'' classes. How does the Eiffel Inspector now know which classes are ''library'' classes and which classes are ''non-library'' classes? This is defined by the user. If, for a certain class, the user does ''not'' define anything then the class will be analyzed in every case. Only if the user declares a class to be a ''library'' class then this class will not be checked by a rule that has disabled checking library classes. The same goes for classes that are declared as ''non-library''.
If the programmer uses the default values then a rule checks all classes. But a rule can be defined (hard-coded) not to check either ''library'' or ''non-library'' classes. How does the Code Analyzer now know which classes are ''library'' classes and which classes are ''non-library'' classes? This is defined by the user. If, for a certain class, the user does ''not'' define anything then the class will be analyzed in every case. Only if the user declares a class to be a ''library'' class then this class will not be checked by a rule that has disabled checking library classes. The same goes for classes that are declared as ''non-library''.
* To declare a class to be a ''library'' class add <e>ca_library : "true"</e> to the (top or bottom) indexing clause.
* To declare a class to be a ''non-library'' class add <e>ca_library : "false"</e> to the (top or bottom) indexing clause.

View File

@@ -1,4 +1,6 @@
[[Property:title|Eiffel Inspector - Rules]]
[[Property:modification_date|Mon, 24 Dec 2018 07:54:57 GMT]]
[[Property:publication_date|Mon, 24 Dec 2018 07:54:57 GMT]]
[[Property:title|Code Analyzer: Rules]]
[[Property:link_title|Rules]]
[[Property:weight|15]]
[[Property:uuid|109ca62a-212d-8a85-eea8-ddf0f89177a1]]

View File

@@ -1,13 +1,15 @@
[[Property:title|Eiffel Inspector - Running the Analyzer]]
[[Property:modification_date|Mon, 24 Dec 2018 07:41:32 GMT]]
[[Property:publication_date|Mon, 24 Dec 2018 07:41:32 GMT]]
[[Property:title|Running the Code Analyzer]]
[[Property:link_title|Running the Analyzer]]
[[Property:weight|-14]]
[[Property:uuid|d672c769-57fb-6b87-2781-83daff3ab9e7]]
= General =
There are several different ways of running the Eiffel Inspector. Most importantly, you can select the scope of the analysis. For example it is possible to analyze a single class, a cluster or a whole system. Also for the same scope there are different ways of running the analyzer depending on your personal preferences. To perform the analysis the Eiffel system which will be analyzed must compile without any error.
There are several different ways of running the Code Analyzer. Most importantly, you can select the scope of the analysis. For example it is possible to analyze a single class, a cluster or a whole system. Also for the same scope there are different ways of running the analyzer depending on your personal preferences. To perform the analysis the Eiffel system which will be analyzed must compile without any error.
There are two ways of running the Eiffel Inspector
# Using the GUI, the Eiffel Inspector Tool appears as a panel. The panel is mainly used for displaying analysis results. The command to perform the analysis can be found not only in the panel but also in various context menus making it easy to analyze specific classes or sets of classes.
There are two ways of running the Code Analyzer
# Using the GUI, the Code Analyzer Tool appears as a panel. The panel is mainly used for displaying analysis results. The command to perform the analysis can be found not only in the panel but also in various context menus making it easy to analyze specific classes or sets of classes.
# Using command-line arguments with the command-line version of EiffelStudio. The system is compiled (if necessary) and then analyzed. The output of the analysis will be directed to the terminal window.
= GUI =
@@ -25,13 +27,13 @@ Left-clicking the '''Analyze Item''' button in the toolbar will start an analysi
=== Any Class ===
There are two ways of analyzing an arbitrary class (either from your system or from a library):
* Right-click on a class name and select '''Run Eiffel Inspector on Class...''' from the context menu:
* Right-click on a class name and select '''Analyze Class...''' from the context menu:
[[Image:CA Class Context Menu|center|371px|Class Context Menu]]
* Pick a class and drop it on the '''Analyze Item''' button.
=== Clusters ===
To analyze a cluster there are two possibilities, like for classes:
* You can either right-click the cluster and select '''Run Eiffel Inspector on cluster''' from the context menu:
* You can either right-click the cluster and select '''Analyze cluster''' from the context menu:
[[Image:CA Cluster Context Menu|center|247px|Cluster Context Menu]]
* Pick a cluster and drop it on the '''Analyze Item''' button.
@@ -40,7 +42,7 @@ Not only clusters but any other elements of a project (such as a library) can be
=Command Line=
The Eiffel Inspector is also available from the EiffelStudio command line compiler by using the '''-code-analysis''' command. The results will be displayed in the terminal window or to a file.
The Code Analyzer is also available from the EiffelStudio command line compiler by using the '''-code-analysis''' command. The results will be displayed in the terminal window or to a file.
== Execution / Command Line Options ==
@@ -49,7 +51,7 @@ The following command will perform a code analysis:
ec.exe -config project.ecf -code-analysis [-cadefaults] [-caloadprefs ''preffile''] [-caclass ''CLASS1 CLASS2 ...'']
[-caforcerules "RULE1 (First preference=1, Second preference=2) RULE2"]
The arguments in brackets are optional. For a complete description of the Eiffel inspector command line options see [[EiffelStudio: Using command line options|Using command line compiler options]].
The arguments in brackets are optional. For a complete description of the Code Analyzer command line options see [[EiffelStudio: Using command line options|Using command line compiler options]].
EiffelStudio will try to compile the system if needed. The analysis will only work with syntactically correct code and a compiled system. Should the compilation fail, EiffelStudio will abort and the analysis will not start.
@@ -58,7 +60,7 @@ Upon a successful compilation either the whole system or the classes mentioned i
As soon as everything needed has been analyzed the results will be displayed as a list of rule violations. These rule violations are sorted by class and by location. In addition to the name of the violated rule and the rule ID, a description of the concrete violation will be displayed as well.
[[Image:Eiffel Inspector Command Line|center|877px|Eiffel Inspector - Command Line]]
[[Image:Eiffel Inspector Command Line|center|877px|Code Analyzer - Command Line]]
=== Output to file ===