Skip to main content
Version: 3.x

jscpd vs Rev-dep

jscpd is a copy-paste detector for more than 220 languages. Since v5 it is a Rust engine shipped as a self-contained binary, and it has grown beyond duplication: dead-code detection, complexity hotspots, a health score and an MCP server. rev-dep detects duplication as one of its checks, next to its dependency-graph and architecture rules.

The biggest difference is what gets reported. jscpd matches token sequences; rev-dep finds repeated code blocks and JSX elements - units the language already recognises - so every finding comes with its own refactor: a duplicated function body becomes a shared function, a duplicated element becomes a component.

At a glance​

jscpdRev-dep
Primary focusduplication, plus dead code, complexity and a health scoredependency hygiene + architecture, duplication included
RuntimeRust since v5 (v4 was Node)Go - single parallel pass, alongside twelve other checks
Languages224 formatsJS / TS / JSX / TSX, plus Vue and Svelte
Unit reportedtoken sequence, as a line/column span; opt-in whole-function similarity for JS/TSwhole code block or JSX element
Renamed copiesmatched with --ignore-identifiers (reported as renamed)matched with --blind-identifiers
Near-miss copies (a few edited lines)matched with --max-gap-lines or --similaritynot matched
Reporters15, including html, sarif, markdown, codeclimate and an AI-oriented formatconsole, json (with a published schema)
CI baselineclone baseline (fail only on new clones), or a duplication-percentage thresholdsnapshot of the exact duplications acknowledged
Other checksdead code (JS/TS/Python), complexity, health score, duplication historytwelve more dependency and architecture checks, in the same run
Agent integrationMCP server, agent skillsCLI with JSON output

The difference that matters: what gets reported​

Both tools find the same duplication in the same file. They describe it differently:

jscpd components/Card.tsx [3:19 - 13:13]
components/Panel.tsx [3:20 - 13:13]

rev-dep JSX block, 7 lines, depth 3
src/components/Card.tsx:4:3
src/components/Panel.tsx:4:3

jscpd's range starts at column 19 of line 3 and ends at column 13 of line 13 - it begins mid-statement and ends mid-statement, because a window of matching tokens has no reason to stop where a language construct does. rev-dep reports the <section> element itself. (The jscpd output above is from v4; v5 still finds exact clones as matching token sequences.)

The practical difference is what you do next. A token range has to be read at both sites before you know where the extractable unit actually begins. A block is the unit.

The trade runs the other way too. rev-dep will not report a copy-paste that starts halfway through one function and ends halfway through another, or a near-miss copy with a few edited lines; jscpd will.

Renamed copies​

Copy-and-adapt duplication usually renames variables along the way. Both tools can now match it when asked: jscpd v5 with --ignore-identifiers (and --ignore-literals), reporting the clone as renamed; rev-dep with --blind-identifiers (plus --blind-strings and --blind-numbers). Neither does it by default. Earlier jscpd versions compared identifier names literally and could not match renamed copies.

See how rev-dep compares code for what blinding ignores and what it keeps.

Where jscpd may still fit​

  • Other languages. jscpd covers Python, Java, C#, Go, CSS and many more. rev-dep is JS/TS only.
  • Near-miss clones. Copies with a few inserted or changed lines, and structurally similar JS/TS functions, which rev-dep does not detect.
  • Reporting. HTML, SARIF, Code Climate, markdown and more; duplication trends over git history; blame.
  • A health score combining duplication, dead code and complexity.

Which should you choose?​

  • Need duplication detection across a polyglot repository, near-miss clones, or rich report formats? jscpd.
  • Working in JS/TS and want duplication reported as units you can extract - checked in the same run as your dependency and architecture rules? rev-dep.

Learn more in How duplicated code detection works.