pub struct MaintainabilityIndex {
pub score: f64,
pub avg_cyclomatic: f64,
pub avg_loc: f64,
pub avg_halstead_volume: Option<f64>,
pub grade: String,
}Expand description
Composite maintainability index based on the SEI formula.
MI = 171 - 5.2 * ln(V) - 0.23 * CC - 16.2 * ln(LOC)
When Halstead volume is unavailable, a simplified formula is used.
Fields§
§score: f64Maintainability index score (0-171 scale, higher is better).
avg_cyclomatic: f64Average cyclomatic complexity used in calculation.
avg_loc: f64Average lines of code per file used in calculation.
avg_halstead_volume: Option<f64>Average Halstead volume (if Halstead metrics were computed).
grade: StringLetter grade: “A” (>=85), “B” (65-84), “C” (<65).
Trait Implementations§
Source§impl Clone for MaintainabilityIndex
impl Clone for MaintainabilityIndex
Source§fn clone(&self) -> MaintainabilityIndex
fn clone(&self) -> MaintainabilityIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MaintainabilityIndex
impl Debug for MaintainabilityIndex
Source§impl<'de> Deserialize<'de> for MaintainabilityIndex
impl<'de> Deserialize<'de> for MaintainabilityIndex
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 MaintainabilityIndex
impl RefUnwindSafe for MaintainabilityIndex
impl Send for MaintainabilityIndex
impl Sync for MaintainabilityIndex
impl Unpin for MaintainabilityIndex
impl UnsafeUnpin for MaintainabilityIndex
impl UnwindSafe for MaintainabilityIndex
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