Rational Developer for System z

Selecting the scope and the rules of a configuration

This topic describes how to select the scope and the rules of a software analysis configuration.
This topic contains the following subtopics:

Selecting the scope and the rules

Follow these steps:
  1. Open the software analysis configuration editor. See Opening the software analysis configuration editor.
  2. In the left pane of the editor, create a new software analysis configuration, or create one based on an existing configuration.
    • Creating a new configuration: To create a new software analysis configuration, do any one of the following:
      • Click New launch configuration on the toolbar.
      • Right-click any node in the Software Analyzer tree and then click New.
      • Double-click the Software Analyzer node at the top of the tree.
    • Duplicating a configuration: To create a new configuration based on an existing one, do one of the following:
      • Select the existing configuration in the Software Analyzer tree and then click Duplicate on the toolbar.
      • Right-click the existing configuration in the Software Analyzer tree and then click Duplicate.
    Note:
    • If the button or the menu item is disabled, then enable it by selecting any node in the Software Analyzer tree.
    • If the Software Analyzer tree is not visible, show it by clearing the filter input field.
  3. In the Name field, enter a name for the new software analysis configuration.
  4. On the Scope tab, select a scope for the new software analysis configuration. The scope identifies the source code files to which the software analysis is to be applied. Table 1 shows the values that can be selected:
    Table 1. Scope values
    Scope selection: Resulting scope:
    Analyze entire workspace All the source code files in the workspace.
    Analyze a resource working set All the source code files in the selected resource working set.
    Analyze selected projects All the source code files in the selected projects.
    Note: The projects in this list are filtered according to the settings in the Project Explorer view. To change these settings click Window > Preferences > Modeling > Views > Project Explorer.

    When you run the software analysis configuration you can override the configured scope with a different scope. See Starting a code review; runtime scope.

  5. On the Rules tab, select the rules that you want to be included in this analysis configuration. The meaning of each rule is described in one of the following topics:
    Tip: Hover over a rule to display a description of it. You can also get information about a rule by selecting the rule and pressing F1.
    Tip: Use the built-in rule sets to identify or enable rules in special categories. See Using built-in rule sets.
    Follow these steps:
    1. In the Analysis Domains and Rules tree, expand the COBOL Code Review or PL/I Code Review domain.
    2. Expand a rule category, such as Program Structures.
    3. Select a rule, such as Avoid ACCEPT statements.
    4. On the Properties tab:
      1. Set the severity for the rule. Table 2 shows the values that can be set for severity.
      2. Set the value of any custom parameter.
    Table 2. Severity levels
    Icon Severity level Description
    Recommendation This is the lowest severity level. The result indicates a problem that is not serious but one that you should still fix.
    Warning This severity level indicates that a resource very likely has a problem that you need to resolve.
    Severe This is the highest severity level and indicates that you should resolve the problem.
  6. Apply and Revert:
    • Click Apply to save your changes.
    • Click Revert to undo the changes since the most recent Apply.
  7. Analyze and Close:
    • Click Analyze to close the editor and run the software analysis configuration.
    • Click Close to close the editor.

Using built-in rule sets

Use the built-in rule sets to identify or enable rules that belong to special categories. The current built-in COBOL and PL/I rules sets are:
  • COBOL rules added in RDz 8.0
  • COBOL rules added in RDz 8.5
  • COBOL Best Practices Code Review
  • PL/I rules added in RDz 8.5
  • PL/I Best Practices Code Review
To identify the rules belonging to a rule set:
  1. Expand the Rule Sets list.
  2. Select a rule set, such as COBOL Best Practices Code Review.
In the Analysis Domains and Rules tree, the rules belonging to the selected rule set are displayed in bold.

For example, if you select the COBOL Best Practices Code Review rule set then the rules in that set are displayed in bold under the COBOL Code Review node of the tree.

To enable the rules belonging to a rule set:
  1. Expand the Rule Sets list.
  2. Select a rule set, such as COBOL Best Practices Code Review. The rules in the selected set are displayed in bold under the COBOL Code Review node of the tree.
  3. Select Set.
The check box for each rule in the set is selected, enabling the rule.
For example, suppose that you want to create an analysis configuration containing all of the best-practice COBOL rules, except for two rules. To accomplish this:
  1. Select the rule set. In the tree, the rules in the rule set are displayed in bold.
  2. Click Set. The check box for each rule in the set is selected, enabling the rule.
  3. Clear the check boxes in front of the two rules that you do not want to include in the code review.
  4. Click Apply to save the settings.


Feedback