What Metrics does Understand have?

The below metrics included with Understand have evolved over many years to accommodate common customer requests. However, we recognize that you may need something different. To help you develop custom metrics there is a full API interface to the Understand database as well as a fully developed plugin mechanism.



Complexity Metrics

Select to view a specific type of metric:



Friendly Name API Name Description
Average Cyclomatic Complexity AvgCyclomatic Average cyclomatic complexity for all nested functions or methods.
Average Modified Cyclomatic Complexity AvgCyclomaticModified Average modified cyclomatic complexity for all nested functions or methods.
Average Strict Cyclomatic Complexity AvgCyclomaticStrict Average strict cyclomatic complexity for all nested functions or methods.
Average Essential Cyclomatic Complexity AvgEssential Average Essential complexity for all nested functions or methods.
Average Essential Strict Modified Complexity AvgEssentialStrictModified Average strict modified essential complexity for all nested functions or methods.
Paths CountPath Number of possible paths, not counting abnormal exits or gotos. [aka NPATH]
Cyclomatic Complexity Cyclomatic Cyclomatic complexity.
Modified Cyclomatic Complexity CyclomaticModified Modified cyclomatic complexity.
Strict Cyclomatic Complexity CyclomaticStrict Strict cyclomatic complexity.
Essential Complexity Essential Essential complexity. [aka Ev(G)]
Essential Strict Modified Complexity EssentialStrictModified Strict Modified Essential complexity.
Knots Knots Measure of overlapping jumps.
Max Cyclomatic Complexity MaxCyclomatic Maximum cyclomatic complexity of all nested functions or methods.
Max Modified Cyclomatic Complexity MaxCyclomaticModified Maximum modified cyclomatic complexity of nested functions or methods.
Max Strict Cyclomatic Complexity MaxCyclomaticStrict Maximum strict cyclomatic complexity of nested functions or methods.
Max Essential Complexity MaxEssential Maximum essential complexity of all nested functions or methods.
Max Knots MaxEssentialKnots Maximum Knots after structured programming constructs have been removed.
Max Essential Strict Modified Complexity MaxEssentialStrictModified Maximum strict modified essential complexity of all nested functions or methods.
Depth of Inheritance Tree MaxInheritanceTree Maximum depth of class in inheritance tree. [aka DIT]
Nesting MaxNesting Maximum nesting level of control constructs.
Minimum Knots MinEssentialKnots Minimum Knots after structured programming constructs have been removed.
Comment to Code Ratio RatioCommentToCode Ratio of comment lines to code lines.
Sum Cyclomatic Complexity SumCyclomatic Sum of cyclomatic complexity of all nested functions or methods. [aka WMC]
Sum Modified Cyclomatic Complexity SumCyclomaticModified Sum of modified cyclomatic complexity of all nested functions or methods.
Sum Strict Cyclomatic Complexity SumCyclomaticStrict Sum of strict cyclomatic complexity of all nested functions or methods.
Sum Essential Complexity SumEssential Sum of essential complexity of all nested functions or methods.
Sum Essential Strict Modified Complexity SumEssentialStrictModified Sum of strict modified essential complexity of all nested functions or methods.

Average Cyclomatic Complexity

API Name: AvgCyclomatic
Description: Average cyclomatic complexity for all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
PL/M: Project,File
Python: Project,File,Class
VHDL: Project,File,Architecture
Cobol: Project,File
Web: Project,File,PHP Class,PHP Interface

Back to Top

Average Modified Cyclomatic Complexity

API Name: AvgCyclomaticModified
Description: Average modified cyclomatic complexity for all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
PL/M: Project,File
Python: Project,File,Class
VHDL: Project,File,Architecture
Cobol: Project,File
Web: Project,File,PHP Class,PHP Interface

Back to Top

Average Strict Cyclomatic Complexity

API Name: AvgCyclomaticStrict
Description: Average strict cyclomatic complexity for all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Java: Project,File,Class,Interface
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Average Essential Cyclomatic Complexity

API Name: AvgEssential
Description: Average essential cyclomatic complexity for all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Average Essential Strict Modified Complexity

API Name: AvgEssentialStrictModified
Description: Average strict modified essential complexity for all nested functions or methods.
Metric available for:

Ada: Project,File,Package

Back to Top

Paths

API Name: CountPath
Research: NPATH
Description: Number of unique paths though a body of code, not counting abnormal exits or gotos.
Metric available for:

C/C++: Project,Function
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,Method
Fortran: Project,Module,Block Data,Function,Program,Subroutine
Java: Project,Method
Jovial: Project,Subroutine
Pascal: Project,Compunit,Function,Procedure
Python: Project,File,Function
Web: Project,File

Back to Top

Cyclomatic Complexity

API Name: Cyclomatic
Research: McCabe Complexity (v(G))
Description: McCabe Cyclomatic complexity as per the original NIST paper on the subject.
Edges – Nodes + Connected Components
McCabe also proved that the cyclomatic complexity of any structured program with only one entrance point and one exit point is equal to the number of decision points contained in that program plus one (refer to section V for the proof).
Understand counts the keywords for decision points (FOR, WHILE, etc) and then adds 1. For a switch statement, each ‘case’ is counted as 1 and the ‘switch’ itselfs adds one to the final Cyclomatic Complexity count.
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,Method
Fortran: Project,Module,Block Data,Function,Program,Subroutine
Java: Project,Method
Jovial: Project,Subroutine
Pascal: Project,Compunit,Function,Procedure
PL/M: Project,Procedure
Python: Project,File,Function
VHDL: Project,Procedure,Function,Process
Cobol: Project,Paragraph,Section
Web: Project,File

Back to Top

Modified Cyclomatic Complexity

API Name: CyclomaticModified
Description: Modified McCabe Cyclomatic complexity. The Cyclomatic Complexity except that each decision in a multi-decision structure (switch in C/Java, Case in Ada, computed Goto and arithmetic if in FORTRAN) statement is not counted and instead the entire multi-way decision structure counts as 1
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,Method
Fortran: Project,Module,Block Data,Function,Program,Subroutine
Java: Project,Method
Jovial: Project,Subroutine
Pascal: Project,Compunit,Function,Procedure
PL/M: Project,Procedure
Python: Project,File,Function
VHDL: Project,Procedure,Function,Process
Cobol: Project,Paragraph,Section
Web: Project,File

Back to Top

Strict Cyclomatic Complexity

API Name: CyclomaticStrict
Description: Strict cyclomatic complexity. The Cyclomatic Complexity with logical conjunction and logical and in conditional expressions also adding 1 to the complexity for each of their occurrences.
i.e. The statement if (a && b || c) would have a cyclomatic of 1 but a strict cycolmatic of 3
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,Method
Java: Project,Method
Jovial: Project,Subroutine
Pascal: Project,Compunit,Function,Procedure
Python: Project,File,Function
VHDL: Project,Procedure,Function,Process
Web: Project,File

Back to Top

Essential Complexity

API Name: Essential
Research: ev(G)
Description: Essential complexity is the Cyclomatic complexity after iteratively replacing all well structured control structures with a single statement. Structures such as if-then-else and while loops are considered well structured.
Understand calculate the essential complexity by removing all the structured subgraphs from the control graph and then calculating the complexity. A graph that has only the regular single entry/single exit loops or branches will be reducible to a graph with complexity one. Any branches into or out of a loop or decision will make the graph non-reducible and will have essentialcomplexity > 2. (You never get 2 since a graph with complexity 2 is always reducible to a graph with complexity 1).
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,Method
Fortran: Project,Module,Block Data,Function,Program,Subroutine
Java: Project,Method
Jovial: Project,Subroutine
Pascal: Project,Compunit,Function,Procedure
Python: Project,File,Function
Web: Project,File

Back to Top

Essential Strict Modified Complexity

API Name: EssentialStrictModified
Description: Strict Modified Essential complexity. The Cyclomatic complexity with short circuit operators (and then/or else) as unstructured but only adds one for all structured paths through case statements after graph reduction.
Metric available for:

Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task

Back to Top

Knots

API Name: Knots
Description: Measure of overlapping jumps. If a piece of code has arrowed lines indicating where every jump in the flow of control occurs, a knot is defined as where two such lines cross each other. The number of knots is proportional to the complexity of the control flow.
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Java: Project,Method

Back to Top

Max Cyclomatic Complexity

API Name: MaxCyclomatic
Description: Maximum cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Max Modified Cyclomatic Complexity

API Name: MaxCyclomaticModified
Description: Maximum modified cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Max Strict Cyclomatic Complexity

API Name: MaxCyclomaticStrict
Description: Maximum strict cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class

Back to Top

Max Essential Complexity

API Name: MaxEssential
Description: Maximum essential complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Max Knots

API Name: MaxEssentialKnots
Description: Maximum Knots after structured programming constructs have been removed.
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Java: Project,Method

Back to Top

Max Essential Strict Modified Complexity

API Name: MaxEssentialStrictModified
Description: Maximum strict modified essential complexity of all nested functions or methods.
Metric available for:

Ada: Project,File,Package

Back to Top

Depth of Inheritance Tree

API Name: MaxInheritanceTree
Research: Chidamber & Kemerer – Depth of Inheritance Tree (DIT)
Description: The depth of a class within the inheritance hierarchy is the maximum number of nodes from the class node to the root of the inheritance tree. The root node has a DIT of 0. The deeper within the hierarchy, the more methods the class can inherit, increasing its complexity.
Metric available for:

C/C++: Project,Class,Struct,Union Detailed Example
C#: Project,Class,Struct
Java: Project,Class,Interface
Pascal: Project,Class,Interface
Python: Project,Class
Web: Project,PHP Class,PHP Interface

Back to Top

Nesting

API Name: MaxNesting
Description: Maximum nesting level of control constructs (if, while, for, switch, etc.) in the function.
Metric available for:

C/C++: Project,File,Class,Struct,Union,Function Detailed Example
C#: Project,File,Class,Struct,Method
Ada: Project,File,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,File,Method,Class,Struct
Fortran: Project,File,Module,Block Data,Function,Program,Subroutine
Java: Project,File,Class,Interface,Method
Jovial: Project,File,Subroutine
Pascal: Project,File,Class,Interface,Compunit,Function,Procedure
Python: Project,File,Class,Function
Web: Project,File,PHP Class,PHP Interface

Back to Top

Minimum Knots

API Name: MinEssentialKnots
Description: Minimum Knots after structured programming constructs have been removed.
Metric available for:

C/C++: Project,Function Detailed Example
C#: Project,Method
Ada: Project,Type,Entry,Function,Package,Procedure,Protected,Task
Java: Project,Method

Back to Top

Comment to Code Ratio

API Name: RatioCommentToCode
Description: Ratio of number of comment lines to number of code lines. Note that because some lines are both code and comment, this could easily yield percentages higher than 100
Metric available for:

C/C++: Project,File,Class,Struct,Union,Function Detailed Example
C#: Project,File,Class,Method
Ada: Project,File,Type,Entry,Function,Package,Procedure,Protected,Task
Basic: Project,File,Method,Module,Class
Fortran: Project,File,Block Data,Function,Program,Subroutine
Java: Project,File,Class,Interface,Method
Jovial: Project,File,Module,Subroutine
Pascal: Project,File,Class,Interface,Compunit,Function,Procedure
PL/M: Project,File,Procedure
Python: Project,File,Class,Function
VHDL: Project,File,Procedure,Function,Architecture
Web: Project,File

Back to Top

Sum Cyclomatic Complexity

API Name: SumCyclomatic
Research: Chidamber & Kemerer – Weighted Methods per Class (WCM)
Description: Sum of cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Sum Modified Cyclomatic Complexity

API Name: SumCyclomaticModified
Description: Sum of modified cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Sum Strict Cyclomatic Complexity

API Name: SumCyclomaticStrict
Description: Sum of strict cyclomatic complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Pascal: Project,File,Class,Interface,Compunit
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Sum Essential Complexity

API Name: SumEssential
Description: Sum of essential complexity of all nested functions or methods.
Metric available for:

C/C++: Project,File,Class,Struct,Union Detailed Example
C#: Project,File,Class,Struct
Ada: Project,File,Package
Basic: Project,File,Class,Struct
Fortran: Project,File
Java: Project,File,Class,Interface
Jovial: Project,File
Python: Project,File,Class
Web: Project,File,PHP Class,PHP Interface

Back to Top

Sum Essential Strict Modified Complexity

API Name: SumEssentialStrictModified
Description: Sum of strict modified essential complexity of all nested functions or methods.
Metric available for:

Ada: Project,File,Package

Back to Top