# jscpd

A copy-paste and duplicate code detector for more than 220 languages, with a Rust engine, that also finds dead code, complexity hotspots, and a duplication trend.

jscpd tokenizes each supported language according to its own comment and string rules rather than treating source as generic text, then finds duplicated token sequences across files using a rolling Rabin-Karp hash. Optional passes catch near-duplicates that differ only in names or literal values, copies with a few edited lines, and, experimentally, functions that do the same thing written differently, using a code embedding model.

Beyond exact and near duplicates, it can also report dead code, rank files by complexity, track duplication over git history, and combine these into one overall health score for a codebase, and it integrates into CI as a GitHub Action that uploads SARIF results to GitHub code scanning by default. It exposes an MCP server and a token-efficient reporter so an AI coding agent can query the same results directly.

It is written in Rust, distributed as a self-contained binary, and installable via npm, PyPI, Cargo, Homebrew, Nix, or Docker under the MIT license.

Website: https://jscpd.dev
