pub struct CloneCoverage<'a> { /* private fields */ }Expand description
Accumulates the clone groups of one scope into duplication statistics.
Covered lines are the union of the line ranges of each file, so overlapping clone instances do not count a line two times.
Implementations§
Source§impl<'a> CloneCoverage<'a>
impl<'a> CloneCoverage<'a>
Sourcepub fn add_group(
&mut self,
instances: impl IntoIterator<Item = &'a CloneInstance>,
token_count: usize,
)
pub fn add_group( &mut self, instances: impl IntoIterator<Item = &'a CloneInstance>, token_count: usize, )
Add one clone group.
instances are the instances that this scope counts. Each instance
after the first adds token_count redundant tokens.
Sourcepub fn into_stats(
self,
totals: CorpusTotals,
carried: CarriedCounters,
) -> DuplicationStats
pub fn into_stats( self, totals: CorpusTotals, carried: CarriedCounters, ) -> DuplicationStats
Build the statistics against totals.
duplication_percentage divides by totals.lines, and
duplicated_tokens does not exceed totals.tokens.
Trait Implementations§
Source§impl<'a> Debug for CloneCoverage<'a>
impl<'a> Debug for CloneCoverage<'a>
Auto Trait Implementations§
impl<'a> Forget for CloneCoverage<'a>
impl<'a> Freeze for CloneCoverage<'a>
impl<'a> Move for CloneCoverage<'a>
impl<'a> RefUnwindSafe for CloneCoverage<'a>
impl<'a> Send for CloneCoverage<'a>
impl<'a> Sync for CloneCoverage<'a>
impl<'a> Unpin for CloneCoverage<'a>
impl<'a> UnsafeUnpin for CloneCoverage<'a>
impl<'a> UnwindSafe for CloneCoverage<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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