jscpd
Copy/paste detector for source code. 220+ languages, Rust engine, SARIF/HTML/badge reporters, GitHub Action, MCP server for AI agents.
What is jscpd?
Copy/paste detector for source code. 220+ languages, Rust engine, SARIF/HTML/badge reporters, GitHub Action, MCP server for AI agents.
Overview of jscpd
What it is
jscpd is a copy/paste detector for source code. It supports over 220 language formats and uses a Rust engine. It can also detect dead code, complexity hotspots, and track duplication and health trends over git history. It provides a single health score for the entire codebase. It is available as a self-contained binary, a GitHub Action, and an MCP server for AI agents.
Key features
- Language-aware tokenization for all 224 supported formats, with per-format comment and string syntax and embedded-language extraction for Vue, Svelte, Astro, Markdown, and Razor.
- Detection of Type-2 clones (renamed identifiers/literals), Type-3 near-miss clones (with gap lines and AST similarity), and experimental Type-4 semantic clones using a code embedding model.
- 15 reporters: console, console-full, json, xml, csv, html, markdown, badge, sarif, codeclimate, openmetrics, ai, xcode, threshold, and silent.
- Clone baseline support to gate CI on new duplication only, with
--baselineand--baseline-from-refoptions. - Git blame integration with side-by-side author comparison.
- Exit codes for missing formats, scan paths, or reporter failures;
--fail-on-emptyfor scans that analyze no files.
Use cases
- Detecting duplicated code in large codebases to reduce maintenance overhead.
- Enforcing duplication thresholds in CI pipelines using the GitHub Action or Docker image.
- Tracking code health trends over git history with duplication, complexity, and health scores.
- Identifying dead code and complexity hotspots across the project.
- Comparing two codebases (e.g., porting progress) with the experimental
--comparefeature.
Getting started
bash# macOS / Linuxcurl -fsSL https://jscpd.dev/install.sh | bash# Windows (PowerShell)irm https://jscpd.dev/install.ps1 | iex# No install — run once with npx (Node.js)npx jscpd .Then scan a project:bashjscpd /path/to/code
License and pricing
jscpd is open source under the MIT license. No pricing information is stated.
Based on the project's public README and repository metadata.