pub struct FileHealthScore {Show 14 fields
pub path: PathBuf,
pub fan_in: usize,
pub fan_out: usize,
pub dead_code_ratio: f64,
pub complexity_density: f64,
pub maintainability_index: f64,
pub total_cyclomatic: u32,
pub total_cognitive: u32,
pub function_count: usize,
pub lines: u32,
pub crap_max: f64,
pub crap_above_threshold: usize,
pub crap_exempted: usize,
pub crap_effective_threshold: Option<f64>,
}Expand description
Per-file health score combining complexity, coupling, and dead code metrics.
Fields§
§path: PathBufFile path relative to the project root.
fan_in: usizeModules importing this file.
fan_out: usizeModules this file imports.
dead_code_ratio: f64Unused exports as a fraction of the file’s exports, in [0, 1].
complexity_density: f64Total cyclomatic complexity per line of code.
maintainability_index: f64Maintainability index (0-100); higher is healthier.
total_cyclomatic: u32Summed cyclomatic complexity over all units, including module and template scope.
total_cognitive: u32Summed cognitive complexity over all units, including module and template scope.
function_count: usizeComplexity units in the file, including synthetic module and template units.
lines: u32Lines of code in the file.
crap_max: f64Highest CRAP score among the file’s functions. Always the raw measured value; threshold overrides never rewrite it.
crap_above_threshold: usizeFunctions whose rounded CRAP score meets or exceeds their effective
ceiling, resolved from health.thresholdOverrides over the global
maxCrap / --max-crap value. Zero when CRAP enforcement is disabled
(global ceiling 0).
crap_exempted: usizeFunctions whose rounded CRAP score is at or above the canonical 30.0
baseline but below their effective ceiling: the count the configuration
let through. Stays 0 when the effective ceiling is stricter than 30.
When CRAP enforcement is disabled (global ceiling 0), counts every
function at or above the canonical baseline. Omitted when zero.
crap_effective_threshold: Option<f64>Lowest effective CRAP ceiling among the file’s functions, present only
when it differs from the run global (summary.max_crap_threshold).
Consumers fall back to summary.max_crap_threshold when absent.