Documentation Index
Fetch the complete documentation index at: https://docs.fallow.tools/llms.txt
Use this file to discover all available pages before exploring further.
fallow dupes finds duplicated code blocks across your entire codebase. 8-26x faster than jscpd on real-world projects.
Why built-in duplication matters
Most dead-code analysis tools stop at finding unused exports and unreachable files. Fallow goes further: it includes duplication detection in the same binary, using the same module graph. This means you can cross-reference dead code with duplication in a single pass. When you runfallow dead-code --include-dupes, fallow identifies code blocks that are both duplicated and unused. These are the highest-value cleanup targets: removing them eliminates dead code and reduces duplication simultaneously.
Running duplication analysis alongside dead-code detection also means:
- One tool, one config, one CI step: No need to install and configure a separate duplication detector
- Shared file discovery: The same ignore patterns, entry points, and workspace config apply to both analyses
- Cross-analysis insights: Clone families that span unused files are flagged as combined findings
- Consistent output formats: JSON, SARIF, markdown, compact, and CodeClimate output work the same way for duplication as for dead code
Detection modes
- Strict
- Mild (default)
- Weak
- Semantic
Exact token-for-token clones only. No normalization is applied; the code must be character-identical after tokenization.Best for finding exact copy-paste where nothing was changed.
$ fallow dupes
$ fallow dupes --mode semantic
Thresholds and limits
Clone families
Clone groups sharing the same file set are grouped into clone families with refactoring suggestions:- Extract function: clones are in the same file
- Extract module: clones span multiple files
Cross-language detection
Compare TypeScript and JavaScript files by stripping type annotations:.ts files to their .js equivalent for comparison. This catches clones where one copy was converted from TypeScript to JavaScript or vice versa.
Ignoring imports
Files with the same set of imports (sorted alphabetically by a formatter) often produce false-positive clones. Stripimport declarations from the token stream:
import statements. CommonJS require() calls and re-exports are not filtered.
Incremental analysis
Only check duplication in files changed since a git ref:Baseline comparison
Adopt duplication limits incrementally:Debugging
Trace all clones of a specific code location:Benchmarks vs jscpd
Fallow uses a with for clone detection, avoiding quadratic pairwise comparison.
See also
CLI: dupes
Full reference for the
fallow dupes command and its flags.Configuration
Set default duplication thresholds and modes in your config file.
Migrating from jscpd
Replace jscpd with fallow in your project.