pub struct DuplicationBaselineData {
pub clone_groups: Vec<String>,
pub clone_fingerprints: Vec<String>,
pub normalized_clone_fingerprints: Vec<String>,
/* private fields */
}Expand description
Baseline data for duplication comparison.
New baselines key every clone group by <fingerprint>:<instance count> in
normalized_clone_fingerprints. The fingerprint hashes normalized clone
content, so an unrelated line shift or formatting-only edit keeps it matched,
while a token edit or extra copy reports a new finding.
clone_groups keeps the oldest location keys, while clone_fingerprints
keeps the raw-fragment keys expected by older binaries. New readers prefer
the normalized field. This makes baselines readable in both directions.
Fields§
§clone_groups: Vec<String>Legacy clone group keys: sorted list of file:start-end per group.
clone_fingerprints: Vec<String>Legacy raw-fragment keys expected by older binaries.
normalized_clone_fingerprints: Vec<String>Normalized content keys used by current binaries.
Implementations§
Source§impl DuplicationBaselineData
impl DuplicationBaselineData
Sourcepub const DECLARED_KEYS: &'static [&'static str]
pub const DECLARED_KEYS: &'static [&'static str]
The keys this format writes, for declares_baseline_format.
Sourcepub fn from_report(report: &DuplicationReport, root: &Path) -> Self
pub fn from_report(report: &DuplicationReport, root: &Path) -> Self
Build a duplication baseline from the current report.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Number of baseline entries actually used for comparison.
Trait Implementations§
Source§impl Default for DuplicationBaselineData
impl Default for DuplicationBaselineData
Source§impl<'de> Deserialize<'de> for DuplicationBaselineData
impl<'de> Deserialize<'de> for DuplicationBaselineData
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>,
Auto Trait Implementations§
impl Freeze for DuplicationBaselineData
impl RefUnwindSafe for DuplicationBaselineData
impl Send for DuplicationBaselineData
impl Sync for DuplicationBaselineData
impl Unpin for DuplicationBaselineData
impl UnsafeUnpin for DuplicationBaselineData
impl UnwindSafe for DuplicationBaselineData
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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> ⓘ
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