pub struct CloneConfig {
pub max_time_diff_ns: u64,
pub compare_bytes: usize,
pub min_similarity: f64,
pub min_similarity_no_stack_hash: f64,
pub max_clone_edges_per_node: usize,
pub detect_smart_pointers: bool,
pub arc_threshold: f64,
pub rc_threshold: f64,
}Expand description
Configuration for clone detection.
Fields§
§max_time_diff_ns: u64Maximum time difference (nanoseconds) between two allocations to be considered potential clones.
Default: 1ms (1_000_000 ns) - reduced from 10ms to minimize false positives in hot paths. Real clones typically happen within microseconds, not milliseconds.
compare_bytes: usizeNumber of leading bytes to compare for content similarity.
min_similarity: f64Minimum similarity ratio (0.0 - 1.0) to consider a clone. Default: 0.8 (80%).
min_similarity_no_stack_hash: f64Minimum similarity when call_stack_hash is None. Higher threshold reduces false positives in synthetic data. Default: 0.95 (95%).
max_clone_edges_per_node: usizeMaximum clone edges per node to prevent explosion. Default: 10.
detect_smart_pointers: boolEnable smart pointer type detection (Arc/Rc). Default: true.
arc_threshold: f64Similarity threshold for Arc clones (0.0 - 1.0). Default: 0.7 (70%) - Arc clones may have slight differences.
rc_threshold: f64Similarity threshold for Rc clones (0.0 - 1.0). Default: 0.85 (85%) - Rc clones are more consistent.
Trait Implementations§
Source§impl Clone for CloneConfig
impl Clone for CloneConfig
Source§fn clone(&self) -> CloneConfig
fn clone(&self) -> CloneConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CloneConfig
impl Debug for CloneConfig
Auto Trait Implementations§
impl Freeze for CloneConfig
impl RefUnwindSafe for CloneConfig
impl Send for CloneConfig
impl Sync for CloneConfig
impl Unpin for CloneConfig
impl UnsafeUnpin for CloneConfig
impl UnwindSafe for CloneConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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