Skip to content
Fallow home
All docs pages

Migrating from jscpd

Move from jscpd to fallow to get duplication detection and unused code, complexity, circular dependency, and architecture boundary checks from one tool.

Replace jscpd with fallow when you want duplication detection as part of a larger codebase audit. The same binary also finds unused code, complex functions, circular dependencies, and architecture boundary violations.

Migration workflow

  1. Preview the migration

    Run fallow migrate --dry-run to see the generated config. The command writes no files.

    fallow migrate --dry-run

    fallow looks for .jscpd.json and the jscpd field in package.json.

  2. Generate the config

    When the preview looks correct, run the migration:

    fallow migrate            # Write .fallowrc.json
    fallow migrate --toml     # Or output as fallow.toml
  3. Review the config

    Open the generated config. Check the translated thresholds, token counts, and ignore patterns.

  4. Run fallow dupes

    Run your first duplication analysis:

    fallow dupes

What gets migrated

jscpdFallow
thresholdduplicates.threshold
minTokensduplicates.minTokens
minLinesduplicates.minLines
modeduplicates.mode (fallow warns that weak can differ)
skipLocalduplicates.skipLocal
ignoreduplicates.ignore
format-- (fallow auto-detects languages)

Comparison

Fallowjscpd
Raw duplication speedPart of the broader audit flowjscpd v5 is faster on the current README benchmark fixtures
Detection modes4 (strict, mild, weak, semantic)3 (strict, mild, weak)
AlgorithmSuffix array with LCPRabin-Karp rolling hash
Unused code + circular depsBuilt-in (fallow dead-code)Unused code with --dead-code (v5.3+), no circular dependencies
Complexity + maintainabilityBuilt-in (fallow health)--complexity and --health (v5.3+)
Clone familiesYes, with refactoring suggestionsNo
Cross-languageTS to JS type stripping--cross-formats groups (for example JS and TS)
Baseline trackingYesYes (--baseline, v5.1+)
Runtime dependencyNative binaryNative binary in v5

Detection mode mapping

jscpd v5 has strict, mild, and weak modes. For exact token matching, the closest fallow mode is strict.

Fallow uses mild mode by default. This mode normalizes syntax variations, so it can report more clones than jscpd did. To get results closer to jscpd, use strict mode:

fallow dupes --mode strict

To also match clones with renamed variables, use semantic mode:

fallow dupes --mode semantic

One tool for the full picture

One binary replaces separate jscpd, knip, and madge runs:

fallow dead-code    # Unused code + circular deps + boundaries
fallow dupes        # Code duplication (replaces jscpd)
fallow health       # Complexity hotspots + maintainability scores
fallow              # All of the above in one pass

See also