Virtual Machinery logo JHawk Eclipse Plugin
Product Home Application Eclipse Plugin Command Line Metrics Guide Download Free Trial FAQ, News, Bugs Other Products
JHawk Eclipse Plugin Manual -
Preferences


The JHawk Preferences page is available from the standard Eclipse preferences page.There are four main tabs

  • JHawk Preferences
  • JHawk Package Metric Preferences
  • JHawk Class Metric Preferences
  • JHawk Method Metric Preferences
Main Preference Page

The main preference page provides the following options -

  • Show the 'All Methods' Panel. By default this is switched off as it has a high impact on performance if large numbers of classes are being analysed at the same time.Switching it on will enable the 'All methods' Panel which is populated with all of the methods analysed in that particular run. You will have to re-run the analysis after setting and applying this flag in order to populate the panel.
  • Show the 'All Classess' Panel. By default this is switched off as it has a high impact on performance if large numbers of classes are being analysed at the same time.Switching it on will enable the 'All Classes' Panel which is populated with all of the classes analysed in that particular run. You will have to re-run the analysis after setting and applying this flag in order to populate the panel.
  • Three colour choosers which allow you to select the text colour that will be used for metrics whose values are normal, above the pre-detemined warning level and above the predetermined danger level. For details on how to set these levels for each metric see here. These colours will only be used for metrics which have warning levels set.
  • A file chooser to allow you to select a file to export your preferences to. These preferences can be used for this plugin (using the import function described below), to the stand-alone application or the command line version. Only preferences that have been 'Applied' (by pressing the apply button on this page) will be exported. Note that text colours do not apply to the stand-alone or command-line versions.
  • A file chooser to allow you to select a file to import your preferences from. These preferences may have been exported from this plugin (using the export function described above), or edited by hand. The imported preferences will be immediately applied.

The Metric preference pages

The Package, Class and Method Metric Preference pages all follow the same form so although this section deals only with the Package Metric Preference Page the same principles apply to the other two pages. The image below shows the Package Metric Preference page -

The Metric preferences are expressed as a table. The first column , which shows the sequence number, is generated and non-editable. You can change the column order that the metrics are displayed in by using the 'Up' and 'Down' buttons at the right hand side of the table.The second column indicates whether this metric is active (ie displayed as a column in the Package table). You can set a metric as inactive by clicking on it -

The metric is now moved to the bottom of the table and the tick is removed from the tick box. If you want to restore the metric all you need is to click on the 'Active' column for this metric. The tick is placed in the tick box and the metric is assigned the last order in the list -

You an move the metric to the column position that you want using the 'Up' and 'Down' buttons -

The third column allows you to set the alignment of the column text - there are three options available in a drop-down box - Left, Right or Center - You should choose the one most appropriate to the netric -

The fourth column is a reference column which notes the internal code of the metric - this field is not editable.The fifth column is the header used at the top of the column when it is displayed in a table. Clicking on this field will allow you to change the text. You can also edit the sixth column which is just a description of the metric. The seventh,eigth and ninth columns relate to the warning and danger levels that you can set for the metrics. The seventh column sets the comparison type ( Greater-than (>) or Less-than (<)) or if set to N/A indicates that the warning/danger levels are not set for this metric. These are set using a drop-down list which will appear if you click on the column entry -

The last two columns set the warning and danger levels for the metric. These are simple numeric entry fields. If you take the Average Cyclomatic Complexity metric shown you will see that it uses the Greater-than (>) comparator and the warning level is set to 8.0 and the danger level to 10.0. This means that values less than or 8.0 will appear in green text (ie the level is normal), values greater than 8.0 but less than 10.0 (warning level) will appear in orange text and values greater than 10.0 (danger level) will appear in red text.

When you have changed the settings and are happy with your changes you can press the 'Apply' button. The changes will not be effective until your next run of the JHawk analyzer. At any time you can restore the default settings by pressing the 'Restore Defaults' button.