Struct rust_code_analysis::abc::Stats
source · pub struct Stats { /* private fields */ }
Expand description
The ABC
metric.
The ABC
metric measures the size of a source code by counting
the number of Assignments (A
), Branches (B
) and Conditions (C
).
The metric defines an ABC score as a vector of three elements (<A,B,C>
).
The ABC score can be represented by its individual components (A
, B
and C
)
or by the magnitude of the vector (|<A,B,C>| = sqrt(A^2 + B^2 + C^2)
).
Official paper and definition:
Fitzpatrick, Jerry (1997). “Applying the ABC metric to C, C++ and Java”. C++ Report. https://www.softwarerenovation.com/Articles.aspx
Implementations§
source§impl Stats
impl Stats
sourcepub fn assignments(&self) -> f64
pub fn assignments(&self) -> f64
Returns the Abc
assignments metric value.
sourcepub fn assignments_sum(&self) -> f64
pub fn assignments_sum(&self) -> f64
Returns the Abc
assignments sum metric value.
sourcepub fn assignments_average(&self) -> f64
pub fn assignments_average(&self) -> f64
Returns the Abc
assignments average value.
This value is computed dividing the Abc
assignments value for the number of spaces.
sourcepub fn assignments_min(&self) -> f64
pub fn assignments_min(&self) -> f64
Returns the Abc
assignments minimum value.
sourcepub fn assignments_max(&self) -> f64
pub fn assignments_max(&self) -> f64
Returns the Abc
assignments maximum value.
sourcepub fn branches_sum(&self) -> f64
pub fn branches_sum(&self) -> f64
Returns the Abc
branches sum metric value.
sourcepub fn branches_average(&self) -> f64
pub fn branches_average(&self) -> f64
Returns the Abc
branches average value.
This value is computed dividing the Abc
branches value for the number of spaces.
sourcepub fn branches_min(&self) -> f64
pub fn branches_min(&self) -> f64
Returns the Abc
branches minimum value.
sourcepub fn branches_max(&self) -> f64
pub fn branches_max(&self) -> f64
Returns the Abc
branches maximum value.
sourcepub fn conditions(&self) -> f64
pub fn conditions(&self) -> f64
Returns the Abc
conditions metric value.
sourcepub fn conditions_sum(&self) -> f64
pub fn conditions_sum(&self) -> f64
Returns the Abc
conditions sum metric value.
sourcepub fn conditions_average(&self) -> f64
pub fn conditions_average(&self) -> f64
Returns the Abc
conditions average value.
This value is computed dividing the Abc
conditions value for the number of spaces.
sourcepub fn conditions_min(&self) -> f64
pub fn conditions_min(&self) -> f64
Returns the Abc
conditions minimum value.
sourcepub fn conditions_max(&self) -> f64
pub fn conditions_max(&self) -> f64
Returns the Abc
conditions maximum value.
sourcepub fn magnitude_sum(&self) -> f64
pub fn magnitude_sum(&self) -> f64
Returns the Abc
magnitude sum metric value.