pub enum ExceededThreshold {
Cyclomatic,
Cognitive,
Both,
Crap,
CyclomaticCrap,
CognitiveCrap,
All,
}Expand description
Which complexity threshold was exceeded.
Variants§
Cyclomatic
Only cyclomatic exceeded.
Cognitive
Only cognitive exceeded.
Both
Both cyclomatic and cognitive exceeded (may or may not also exceed CRAP).
Crap
Only CRAP exceeded (cyclomatic and cognitive are under threshold).
CyclomaticCrap
Cyclomatic and CRAP exceeded.
CognitiveCrap
Cognitive and CRAP exceeded.
All
Cyclomatic, cognitive, and CRAP all exceeded.
Implementations§
Source§impl ExceededThreshold
impl ExceededThreshold
Sourcepub fn from_bools(cyclomatic: bool, cognitive: bool, crap: bool) -> Self
pub fn from_bools(cyclomatic: bool, cognitive: bool, crap: bool) -> Self
Classify a finding from which individual thresholds were exceeded.
Panics if all three bools are false; callers are expected to only
construct an ExceededThreshold for findings that exceeded at least
one threshold.
Sourcepub const fn includes_cyclomatic(self) -> bool
pub const fn includes_cyclomatic(self) -> bool
True when the cyclomatic threshold contributed to the finding.
Sourcepub const fn includes_cognitive(self) -> bool
pub const fn includes_cognitive(self) -> bool
True when the cognitive threshold contributed to the finding.
Sourcepub const fn includes_crap(self) -> bool
pub const fn includes_crap(self) -> bool
True when the CRAP threshold contributed to the finding.
Trait Implementations§
Source§impl Clone for ExceededThreshold
impl Clone for ExceededThreshold
impl Copy for ExceededThreshold
Source§impl Debug for ExceededThreshold
impl Debug for ExceededThreshold
Source§impl<'de> Deserialize<'de> for ExceededThreshold
impl<'de> Deserialize<'de> for ExceededThreshold
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ExceededThreshold
impl RefUnwindSafe for ExceededThreshold
impl Send for ExceededThreshold
impl Sync for ExceededThreshold
impl Unpin for ExceededThreshold
impl UnsafeUnpin for ExceededThreshold
impl UnwindSafe for ExceededThreshold
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