Rational Programming Patterns provides templates of rules
to create quality control rules that contain parameters.
RPP customizable 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 customizable rule,
first define the rule with one of the templates provided in the Preferences
of Software Analyzer.
- Select .
- Click the Add Rule button.
- In the wizard that opens up, select the category where the rule
will be added and click Next.
- Select the template to use for the rule and click Next.
- Enter the values of the template parameters and click Finish.
- The created rule appears in the Current Custom Rules list
of the Preferences window. Click OK to validate
this creation.
The new rule is automatically added and available in Software
Analyzer.
Before starting the analysis of the COBOL code taking
into account the new quality control rule,
you must first define a configuration rules set in the Software Analyzer
Configurations.
For a complete documentation on the Software
Analyzer, see the Rational Developer for System z 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 given
as parameter 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 neither of the batch Macros given
as parameter is called in a Screen.
- Deprecated Macro must not be called
- Parameters: list of Macros and Severity
- Use this rule to verify that neither of the deprecated Macros
given as parameter is 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 given as 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 (-D lines) having a A-type 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
having 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 or Screens that the number
of called Macros does not exceed the deviation.
- Number of Segment 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
having 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 in-line 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 mask 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 order is not
used outside the functions given as parameter. 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 * order, except SELECT
* COUNT, is not used in -W of Programs or Screens. The rule does not
apply to Macros.
- RPP / GDI: Avoid GDI operator
- Parameters: Normality threshold, Deviation, and Severity
- Use this rule to verify in Programs or Screens that the number
of GDI operators using does not exceed the deviation. 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 in Programs and Screens that there is
no functions and subfunctions in the interval of functions given as
parameter. The rule does not apply to Macros.
- 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
-P of Programs or Screens 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
-W of Programs or Screens does not exceed the deviation.
- RPP / PROCEDURE DIVISION statements cannot exceed custom line
number limit
- Parameters: Maximum number of lines in 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 order is
only used in Macros given as parameter.
- 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 taken into account.
- 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).