Skip to main content

DebtDensityReport

Struct DebtDensityReport 

Source
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 str

Stable schema tag (SCHEMA).

§order: &'static str

The ranking that produced items (DensityOrder::as_str).

§limit: usize

The requested cap on items; 0 means unlimited.

§min_lines: u32

The 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: usize

Distinct files carrying at least one retained marker, before the min_lines floor. The population items is drawn from.

§ranked_files: usize

Files that passed the min_lines floor and were therefore ranked. ranked_files > items.len() means limit truncated the list.

§short_files: usize

Files 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: usize

Files 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: usize

Retained 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: u64

Summed lines of the ranked files. The denominator behind overall_per_kloc.

§overall_per_kloc: f64

Markers 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

Source§

fn clone(&self) -> DebtDensityReport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DebtDensityReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DebtDensityReport

Source§

fn eq(&self, other: &DebtDensityReport) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DebtDensityReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DebtDensityReport

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.