Maintainability Index Report

The Maintainability Index Report is a measurement that is intended to track maintainability and to indicate when it becomes cheaper or less risky to rewrite code instead of changing it. The Maintainability Index report presents the combined maintainability, McCabe, and Halstead complexity measurements for the current project.

To define the Maintainability Index report settings for the current project, in Explore Projects view, go to the Mainframe Reports list in the pane to the right then select Complexity Reports. Right-click the Maintainability Index Report and select Show settings.

In the Report settings dialog window, the Thresholds tab presents the maintainability thresholds (Difficult, Moderate, and Easy) to be considered when IBM® AD Analyze calculates the Maintainability Index for the current analysis. Modify the default values as needed. The threshold for "Easy" cannot be modified.

A color is assigned by default to each maintainability level; it is the color that is used in the report diagrams to represent a particular maintainability level. To change the default color, double-click the color chip and then select the desired color. Use Restore defaults button to return to the default selection.

To generate this report, in Explore Projects view, go to the Mainframe Reports list in the pane to the right. Select Complexity Reports then double-click the desired report to display the report wizard. The Available programs area displays the resources available for report generation and allows the user to select the resources to be included in the report. Use the Name field to filter the contents of the list. Place the cursor over an icon to display a tooltip about the type of resource it displays and click it to display only the selected type of resource. To display the full name of the resource type, click the white arrow button to the left of the dialog window.

In Report generation options area, the report appendix is displayed by default. Choose what additional data to include in the appendix: show input details in appendix. To show only the report summary, select the appropriate option.

Use the arrow buttons to move the resources between the Available and Selected lists then click Finish to generate the report.

The Report summary section presents two charts that show the Maintainability index percentage distribution and the File maintainability index distribution.

The Report details section shows for each program the computed Maintainability index value and the maintainability level attributed (according to the values set in the Maintainability Index Report Settings dialog).

The Maintainability Index Report is computed by using the following formula:
171 - 5.2 * ln(Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * ln(Number of statements)
Where:
  • Halstead Volume is computed as:
    V = N * log2(n)
    Where:
    • N represents the Program Length and is computed as:
      N = N1 + N2

      N1 = the total number of operators

      N2 = the total number of operands

    • n represents the Vocabulary size and is computed as:
      n = n1 + n2

      n1 = the number of distinct operators

      n2 = the number of distinct operands

  • Cyclomatic Complexity is computed as:
    Incrementing by 1 the total number of statements that contain flow decisions