Expand description
Code duplication / clone detection module.
This module implements suffix array + LCP based clone detection for TypeScript/JavaScript 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
- token_
types - Token type definitions for clone detection tokenization.
- tokenize
Structs§
- Clone
Family - A clone family: a set of clone groups that share the same file set.
- Clone
Group - A group of code clones – the same (or normalized-equivalent) code appearing in multiple places.
- Clone
Instance - A single instance of duplicated code at a specific location.
- Default
Ignore Skip Count - Number of files skipped by one built-in duplicates ignore pattern.
- Default
Ignore Skips - Human-format-only skipped-file stats for built-in duplicates ignores.
- Duplicates
Config - Configuration for code duplication detection.
- Duplication
Report - Overall duplication analysis report.
- Duplication
Stats - Aggregate duplication statistics.
- Mirrored
Directory - A detected mirrored directory pattern: two directory prefixes that contain
identical files (e.g.,
src/anddeno/lib/). - Refactoring
Suggestion - A refactoring suggestion for a clone family.
Enums§
- Detection
Mode - Detection mode controlling how aggressively tokens are normalized.
- Refactoring
Kind - The kind of refactoring suggested for a clone family.
Constants§
- DUPES_
DEFAULT_ IGNORES - Built-in duplicates ignores for generated framework and tool output.
Functions§
- find_
duplicates - Run duplication detection on the given files.
- find_
duplicates_ cached - Run duplication detection with the persistent token cache enabled.
- find_
duplicates_ cached_ with_ default_ ignore_ skips - Run cached duplication detection and return human-format sidecar metadata for files skipped by built-in duplicates ignores.
- find_
duplicates_ in_ project - Run duplication detection on a project directory using auto-discovered files.
- find_
duplicates_ touching_ files - Run duplication detection and only return clone groups touching
focus_files. - find_
duplicates_ touching_ files_ cached - Run focused duplication detection with the persistent token cache enabled.
- find_
duplicates_ touching_ files_ cached_ with_ default_ ignore_ skips - Run cached focused duplication detection and return human-format sidecar metadata for files skipped by built-in duplicates ignores.
- find_
duplicates_ touching_ files_ with_ default_ ignore_ skips - Run focused duplication detection and return human-format sidecar metadata for files skipped by built-in duplicates ignores.
- find_
duplicates_ with_ default_ ignore_ skips - Run duplication detection and return human-format sidecar metadata for files skipped by built-in duplicates ignores.