Essential Complexity is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
Essential Complexity
API ID: EssentialAlso Known As: ev(G)
Languages: Ada, Basic, C#, C++, Fortran, Java, Jovial, Pascal, Python, Rust, Web
Targets: Files, Functions, Modules, Packages, Subprograms
The number of decision points + 1 after control graph reduction.
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 calculates 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 Essential Complexity > 2. (You never get 2 since a graph with complexity 2 is always reducible to a graph with complexity 1)
Also known as McCabe - ev(G).
- Ada: Type, Entry, Function, Package, Procedure, Protected, Task
- Basic: Method
- C#: Method
- C++: Function
- Fortran: Module, Block Data, Function, Program, Subroutine
- Java: Method
- Jovial: Subroutine
- Pascal: Compunit, Function, Procedure
- Python: File, Function
- Rust: File, Function
- Web: File
- This metric can be enabled from "Project Configuration/Metrics/Complexity" with the "Essential" option.