Metrics Reports

Metrics provide statistical information about your project and entities, such as the number of lines of code and the complexity of various entities.

  • Project Metrics Report – The Project Metrics Report provides metric information about the entire project. The metrics reported include: the total number of files, the total number of program units, and the total number of lines of source code.
  • Class Metrics Report – The Class Metrics Report provides the following metrics for each class that has been analyzed:
    • Total number of lines
    • Total number of blank lines
    • Total number of lines of code
    • Total number of lines that contain comments
    • Average number of lines per class
    • Average number of comment lines per class
    • Average complexity per class
    • Maximum complexity within class
    • Ratio of comment lines to code lines
  • Class OO Metrics Report – The Class OO Metrics Report provides the following object-oriented metrics for each class that has been analyzed:
    • LCOM (Percent Lack of Cohesion): 100% minus the average cohesion for class data members. A method is cohesive when it performs a single task.
    • DIT (Max Inheritance Tree): Maximum depth of the class in the inheritance tree.
    • IFANIN (Count of Base Classes): Number of immediate base classes.
    • CBO (Count of Coupled Classes): Number of other classes coupled to this class.
    • NOC (Count of Derived Classes): Number of immediate subclasses this class has.
    • RFC (Count of All Methods): Number of methods this class has, including inherited methods.
    • NIM (Count of Instance Methods): Number of instance methods this class has.
    • NIV (Count of Instance Variables): Number of instance variables this class has.
    • WMC (Count of Methods): Number of local methods this class has.
  • Program Unit Metrics Report – The Program Unit Metrics Report provides information on various metrics for each program unit that has been analyzed.
    • Lines: Total number of lines in the function.
    • Comment: Number of comment lines in the function.
    • Blank: Number of blank lines in the function.
    • Code: Number of lines in the function that contain any code.
    • Lines-exe: Lines of code in the function that contain no declaration.
    • Lines-decl: Lines of code in the function that contain a declaration or part of a declaration.
    • Stmt-exe: Number of executable statements in the function.
    • Stmt-decl: Number of declarative statements in the function.
    • Ratio Comment/Code: Ratio of comment lines to code lines. (comment_lines/code_lines)
  • File Metrics Report – The File Metrics Report provides information similar to that in the Program Unit Metrics Report. However, it is organized by file rather than by program unit.
  • File Average Metrics Report – The File Average Metrics Report provides averages for the functions within a file. All lines outside any function are ignored when calculating the averages. The following metrics are provided for each function:
    • McCabe Cyclomatic: The average number of independent paths through the functions in this file. The higher this metric the more likely a program unit is to be difficult to test and maintain without error.
    • Modified: Same as McCabe Cyclomatic complexity except that each case statement is not counted; the entire switch statement counts as 1.
    • Strict: Same as McCabe Cyclomatic complexity except that && and || also count as 1.
    • Essential: Measures the amount of unstructured code in a function.
    • Lines: Average number of lines in the functions in this file.
    • Code: Average number of lines that contain any code in the functions in this file.
    • Comment: Average number of comment lines in the functions in this file.
    • Blank: Average number of blank lines in the functions in this file.