Viewing Procedure Metrics
When you open a program in the Workbench COBOL Editor or Workbench PL/I Editor and the Code Analysis perspective, the program is parsed and analyzed to build the program structure chart and provide in-depth information about the program. The Code Analysis perspective includes a Procedures view listing metrics for all the procedures in the program and a Properties view listing the same metrics for just the selected procedure. Click on a different procedure node in the program structure chart to display the metrics for that procedure in the Properties view.
The two columns of the Properties view, Property and Value, contain the data in the table below. The same data is consolidated for all procedures in the Procedures view.
Property | Value |
|---|---|
Procedure Name | Name of the procedure. |
McCabe | The metric that relates to the number of decision points (points where the logic path splits) in the procedure. A high number indicates that the procedure is complex. Procedure nodes in the program structure chart are highlighted in shades of red indicating their McCabe Complexity metric. The higher the number, the darker the shading, relative to the other nodes in the chart. The darkest shading indicates the most complex parts of a given program, and the lightest indicates the least complex, even though the actual numbers will vary for different programs. |
Statements | The number of statements in the procedure. |
Blocks | Number of code blocks in the procedure. These code blocks are found in the logic flow chart. |
Conditionals | The number of conditional statements in the procedure. |
GOTOs | Number of GO TO statements. |
File I/O | Number of file I/O statements in the procedure. |
Performs | The number of performs in the procedure. |
Program Calls | The number of external program calls in the procedure. |
Perform Range Violations | Indicates whether any GO TO statements branch outside their procedures, which would be a perform range violation. This column only appears for COBOL programs. PL/I programs will display the default of No. |
Group Returns | Indicates whether control returns to the statement following the procedure. Yes means the procedure returns control. No means the procedure does not return control. Maybe means the procedure contains a conditionally executed GOBACK, STOP RUN, or EXIT PROGRAM and potentially does not return control. |
Starting Line | Starting line of the procedure. |
SQL Statements | The number of SQL calls in the procedure. |
The values in the Procedures view can be exported for later comparison following code changes. For more information, see Exporting-the-Program-Summary-Problems-Procedures-and-Data-Flow-Table-Views.
For more information, see: