Skip to main content

BranchingReport

Struct BranchingReport 

Source
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: u32

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

Size and composition of the compared set.

§branch_points: BranchingMetric

Branch 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: BranchingMetric

Functions over the same two populations, with the same asymmetry.

§peak_unit_cyclomatic: BranchingMetric

Highest 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: u32

Base-side branch points of the files that have no head entry.

§cognitive: BranchingCognitive

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

Files with a change that the list did not name.

Implementations§

Source§

impl BranchingReport

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for BranchingReport

Source§

fn clone(&self) -> Self

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 BranchingReport

Source§

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

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

impl PartialEq for BranchingReport

Source§

fn eq(&self, other: &Self) -> 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 BranchingReport

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 BranchingReport

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more