New Features
- MCP server over stdio (
--mcp) —cpd --mcp /path/to/projectserves the Model Context Protocol on stdin/stdout, the transport MCP clients spawn and manage themselves (no port, no network policy). The project is scanned once at startup and kept in memory as detection-ready token hashes, socheck_duplicationsnippet checks answer in milliseconds. Tools:check_duplication(accepts format names or file extensions),get_file_clones(clones involving one file — new over the HTTP server),get_statistics, andcheck_current_directory(returns the clone list). All clone/match lists are sorted biggest-first and capped by an optionallimitargument (default 100) with the untruncated total always reported. Implements protocol revision2025-06-18(accepting2025-03-26/2024-11-05clients); all standard detection options (--min-tokens,--format,--cross-formats, ...) apply to the scan and to snippet checks. (#891) - Codebase summary (
--summary) — opt-in refactoring-hotspot overview appended to the run output: top files and folders ranked by tokens, lines, size, or a token-based cyclomatic-complexity estimate, with each file's duplication share.--summary-top <n>sets the list length,--summary-by tokens|lines|size|complexitypicks the ranking metric (config file:summary,summaryTop,summaryBy). Renders inconsole/console-full, as a compact one-line-per-entry block in theaireporter, and as an additivesummarykey in the JSON report (absent when the flag is off, so the schema is unchanged for existing consumers). Computed after detection from data already in memory — runs without--summaryare unaffected. (#934) - Isolated folder groups (
--skip-isolated) — skip duplication between monorepo folders owned by different teams: declare isolation groups as comma-separated lists of pipe-separated folders (--skip-isolated "packages/team-a|packages/team-b,libs/a|libs/b"), and clones whose two fragments fall under two different folders of the same group are dropped. Duplication inside a single folder, against shared code, or across unrelated groups is still reported. The config file accepts the nested-array shape"skipIsolated": [["packages/a", "packages/b"]](kebab-caseskip-isolatedworks too), and the option applies to MCP project scans as well. Ports #628 to the Rust engine. (#942)
Security
- Supply-chain hardening (OpenSSF Scorecard) — every GitHub Action in the release and CI pipelines is pinned to a full commit SHA (kept fresh by Dependabot), workflow tokens follow least privilege (top-level
contents: read, write grants scoped to the jobs that need them), and the repository now has aSECURITY.mdwith private disclosure channels, private vulnerability reporting, and a protectedmasterbranch
Bug Fixes
- GitHub "Latest" release badge stays on v5 — Rust v5 releases are created with
--latest; legacy TypeScript v4 andcpd v*releases explicitly opt out, so a v4 maintenance release can no longer take the Latest badge from the v5 line
Other
- npm package page polish — README links are absolute GitHub URLs so they resolve on npmjs.com, and the package description and keywords better describe what jscpd does
Dependencies
- Bump Rust toolchain to 1.97 and
oxccrates to 0.144 in/rust - Bump
serdeto 1.0.229 in/rust - Bump
clapto 4.6.6 in/rust - Bump
memchrto 2.8.3 in/rust - Bump
xxhash-rustto 0.8.18 in/rust
Thank You ❤️
- @hanzhangyu for proposing isolated folder groups for monorepos and contributing the original
skipIsolatedimplementation (#628), which this release ports to the Rust engine
Published Packages
cpd-core@0.1.9on crates.iocpd-finder@0.1.11on crates.iocpd-reporter@0.1.9on crates.iocpd-tokenizer@0.1.10on crates.iojscpd@5.0.16on crates.iocpd@5.0.16on npmjscpd-darwin-arm64@5.0.16on npmjscpd-darwin-x64@5.0.16on npmjscpd-linux-x64-gnu@5.0.16on npmjscpd-linux-arm64-gnu@5.0.16on npmjscpd-linux-x64-musl@5.0.16on npmjscpd-windows-x64-msvc@5.0.16on npm
Not Yet Published
jscpd@5.0.16(published: 5.0.15)