pub struct CloneGroup {
pub instances: Vec<CloneInstance>,
pub token_count: usize,
pub line_count: usize,
pub similarity: Option<f64>,
}Expand description
A group of code clones – the same (or normalized-equivalent) code appearing in multiple places.
Fields§
§instances: Vec<CloneInstance>All instances where this duplicated code appears.
token_count: usizeNumber of tokens in the duplicated block.
line_count: usizeNumber of lines in the duplicated block.
similarity: Option<f64>Lowest all-pairs similarity for a near-miss clone group. Exact clone groups omit this field.
Implementations§
Source§impl CloneGroup
impl CloneGroup
Sourcepub fn kind(&self) -> CloneGroupKind
pub fn kind(&self) -> CloneGroupKind
Return the semantic kind represented by this clone group.
Sourcepub fn spread(&self) -> usize
pub fn spread(&self) -> usize
Maximum directory-tree or same-file line distance between instances.
Sourcepub fn strip_fragments(&mut self)
pub fn strip_fragments(&mut self)
Drop the verbatim source text from every instance in this group.
Trait Implementations§
Source§impl Clone for CloneGroup
impl Clone for CloneGroup
Source§impl Debug for CloneGroup
impl Debug for CloneGroup
Source§impl<'de> Deserialize<'de> for CloneGroup
impl<'de> Deserialize<'de> for CloneGroup
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 CloneGroup
impl RefUnwindSafe for CloneGroup
impl Send for CloneGroup
impl Sync for CloneGroup
impl Unpin for CloneGroup
impl UnsafeUnpin for CloneGroup
impl UnwindSafe for CloneGroup
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