pub struct DebtDensityReport {
pub schema: &'static str,
pub order: &'static str,
pub limit: usize,
pub min_lines: u32,
pub files_with_markers: usize,
pub ranked_files: usize,
pub short_files: usize,
pub unknown_length_files: usize,
pub total_markers: usize,
pub total_lines: u64,
pub overall_per_kloc: f64,
pub items: Vec<DensityItem>,
}Expand description
Intent-debt density: markers per file normalised by file length, ranked.
The counterpart to debt, which reports markers and therefore ranks large
files first by construction.
Fields§
§schema: &'static strStable schema tag (SCHEMA).
order: &'static strThe ranking that produced items (DensityOrder::as_str).
limit: usizeThe requested cap on items; 0 means unlimited.
min_lines: u32The min_lines floor applied. Files shorter than this are excluded from
the ranking and counted in short_files; 0 disables the floor.
The floor exists because density is unstable in the denominator’s tail: a
3-line stub file with one marker scores 333 per kloc, which is true and
tells the reader nothing. Excluding those files is a ranking decision,
not a suppression — they stay in files_with_markers and total_markers.
files_with_markers: usizeDistinct files carrying at least one retained marker, before the
min_lines floor. The population items is drawn from.
ranked_files: usizeFiles that passed the min_lines floor and were therefore ranked.
ranked_files > items.len() means limit truncated the list.
short_files: usizeFiles excluded from the ranking by the min_lines floor — reported, not
silently dropped, so a short-file-heavy repository cannot read as a clean one.
unknown_length_files: usizeFiles whose marker count is known but whose length is not: no file
node, or one carrying no meta.lines. Excluded from the ranking, because
a density with no denominator is not a number — and reported, because
silently omitting them would understate the inventory.
total_markers: usizeRetained markers across every file in files_with_markers, including
those the floor excluded. Matches DebtReport::total for the same
filters, minus any marker with no path.
total_lines: u64Summed lines of the ranked files. The denominator behind
overall_per_kloc.
overall_per_kloc: f64Markers per 1,000 lines across the ranked files taken together — the
baseline a single file’s per_kloc should be read against. 0.0 when
nothing was ranked.
items: Vec<DensityItem>The ranked files: by order descending, ties broken by path ascending.
Trait Implementations§
Source§impl Clone for DebtDensityReport
impl Clone for DebtDensityReport
Source§fn clone(&self) -> DebtDensityReport
fn clone(&self) -> DebtDensityReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more