#[non_exhaustive]pub struct DuplicationThreshold {
pub threshold: f64,
pub duplicated_definitions: usize,
pub total_definitions: usize,
pub percentage: f64,
pub passed: bool,
pub rules: Vec<Rule>,
}Expand description
Result of applying a percentage-based tolerance to active duplication errors.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.threshold: f64Maximum duplicated-definition percentage allowed by configuration.
duplicated_definitions: usizeUnique definitions involved in active error-level duplication findings.
total_definitions: usizeTotal number of definitions discovered for the analysis.
percentage: f64Unrounded duplicated-definition percentage.
passed: boolWhether the percentage is less than or equal to the configured threshold.
rules: Vec<Rule>Rules whose error-level findings contribute to the numerator.
Implementations§
Source§impl DuplicationThreshold
impl DuplicationThreshold
Sourcepub fn from_result(result: &AnalysisResult, threshold: f64) -> Self
pub fn from_result(result: &AnalysisResult, threshold: f64) -> Self
Calculates the duplication rate after suppressions and analysis modes are applied.
Trait Implementations§
Source§impl Clone for DuplicationThreshold
impl Clone for DuplicationThreshold
Source§impl Debug for DuplicationThreshold
impl Debug for DuplicationThreshold
Source§impl<'de> Deserialize<'de> for DuplicationThreshold
impl<'de> Deserialize<'de> for DuplicationThreshold
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
Source§impl PartialEq for DuplicationThreshold
impl PartialEq for DuplicationThreshold
Source§impl Serialize for DuplicationThreshold
impl Serialize for DuplicationThreshold
impl StructuralPartialEq for DuplicationThreshold
Auto Trait Implementations§
impl Freeze for DuplicationThreshold
impl RefUnwindSafe for DuplicationThreshold
impl Send for DuplicationThreshold
impl Sync for DuplicationThreshold
impl Unpin for DuplicationThreshold
impl UnsafeUnpin for DuplicationThreshold
impl UnwindSafe for DuplicationThreshold
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
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more