pub struct AuditKeySnapshot {Show 14 fields
pub type_aware_identity: Option<SemanticAnalysisIdentity>,
pub type_aware_gap_signature: Vec<String>,
pub syntactic_dead_code: Option<FxHashSet<String>>,
pub dead_code: FxHashSet<String>,
pub unprovable_dead_code: FxHashSet<String>,
pub health: ComplexityBaseline,
pub styling: FxHashSet<String>,
pub dupes: FxHashSet<String>,
pub dupe_groups: Vec<BaseCloneGroup>,
pub boundary_edges: FxHashSet<String>,
pub cycles: FxHashSet<String>,
pub public_api: FxHashSet<String>,
pub branching: FxHashMap<String, FileBranching>,
pub inherited_health: Vec<ComplexityBaseline>,
}Expand description
Attribution keys of one audit side (the base commit, or the head run when the base pass is skipped).
Every key set is root-relative, so a base snapshot taken in a temporary worktree joins the head run by key.
Fields§
§type_aware_identity: Option<SemanticAnalysisIdentity>Semantic identity of a type-aware dead-code pass, None for a
syntactic pass.
type_aware_gap_signature: Vec<String>Sorted reasons and omissions of the semantic queries that did not complete. Two sides with different gaps cannot compare semantic keys.
syntactic_dead_code: Option<FxHashSet<String>>Dead-code keys captured before type-aware refinement. None when the
pass ran without type-aware analysis (then dead_code is already
syntactic). The degraded attribution path compares these.
dead_code: FxHashSet<String>Dead-code keys.
unprovable_dead_code: FxHashSet<String>Dead-code collections, by JSON key, that this side did not report
because it could not prove their findings (see
fallow_engine::unprovable::unprovable_dead_code_collections). A
head finding of such a collection is inherited.
health: ComplexityBaselineComplexity findings by identity key, with their metric values. The new-only gate compares the metric values of matched findings.
styling: FxHashSet<String>Styling keys.
dupes: FxHashSet<String>Clone-group keys.
dupe_groups: Vec<BaseCloneGroup>Instance locations of the clone groups, for the diverged-clone-sibling
rule. The paths stay base paths: the rename remap does not move them.
boundary_edges: FxHashSet<String>Cross-zone boundary edge keys (<from_zone>->-<to_zone>), one for each
zone pair.
cycles: FxHashSet<String>Canonical circular-dependency keys.
public_api: FxHashSet<String>Exports-aware public-export keys (<rel_path>::<name>). Empty unless
the surface computed them from the retained module graph.
branching: FxHashMap<String, FileBranching>Branching totals per root-relative path. Threshold-blind and suppression-blind, so a threshold override or an ignore comment cannot move the head-versus-base comparison.
inherited_health: Vec<ComplexityBaseline>Complexity findings of the inherited bases (see
AuditKeySnapshot::absorb_inherited). A head finding is introduced
only when it is introduced against health and against each of these.
Implementations§
Source§impl AuditKeySnapshot
impl AuditKeySnapshot
Sourcepub fn from_view(view: &AuditAnalysesView<'_>) -> Self
pub fn from_view(view: &AuditAnalysesView<'_>) -> Self
Take the attribution keys of one set of analyses.
Sourcepub fn absorb_inherited(&mut self, inherited: Self)
pub fn absorb_inherited(&mut self, inherited: Self)
Treat the findings of an inherited base as inherited too.
An inherited base is a commit of the default branch that the change
merged. A key set takes the union, so a key that either side has is not
introduced. Complexity findings keep one baseline per side, because
their match rule pairs each base finding with at most one head finding.
The clone locations, the branching totals and the type-aware identity
stay those of the primary base. When the type-aware identity or the
query gaps differ, the refined dead-code keys stay out. inherited
must already use head paths.
Sourcepub fn inherit_unprovable_dead_code(&mut self, head: &DeadCodeView<'_>)
pub fn inherit_unprovable_dead_code(&mut self, head: &DeadCodeView<'_>)
Treat the head findings of each collection that this side could not prove as inherited.
The base snapshot is a checkout of committed files. A gitignored
workspace member (a cloned sub-repository) is missing there, so the
base does not report a class that the head reports. The keys of those
head findings join the dead-code key sets, so every surface that
compares keys (verdict, attribution counts, introduced flags) reads
them as inherited.
Sourcepub fn remap_for_renames(&mut self, renames: &[RenamedFile], root: &Path)
pub fn remap_for_renames(&mut self, renames: &[RenamedFile], root: &Path)
Relocate the keys of renamed files onto their head paths.
Applies to every path-keyed family (dead code, complexity, styling, duplication, cycles, public API, branching). Boundary-edge keys are zone-pair keys without a path, and the type-aware identity has no path, so they stay as they are. The syntactic dead-code keys of the degraded type-aware path also stay as they are.
Sourcepub fn to_programmatic(&self) -> AuditProgrammaticKeySnapshot
pub fn to_programmatic(&self) -> AuditProgrammaticKeySnapshot
The public key snapshot of the programmatic audit output. Its health set also holds the styling keys.
Trait Implementations§
Source§impl Clone for AuditKeySnapshot
impl Clone for AuditKeySnapshot
Source§impl Debug for AuditKeySnapshot
impl Debug for AuditKeySnapshot
Auto Trait Implementations§
impl Freeze for AuditKeySnapshot
impl RefUnwindSafe for AuditKeySnapshot
impl Send for AuditKeySnapshot
impl Sync for AuditKeySnapshot
impl Unpin for AuditKeySnapshot
impl UnsafeUnpin for AuditKeySnapshot
impl UnwindSafe for AuditKeySnapshot
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more