scitools.com

← Metric catalog

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: CountPathLog
Languages: 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.


Targets By Language: Configuration: