Main
把 jscpd 当回归门禁:在 CI 里跑,避免快速迭代时 copy/paste 复制扩散。
为 agent 重构调阈值:设置 token 阈值,抓住真正重复而不是常见样板代码。
需要跨仓库反复查询或出报表时用 server 模式,避免重复启动开销。
把“支持格式”当范围旋钮:先覆盖主语言,清干净后再逐步扩大扫描面。
README (excerpt)
jscpd
Copy/paste detector for programming source code, supports 223 formats. AI-ready with MCP server and token-efficient reporter.
Copy/paste is a common technical debt on a lot of projects. The jscpd gives the ability to find duplicated blocks implemented on more than 223 programming languages and digital formats of documents. The jscpd tool implements Rabin-Karp algorithm for searching duplications.
Packages of jscpd
| name | version | description |
|---|---|---|
| jscpd | main package for jscpd (cli and API for detections included) | |
| jscpd-server | jscpd server application |
Source-backed notes
- README 写明支持 223 种格式,并提供 CLI 与 server 安装方式(
npm install -g jscpd/jscpd-server)。 - 仓库为 MIT 许可且维护活跃(已通过 GitHub API 复核)。
- README 也给出贡献者构建路径(例如
pnpm install)。
FAQ
- 只能测 JavaScript 吗?:不是:README 写明支持 223 种格式,可按你的语言栈配置扫描。
- CLI 怎么安装?:按 README:
npm install -g jscpd。 - 可以当服务跑吗?:可以:README 提到 server 模式(
jscpd-server)。