pub struct DuplicateAnalyzer { /* private fields */ }
Expand description
Advanced duplicate analyzer with AST and semantic analysis
Implementations§
Source§impl DuplicateAnalyzer
impl DuplicateAnalyzer
pub fn new() -> Self
Sourcepub fn find_code_duplicates_advanced(
&mut self,
repo_path: &Path,
similarity_threshold: f64,
min_lines: usize,
exclude_patterns: &[String],
) -> Result<Vec<DuplicateResult>>
pub fn find_code_duplicates_advanced( &mut self, repo_path: &Path, similarity_threshold: f64, min_lines: usize, exclude_patterns: &[String], ) -> Result<Vec<DuplicateResult>>
Find code duplicates with advanced AST and semantic analysis
Sourcepub fn find_code_duplicates(
&mut self,
repo_path: &Path,
similarity_threshold: f64,
min_lines: usize,
exclude_patterns: &[String],
) -> Result<Vec<Value>>
pub fn find_code_duplicates( &mut self, repo_path: &Path, similarity_threshold: f64, min_lines: usize, exclude_patterns: &[String], ) -> Result<Vec<Value>>
Legacy method for backward compatibility
Sourcepub fn calculate_content_similarity(
&self,
content1: &str,
content2: &str,
) -> f64
pub fn calculate_content_similarity( &self, content1: &str, content2: &str, ) -> f64
Calculate content similarity between two text blocks using Jaccard coefficient
Sourcepub fn find_duplicate_blocks(
&self,
content: &str,
min_lines: usize,
similarity_threshold: f64,
) -> Result<Vec<Value>>
pub fn find_duplicate_blocks( &self, content: &str, min_lines: usize, similarity_threshold: f64, ) -> Result<Vec<Value>>
Find duplicate code blocks within files
Sourcepub fn calculate_structural_similarity(
&self,
content1: &str,
content2: &str,
) -> f64
pub fn calculate_structural_similarity( &self, content1: &str, content2: &str, ) -> f64
Calculate structural similarity (ignoring variable names)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DuplicateAnalyzer
impl RefUnwindSafe for DuplicateAnalyzer
impl Send for DuplicateAnalyzer
impl Sync for DuplicateAnalyzer
impl Unpin for DuplicateAnalyzer
impl UnwindSafe for DuplicateAnalyzer
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> 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