How it works¶
The steps of a check¶
- Find files. Walk the project in a fixed order, and keep files that match
includeand noexcludepattern. - Parse. Each file goes to the parser for its language. Files are parsed in parallel, but results always come out in the same order.
- Translate. Every language is translated into one shared model of functions and their control flow. This is why a value of 7 means the same in TypeScript, Python, Java and Go.
- Measure functions. Complexity and size are computed once, from the shared model.
- Measure across files. Token streams are searched for copies, imports are traced into a dependency graph, and an LCOV report is read if one is configured.
- Apply thresholds. A measurement above its threshold becomes a finding.
- Compare. With
--baseor--baseline, every finding is labelled new, worsened, existing or resolved. - Decide. The result is incomplete if anything required was not analyzed. Otherwise it fails if a blocking finding is new or worse. Otherwise it passes.
Comparing with Git¶
With --base REF, the tool:
- finds the merge base of
HEADandREF; - exports that commit with
git archiveto a temporary folder, without touching your checkout or index; - analyzes it with today's configuration;
- compares the two results, then deletes the temporary folder.
If Git is missing, the folder is not a Git repository, or the reference does not exist, the check stops with exit code 2.
Same input, same output¶
Results are sorted with fixed keys, so the same code and configuration always produce the same
measurements, findings and diagnostics, in the same order. Only the run block of the JSON report,
with its ID, time and duration, changes between runs. This makes it safe to compare runs and to store
results.