Skip to main content

Module scoring

Module scoring 

Source

Structs§

AnalysisCountsSnapshot
Per-path snapshot of analysis-pipeline findings, retained alongside the pre-aggregated analysis_counts so that workspace- or group-scoped runs can recompute counts without re-running the full pipeline.
FileScoreOutput
Output from compute_file_scores, including auxiliary data for refactoring targets.
IstanbulCoverage
Loaded Istanbul coverage data, keyed by canonical file path.
IstanbulFileCoverage
Pre-processed per-function coverage data for a single file, derived from Istanbul coverage-final.json.
PerFunctionCrap
Per-function CRAP data used to emit --max-crap findings.

Enums§

FileScoreConcern
Which signal places a file at its triage rank: its structural quality (low maintainability index) or its untested complexity (CRAP risk). Surfaced per row so the human file-scores table can label why a file sits where it does when the two axes disagree (e.g. a low-CRAP file outranking a higher-CRAP one because its MI is the worse signal).

Functions§

file_score_concern_axis
Classify which concern drove score to its rank. A file with no CRAP risk is always Structural; otherwise the larger concern wins, with ties (and the boundary where the two are equal) resolving to Risk because untested complexity is the more urgent signal to act on.
resolve_relative_to_root
Resolve a relative path against the fallow project root. Returns path unchanged when it is absolute or project_root is None. Matches the convention every other path-shaped CLI input uses, so a monorepo CI run invoked from the workspace root with --root sub-project finds sub-project/relative/path.json instead of cwd/relative/path.json.