Defining Potential Code Anomalies
Within the documentation for Enterprise Analyzer it defines the process for adding clipper queries to the Potential Code Anomalies section of the Executive Reports. Unfortunately the documentation is wrong in that it does not give all the parameters that are required to get the clipper query to run correctly.
What is the correct process for defining Potential Code Anomalies?
The way to setup the clipper query in the CodeDefects.xml is as follows:
Criterion="path of criterion"
Model Type is defined as:
The Interactive Analysis model for the source files to be searched, eg, "COBOL".
List of Commonly used Model Types
COBOL - Cobol source files
JAVAFILE - Java source files
JCL - JCL source files
NATURAL - NATURAL source files
PLI - PL/I source files
RPG - RPG AST Hypercode Model source files
VBP - Visual Basic Project files
Points to Note:
- To get the Code Anomalies to appear on the report, not only does the Codedefect entry need to be enabled, but the Project Option, Executive Report, Code Defects needs to be selected.
- Not all possible model types are listed above. Only the common model types have been listed that clipper queries can be run against. Some model types like PL/SQL files do not have level 2 support, so cannot have clipper queries run against them. For more information on this refer to the on-line help system chapter Supported Features by Language.
- For some languages there are no pre-defined clipper queries, so they have not been listed. Examples are C and C++.
Example of different defect entries
<DEFECT Criterion="General:Coding Standards\MOVE Statements\Possible Sign Loss" ListName="Possible Sign Loss" Caption="Possible Sign Loss" Group="Cobol Coding Standards" Enabled="True" Internal="False" Id="Sign" Model="COBOL"/>
<DEFECT Criterion="General:Coding Standards\Unaligned Assignments" ListName="Unaligned Assignment" Caption="Unaligned Assignment" Group="Pli Coding Standards" Enabled="True" Internal="False" Id="Unaligned" Model="PLI"/>
<DEFECT Criterion="General:Java Best Practices\Basic\Empty If Statements" ListName="Empty If Stats" Caption="Empty If Statements" Group="Java Results" Enabled="True" Internal="False" Id="EmpIfStnts" Model="JAVAFILE"/>
Incident - 2656393