Skip to main content

Stats

Struct Stats 

Source
pub struct Stats {
Show 24 fields pub vcs_schema_version: u32, pub risk_score_version: u32, pub long_window_days: u32, pub recent_window_days: u32, pub commits_long: u32, pub commits_recent: u32, pub churn_long: u64, pub churn_recent: u64, pub authors_long: u32, pub authors_recent: u32, pub ownership_top_share: f64, pub burst: f64, pub bug_fix_commits: u32, pub security_fix_commits: u32, pub revert_commits: u32, pub age_days: u32, pub last_modified_days: u32, pub change_entropy_long: f64, pub change_entropy_recent: f64, pub cochange_entropy_long: f64, pub cochange_entropy_recent: f64, pub risk_score: f64, pub hotspot_score: Option<f64>, pub author_ids: Option<Vec<String>>,
}
Available on crate feature vcs-git only.
Expand description

Per-file change-history metrics.

One record per tracked, non-binary, non-symlink file present at the target ref. A tracked file with no activity in the window is emitted with zero counts — distinct from an untracked file, which has no vcs block at all.

All scores are ordinal: rank files by them, do not read absolute magnitudes. The serialized shape lives in crate::wire::Vcs; this struct is the compute-side source the wire form is projected from.

Fields§

§vcs_schema_version: u32

Output-shape version (VCS_SCHEMA_VERSION).

§risk_score_version: u32

Composite-formula version (RISK_SCORE_VERSION).

§long_window_days: u32

Long window length, in days.

§recent_window_days: u32

Recent window length, in days.

§commits_long: u32

Distinct commits touching the file in the long window.

§commits_recent: u32

Distinct commits touching the file in the recent window.

§churn_long: u64

Σ(added + deleted) lines in the long window.

§churn_recent: u64

Σ(added + deleted) lines in the recent window.

§authors_long: u32

Distinct canonical author identities in the long window.

§authors_recent: u32

Distinct canonical author identities in the recent window.

§ownership_top_share: f64

Top-author share of edits in the long window, in [0, 1].

§burst: f64

commits_recent / commits_long, clamped to [0, 1].

§bug_fix_commits: u32

Long-window commits whose message matched a bug-fix keyword.

§security_fix_commits: u32

Long-window commits whose message matched a security keyword.

§revert_commits: u32

Long-window commits whose subject is a revert / rollback.

§age_days: u32

Days since the file’s first in-window commit (capped at window).

§last_modified_days: u32

Days since the file’s most recent in-window commit.

§change_entropy_long: f64

Change entropy over the long window (Hassan 2009 History Complexity Metric, in bits): the file’s accumulated share Σ pᵢ·Hᵢ of the churn-distribution entropy of every commit it took part in. Higher = the file participates in more scattered, distributed changes. 0.0 means it only ever changed alone.

§change_entropy_recent: f64

Change entropy restricted to the recent window.

§cochange_entropy_long: f64

Co-change graph entropy over the long window (arXiv 2504.18511, 2025, in bits): the Shannon entropy of the file’s co-change edge-weight distribution. Higher = its changes ripple across many different partners. 0.0 is computed, not missing — the file has no co-change neighbours (only single-file commits).

§cochange_entropy_recent: f64

Co-change graph entropy restricted to the recent window.

§risk_score: f64

Composite risk score (weighted or percentile, per options).

§hotspot_score: Option<f64>

Complexity × recent-churn hotspot score; Some only when AST metrics were computed alongside the history.

§author_ids: Option<Vec<String>>

SHA-256-hashed canonical author identities, sorted; Some only under --emit-author-details.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Stats

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 Stats

Source§

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

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

impl Default for Stats

Source§

fn default() -> Stats

Returns the “default value” for a type. Read more
Source§

impl From<&Stats> for Vcs

Source§

fn from(s: &Stats) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Stats

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Stats

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnsafeUnpin for Stats

§

impl UnwindSafe for Stats

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.