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 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§

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.
DefaultIgnoreSkipCount
Number of files skipped by one built-in duplicates ignore pattern.
DefaultIgnoreSkips
Human-format-only skipped-file stats for built-in duplicates ignores.
DuplicatesConfig
Configuration for code duplication detection.
DuplicationReport
Overall duplication analysis report.
DuplicationStats
Aggregate duplication statistics.
MirroredDirectory
A detected mirrored directory pattern: two directory prefixes that contain identical files (e.g., src/ and deno/lib/).
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.

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.