Eiffel Inspector - Customization

    Contents
  1. General Preferences
  2. Rule-specific Preferences
  3. Exporting and Importing Preference Profiles
  4. Class Options
    1. Library and Non-Library Classes
    2. Classes Ignored by Rules

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.

Preferences

Rule-specific Preferences

The rule-specific preferences are located in the Rules subfolder. Two preferences can be found for every rule: Enabled/disabled and the severity score. Some rules have additional integer or boolean preferences like thresholds.

Rule-specific Preferences

Exporting and Importing Preference Profiles

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.'

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 note 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.

  • To declare a class to be a library class add ca_library : "true" to the (top or bottom) indexing clause.
  • To declare a class to be a non-library class add ca_library : "false" to the (top or bottom) indexing clause.

note ca_library: true class TEST end

Classes Ignored by Rules

You can declare a class to be ignored by certain rules, which is equivalent to saying that some rules shall be disabled for a class.

To let a class be ignored by certain rules, add the ca_ignoredby tag to the (top or bottom) note clause. Then put all the relevant rule IDs separated by commas in the content. It may look like this:

note ca_ignoredby : "CA005, CA092" class TEST end

ed86093e-fed0-04b8-6fd4-b05d5de849fc
cached: 07/27/2017 2:32:41.000 AM