pub struct Accumulator { /* private fields */ }vcs-git only.Expand description
Mutable per-file accumulator threaded through the history walk.
Holds the raw sets and counters; Accumulator::finalize collapses
them into a Stats. Author edits credit every participant of a
touching commit (author plus Co-authored-by trailers) one edit, so
the distinct-author count and the ownership ratio both account for
co-authorship.
Implementations§
Source§impl Accumulator
impl Accumulator
Sourcepub fn record(&mut self, change: &ChangeRecord<'_>)
pub fn record(&mut self, change: &ChangeRecord<'_>)
Fold one commit’s effect on this file into the running totals.
Sourcepub fn finalize(
&self,
now: i64,
options: &Options,
cochange_long: f64,
cochange_recent: f64,
) -> Stats
pub fn finalize( &self, now: i64, options: &Options, cochange_long: f64, cochange_recent: f64, ) -> Stats
Collapse the accumulator into the serializable Stats.
now is the reference timestamp (wall clock or --as-of).
cochange_long / cochange_recent are the file’s co-change graph
entropies (computed by the backend from the whole-walk graph, which
the per-file accumulator cannot see), folded into the score here so
the weighted formula stays the single risk-score authority. The
resulting risk score uses the weighted formula; percentile
re-ranking is a whole-set pass applied later by the backend.
Trait Implementations§
Source§impl Clone for Accumulator
impl Clone for Accumulator
Source§fn clone(&self) -> Accumulator
fn clone(&self) -> Accumulator
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more