Migrating from jscpd

Fallow can replace jscpd when you want duplication detection as part of a broader codebase audit. It also covers unused code detection, complexity analysis, circular dependencies, and architecture boundaries in the same binary.

Migration workflow

  1. Preview the migration

    Run fallow migrate --dry-run to see the generated config without writing anything:

    fallow migrate --dry-run

    Fallow searches for .jscpd.json and the jscpd field in package.json.

  2. Generate the config

    Once you're happy with the preview, run the migration:

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

    Open the generated config and verify 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
ignoreignorePatterns
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 LCPRust rewrite in v5
Unused code + circular depsBuilt-in (fallow dead-code)Not included
Complexity + maintainabilityBuilt-in (fallow health)Not included
Clone familiesYes, with refactoring suggestionsNo
Cross-languageTS to JS type strippingFormat-based
Baseline trackingYesNo
Runtime dependencyNative binaryNative binary in v5

Detection mode mapping

jscpd v5 supports strict, mild, and weak modes. The closest fallow equivalent for exact token matching is strict.

Fallow defaults to mild mode, which normalizes syntax variations and may flag more clones than jscpd did. To match jscpd's behavior more closely, use strict mode:

fallow dupes --mode strict

For broader matching that catches renamed variables:

fallow dupes --mode semantic

One tool for the full picture

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

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