pub struct ComplexityContribution {
pub line: u32,
pub col: u32,
pub metric: ComplexityMetric,
pub kind: ComplexityContributionKind,
pub weight: u16,
pub nesting: u16,
}Expand description
A single complexity increment, located at its source line/column.
weight is the amount this construct added to metric; for nested
cognitive increments weight == 1 + nesting. Consumers that render inline
(the VS Code editor breakdown) group contributions by line and sum the
weights, deferring the per-kind list to a hover.
Fields§
§line: u321-based line number where the construct begins.
col: u320-based byte column where the construct begins.
metric: ComplexityMetricWhich metric this increment contributes to.
kind: ComplexityContributionKindThe syntactic construct responsible for the increment.
weight: u16The amount added to metric at this site (1 + nesting for nested
cognitive increments, otherwise 1).
nesting: u16The nesting depth at the increment site (0 when not nested). Lets a
consumer explain a cognitive +3 as “+1 base, +2 nesting”.
Trait Implementations§
Source§impl Clone for ComplexityContribution
impl Clone for ComplexityContribution
Source§impl Debug for ComplexityContribution
impl Debug for ComplexityContribution
impl<'__de> Decode<'__de> for ComplexityContributionwhere
'__de:,
impl Encode for ComplexityContribution
Auto Trait Implementations§
impl Freeze for ComplexityContribution
impl RefUnwindSafe for ComplexityContribution
impl Send for ComplexityContribution
impl Sync for ComplexityContribution
impl Unpin for ComplexityContribution
impl UnsafeUnpin for ComplexityContribution
impl UnwindSafe for ComplexityContribution
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
Mutably borrows from an owned value. Read more