pub struct ComplexityContribution {
pub line: u32,
pub col: u32,
pub metric: ComplexityMetric,
pub kind: ComplexityContributionKind,
pub weight: u16,
pub nesting: u16,
pub literal_membership: bool,
}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”.
literal_membership: boolThis cyclomatic || increment is part of a literal membership chain:
strict equality checks of one identifier against primitive literals
(kind === "a" || kind === "b"). The literal-membership value of
health.cyclomaticPolicy removes these increments from the effective
cyclomatic value. Omitted when false, and always false under the
default standard policy.
Trait Implementations§
Source§impl Clone for ComplexityContribution
impl Clone for ComplexityContribution
Source§fn clone(&self) -> ComplexityContribution
fn clone(&self) -> ComplexityContribution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ComplexityContribution
impl Debug for ComplexityContribution
impl<'__de> Decode<'__de> for ComplexityContribution
Source§impl<'de> Deserialize<'de> for ComplexityContribution
impl<'de> Deserialize<'de> for ComplexityContribution
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComplexityContribution, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ComplexityContribution, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
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>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$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,
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
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>,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'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> ⓘ
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