Quality Control Rules Templates

Rational® Programming Patterns provides templates of rules to create quality control rules that contain parameters.

The custom rules are not directly available for the design entities analysis and the COBOL source review. You must add a rule and specify the parameters values to make it available in Software Analyzer.

Implementation

To use a custom rule, you must define the rule with one of the templates that are provided in the Software Analyzer preferences.

  1. Select Window > Preferences > Software Analyzer > Custom Rules and Categories.
  2. Click Add Rule.
  3. In the wizard that opens, select the category where the rule is to be added and click Next.
  4. Select the template to use for the rule and click Next.
  5. Enter the values of the template parameters and click Finish.
  6. The created rule appears in the Current Custom Rules list of the Preferences. Click OK to validate this creation.

The new rule is automatically added and available in Software Analyzer.

Before you analyze the COBOL code with the new quality control rule, you must define a configuration rules set in the Software Analyzer Configurations.

For a complete documentation on the Software Analyzer, see the IBM® Developer for z Systems™ (Rational Developer for z Systems) online help, in the COBOL Code Review item of the Developing section.

RPP specific templates for Design entities Analysis

The following rules templates are dedicated to the analysis of the Rational Programming Patterns design entities:

At least one Macro is mandatory on Screen entities
Parameters: list of Macros and Severity.
Use this rule to verify that at least one of the Macros that are given as parameters is called in a Screen.
Batch Macro must not be called in Screens
Parameters: list of Macros and Severity.
Use this rule to verify that the batch Macros that are given as parameters are not called in a Screen.
Deprecated Macro must not be called
Parameters: list of Macros and Severity.
Use this rule to verify that the deprecated Macros that are given as parameters are not called in a Program or a Screen.
For each Macro a Macro from the list must be called
Parameters: list of Called Macros, list of Mandatory Macros, and Severity.
Use this rule to verify that if one of the Macros that are given as the first parameter is called in a Program or a Screen, one of the mandatory Macros must also be called.
Number of condition lines
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Reports that the number of condition lines in the edition lines with a type A does not exceed the deviation.
Number of Data Structure called
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the number of -CD lines in the Programs does not exceed the deviation.
Number of Data Structures with distinct organization
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Programs that the number of -CD lines with an organization different from W and L does not exceed the deviation.
Number of Macro called
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Programs, Screens, or Servers that the number of called Macros does not exceed the deviation.
Number of Segments called
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Screens that the number of -CS lines does not exceed the deviation.
Number of Segment definition called
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Screens that the number of -CS lines with a 00 line number does not exceed the deviation.
Number of technical documentation lines
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify in Programs, Screens, or Reports that the number of technical documentation lines (-GC lines) exceeds the deviation.

RPP specific templates for COBOL code review

The following rules templates are dedicated to the COBOL code review:

RPP / An inline PERFORM statement cannot exceed the specified line number limit
Parameters: Maximum number of lines in inline PERFORM statement and Severity.
RPP / Avoid CALL of user-definable routine
Parameters: Name of routine to avoid and Severity.
RPP / Avoid nesting IF statements deeper than the specified number of levels
Parameters: Maximum number of levels for nested IF statements and Severity.
RPP / Avoid using the selected compiler directives
Parameters: Compiler directives (BASIS, CBL, COPY, EJECT, REPLACE, SERVICE LABEL, SERVICE RELOAD, SKIP, TITLE) and Severity.
RPP / Avoid using the specified copybook
Parameters: Name of the copybook to avoid and Severity.
RPP / COBOL filename adheres to naming convention
Parameters: COBOL file name template and Severity.
RPP / Count specific lines
Parameters: Limit number of specific lines and Severity.
Use this rule to verify that the number of specific code lines does not exceed the limit.
RPP / EXEC CICS LINK order is only allowed for specified functions
Parameters: list of Specified functions and Severity.
Use this rule to verify, in Screens, that the LINK statement is not used outside the functions that are given as parameters. The rule does not apply to Macros.
RPP / EXEC SQL: Avoid SELECT * in WORKING STORAGE
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the SELECT * statement, except SELECT * COUNT, is not used in the WORKING-STORAGE SECTION of Programs, Screens, or Servers. The rule does not apply to Macros.
RPP / GDI: Avoid GDI operator
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the number of GDI operators does not exceed the deviation in Programs, Screens, or Servers. The rule does not apply to Macros.
RPP / No specific functions and subfunctions in the interval of specified functions
Parameters: interval of functions (beginning function code and end function code separated by a space) and Severity.
Use this rule to verify that the Programs, Screens, and Servers do not contain functions and subfunctions in the interval of the functions that are given as parameters. The rule does not apply to Macros.
RPP / No specific lines for specified Macros
Parameters: Macro names and Severity.
Use this rule to verify that, in the COBOL code of a Program, Screen, or Server, there are no deletions, overwritings, or insertions of specific lines inside the Macros that are indicated as parameters.
RPP / Number of overridden Macros in LINKAGE
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the number of overridden Macros in the LINKAGE SECTION of Programs, Screens, or Servers does not exceed the deviation.
RPP / Number of overridden Macros in PROCEDURE DIVISION
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the number of overridden Macros in the PROCEDURE DIVISION of Programs, Screens, or Servers does not exceed the deviation.
RPP / Number of overridden Macros in WORKING
Parameters: Normality threshold, Deviation, and Severity.
Use this rule to verify that the number of overridden Macros in the WORKING-STORAGE SECTION of Programs, Screens, or Servers does not exceed the deviation.
RPP / PROCEDURE DIVISION statements cannot exceed custom line number limit
Parameters: Maximum number of lines in the PROCEDURE DIVISION and Severity.
RPP / SYNCPOINT is only allowed for specified Macros
Parameters: list of Macros and Severity.
Use this rule to verify in Screens that the SYNCPOINT statement is used only in the Macros that are given as parameters.
RPP / Use a scope terminator phrase with the specified COBOL statement type
Parameters: Statements (IF, EVALUATE, READ, SEARCH, STRING, CALL) and Severity.
RPP / Use comments to describe all paragraphs
Parameters: Comment location and Severity.
RPP / Use comments to describe all sections
Parameters: Comment location and Severity.
RPP / Use the specified prefix with condition names
Parameters: Condition name prefix and Severity.
Note:
  • As parameter of rules, the Normality threshold and the Deviation represent values ​​beyond which the rule is not respected. If the normality threshold is set to 0, only the deviation value is recognized.
  • To specify a list of instances in a parameter, you can enter the values ​​separated by a comma or a space or comma + space (for example F12, F15, or F12 F15, or F12, F15).

Feedback