Struct rust_code_analysis::cognitive::Stats
source · pub struct Stats { /* private fields */ }
Expand description
The Cognitive Complexity
metric.
Implementations§
source§impl Stats
impl Stats
sourcepub fn merge(&mut self, other: &Stats)
pub fn merge(&mut self, other: &Stats)
Merges a second Cognitive Complexity
metric into the first one
sourcepub fn cognitive_sum(&self) -> f64
pub fn cognitive_sum(&self) -> f64
Returns the Cognitive Complexity
sum metric value
sourcepub fn cognitive_min(&self) -> f64
pub fn cognitive_min(&self) -> f64
Returns the Cognitive Complexity
minimum metric value
sourcepub fn cognitive_max(&self) -> f64
pub fn cognitive_max(&self) -> f64
Returns the Cognitive Complexity
maximum metric value
sourcepub fn cognitive_average(&self) -> f64
pub fn cognitive_average(&self) -> f64
Returns the Cognitive Complexity
metric average value
This value is computed dividing the Cognitive Complexity
value
for the total number of functions/closures in a space.
If there are no functions in a code, its value is NAN
.