Skip to main content

Module duplicates

Module duplicates 

Source
Expand description

Code duplication / clone detection module.

This module implements suffix array + LCP based clone detection for JavaScript/TypeScript source files. It supports multiple detection modes from strict (exact matches only) to semantic (structure-aware matching that ignores identifier names and literal values).

Modules§

detect
Suffix Array + LCP based clone detection engine.
families
Clone family grouping and refactoring suggestion generation.
normalize
tokenize

Structs§

CloneFamily
A clone family: a set of clone groups that share the same file set.
CloneGroup
A group of code clones – the same (or normalized-equivalent) code appearing in multiple places.
CloneInstance
A single instance of duplicated code at a specific location.
DuplicatesConfig
Configuration for code duplication detection.
DuplicationReport
Overall duplication analysis report.
DuplicationStats
Aggregate duplication statistics.
RefactoringSuggestion
A refactoring suggestion for a clone family.

Enums§

DetectionMode
Detection mode controlling how aggressively tokens are normalized.
RefactoringKind
The kind of refactoring suggested for a clone family.

Functions§

find_duplicates
Run duplication detection on the given files.
find_duplicates_in_project
Run duplication detection on a project directory using auto-discovered files.