Paths Log(x) 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.
Paths Log(x)
API ID: CountPathLogLanguages: Ada, Basic, C#, C++, Fortran, Java, Jovial, Pascal, Python, Rust, Web
Targets: Files, Functions, Modules, Packages, Subprograms
The base 10 logarithm Log(x) of the number of unique paths though a body of code, not counting abnormal exits or gotos, rounded to an integer value.
For example:
void pathDemo() {
if (a)
dothis();
if (b)
dothat();
}
pathDemo has 4 paths. Log10(4) is about 0.6, which rounds to 1, so its Paths Log(x) is 1.
Unlike Paths, this isn't capped at 999,999,999 paths, so it keeps giving a meaningful (if compressed) signal for functions whose true path count is far larger than that.
See Paths for the unrounded path count.
- 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 "Paths" option.