jscpd vs phpcpd-next
jscpd
jscpd.devphpcpd-next
github.comSide by side
| Figure | jscpd | phpcpd-next |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | Yes | — |
| Windows | Yes | — |
| macOS | Yes | — |
| Linux | Yes | Yes |
| API | Yes | Yes |
| Self-hosted | Yes | Yes |
| Plans published | 2 | 1 |
| Spec score · Code Clone Detection Tools | 8.6 (#2) | 7.4 (#14) |
| Spec score · Code Duplication Detection Tools | 8.5 (#2) | 7.4 (#9) |
| License | The project and its published packages use the permissive MIT license. | The project states that phpcpd-next is licensed under MIT. |
| Purpose | jscpd scans source code for duplicate code and can fail a build when duplication exceeds a configured threshold. | phpcpd-next is a token-based copy/paste detector for PHP 8.4+ and a successor to Sebastian Bergmann’s phpcpd. |
| Reports | Reporters include HTML, JSON, XML, README badges, SARIF, CodeClimate, and OpenMetrics formats. | It provides console, PMD-CPD XML, JSON, and SARIF 2.1.0 output formats. |
Plans
In their own words
jscpd
jscpd is a free, open-source tool for finding repeated code in repositories. It can fail a build when duplication exceeds a configured threshold, making it usable in local development and CI. The project says it supports 224 languages. Exact clones are detected by default, while renamed, near-miss, and semantic clone checks are optional; semantic detection is experimental.
Version 5 is available as a self-contained native binary that does not need Node.js, with direct macOS, Linux, and Windows binaries for x64 and ARM64. Reports include HTML, JSON, XML, README badges, SARIF, CodeClimate, and OpenMetrics. The GitHub Action can enforce a threshold and upload SARIF for GitHub Code Scanning, and GitLab CI reporters are documented. Developers can also use pre-commit hooks or Docker. A dashboard summarizes project size, duplication, complexity, dead code, and a health score. Dead-code analysis covers JavaScript, TypeScript, and Python, plus Rust when compiler diagnostics are supplied.
phpcpd-next
phpcpd-next is a free, MIT-licensed, token-based detector for copied PHP code in repositories. It targets PHP 8.4 and later and succeeds Sebastian Bergmann’s phpcpd. The default run combines Rabin-Karp exact matching with TokenBag detection for reordered code. An opt-in unified engine detects exact, renamed, gapped and reordered clones, while optional orphan mode identifies unreferenced classes, interfaces, traits, enums and functions. Results can be printed to the console or written as PMD-CPD XML, JSON and SARIF 2.1.0. Meaningful exit codes, result caching and a per-file incremental index support continuous integration; clone findings return status 1. Documented integrations include PHPUnit, an in-process headless API, framework presets and SARIF upload to GitHub Code Scanning. Installation is available through Composer as a development dependency or global package, or from source. Requirements are PHP 8.4+, ext-dom and ext-mbstring, with zero Composer runtime dependencies. Advanced engines are described as research-grade and may produce more false positives than the default set.