pub enum CyclomaticPolicy {
Standard,
LiteralMembership,
}Expand description
How fallow health counts cyclomatic complexity for its gates.
The policy changes the cyclomatic value that the maxCyclomatic gate reads
and the cyclomatic value in every CRAP score. It does not change the health
score, the complexity density, or the hotspot ranking: those keep the
standard count so that grades stay comparable across projects.
Variants§
Standard
Count every decision point, &&, ||, and ?? operator (McCabe).
LiteralMembership
Count a literal membership chain as one predicate. A chain such as
kind === "a" || kind === "b" || kind === "c" adds no cyclomatic
increments for its || operators. Only strict equality checks of one
identifier against string, number, bigint, boolean, or null literals
qualify. Member access, calls, mixed operators, and different operands
keep the standard count.
Implementations§
Source§impl CyclomaticPolicy
impl CyclomaticPolicy
Sourcepub const fn is_standard(&self) -> bool
pub const fn is_standard(&self) -> bool
Whether this is the default standard policy.
Trait Implementations§
Source§impl Clone for CyclomaticPolicy
impl Clone for CyclomaticPolicy
impl Copy for CyclomaticPolicy
Source§impl Debug for CyclomaticPolicy
impl Debug for CyclomaticPolicy
Source§impl Default for CyclomaticPolicy
impl Default for CyclomaticPolicy
Source§impl<'de> Deserialize<'de> for CyclomaticPolicy
impl<'de> Deserialize<'de> for CyclomaticPolicy
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>,
impl Eq for CyclomaticPolicy
Source§impl JsonSchema for CyclomaticPolicy
impl JsonSchema for CyclomaticPolicy
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 PartialEq for CyclomaticPolicy
impl PartialEq for CyclomaticPolicy
Source§impl Serialize for CyclomaticPolicy
impl Serialize for CyclomaticPolicy
impl StructuralPartialEq for CyclomaticPolicy
Auto Trait Implementations§
impl Freeze for CyclomaticPolicy
impl RefUnwindSafe for CyclomaticPolicy
impl Send for CyclomaticPolicy
impl Sync for CyclomaticPolicy
impl Unpin for CyclomaticPolicy
impl UnsafeUnpin for CyclomaticPolicy
impl UnwindSafe for CyclomaticPolicy
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.