pub struct BranchingReport {
pub split_in_place: Vec<SplitInPlace>,
pub tolerance: u32,
pub scope: BranchingScope,
pub branch_points: BranchingMetric,
pub functions: BranchingMetric,
pub peak_unit_cyclomatic: BranchingMetric,
pub branch_points_only_in_base: u32,
pub cognitive: BranchingCognitive,
pub by_file: Vec<BranchingFileDelta>,
pub by_file_omitted: u32,
}Expand description
The brief’s branching section.
Fields§
§split_in_place: Vec<SplitInPlace>Files carrying the split signature: branching within tolerance of
where it was, more functions, a smaller largest function. Empty when
none do, which is the common case and is not itself a finding. See
SplitInPlace for why this describes a shape rather than asserting a
refactor.
tolerance: u32The band inside which a file’s branching counts as held. Published because a claim against an unpublished threshold is not reproducible by a consumer.
scope: BranchingScopeSize and composition of the compared set.
branch_points: BranchingMetricBranch points over the accounting set. The two sides cover different
populations by construction: current includes files the changeset
added, previous cannot. Files present only on the base revision are in
neither, and are reported in branch_points_only_in_base.
functions: BranchingMetricFunctions over the same two populations, with the same asymmetry.
peak_unit_cyclomatic: BranchingMetricHighest single-function score across the set. Reported as context, never as evidence on its own: a split lowers it by construction, which is the whole reason this section exists.
branch_points_only_in_base: u32Base-side branch points of the files that have no head entry.
cognitive: BranchingCognitiveThe cognitive figure and what drove it.
by_file: Vec<BranchingFileDelta>The files that moved the numbers most, largest absolute branch-point change first.
by_file_omitted: u32Files with a change that the list did not name.
Implementations§
Source§impl BranchingReport
impl BranchingReport
Sourcepub fn compare(
base: &BranchingSnapshot,
head: &BranchingSnapshot,
tolerance: u32,
is_test_path: &dyn Fn(&str) -> bool,
) -> Self
pub fn compare( base: &BranchingSnapshot, head: &BranchingSnapshot, tolerance: u32, is_test_path: &dyn Fn(&str) -> bool, ) -> Self
Compare two revisions over the accounting set.
is_test_path classifies a root-relative path; the caller owns that
heuristic. Both maps must already be restricted to the accounting set
and keyed in the same space, with base-side renames remapped onto head
paths.
Sourcepub fn is_reportable(&self) -> bool
pub fn is_reportable(&self) -> bool
Whether the section says anything a reader needs.
Only a file that demonstrably split in place qualifies. The set totals alone are context, not news, and the human brief stays silent on them, matching every sibling section.