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§fn clone(&self) -> ComplexityContribution
fn clone(&self) -> ComplexityContribution
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComplexityContribution
impl Debug for ComplexityContribution
impl<'__de> Decode<'__de> for ComplexityContribution
impl Encode for ComplexityContribution
Source§impl JsonSchema for ComplexityContribution
impl JsonSchema for ComplexityContribution
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for ComplexityContribution
impl Serialize for ComplexityContribution
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DecodeOwned for Twhere
T: for<'de> Decode<'de>,
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> ⓘ
Converts
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> ⓘ
Converts
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