kucherenko/jscpd
Copy/paste detector for source code. 220+ languages, Rust engine, SARIF/HTML/badge reporters, GitHub Action, MCP server for AI agents.
What it solves
jscpd is a high-performance tool designed to detect duplicate code, dead code, and complexity hotspots across large codebases. It helps developers maintain code health by identifying redundant logic, unused code, and overly complex files that may be difficult to maintain or prone to bugs.
How it works
The tool uses a Rust-based engine to tokenize source code according to the specific syntax rules of over 224 programming languages. It then employs a rolling Rabin-Karp hash algorithm to identify duplicated sequences. Beyond simple text matching, it supports advanced detection types, including renamed identifiers (Type-2), near-miss clones with minor edits (Type-3), and experimental semantic clone detection using code embedding models to find functionally equivalent code written differently.
Who it’s for
It is intended for software engineers, DevOps teams, and CI/CD pipelines that need to enforce code quality standards, track technical debt over time, or prevent the accumulation of redundant code in monorepos and large projects.
Highlights
- Supports 224+ language formats with language-aware tokenization.
- Includes an AI-ready MCP server and a token-efficient reporter for LLM-based analysis workflows.
- Tracks code health and duplication trends over Git history to prevent regressions.
- Detects dead code (unused files, exports, and imports) across JavaScript, TypeScript, and Python.
- Provides a language server (LSP) for real-time diagnostics in IDEs like Neovim, Helix, and JetBrains.
- Offers flexible CI integration with support for SARIF, Code Climate, and custom thresholds.
Related
- Project
- Project
- Dispatch
- Project
- Project