Benchmarks

Multi-Format Detection

How jscpd detects duplicates across Svelte, Astro, Vue, and Markdown formats — vs other tools.

Component file formats (.vue, .svelte, .astro) and rich documents (.md) embed multiple languages in a single file — template, script, and style blocks in components; YAML frontmatter and fenced code blocks in markdown. A CPD tool's ability to parse these structures determines whether it can detect duplicates within each embedded language and across different file formats sharing the same code.

Format Support Overview

Format Support Overview

Section-aware means the tool parses a file into separate language sections (CSS, JavaScript, template, etc.) and matches duplicates within each section independently. Flat text means the entire file is treated as undifferentiated text.

ToolLanguages.vue.svelte.astro.mdCross-Format
jscpd@5223Section-awareSection-awareSection-awareSection-awareYes
jscpd@4224Section-awareSection-awareSection-awareSection-awareYes
jscpd-rs223Section-awareSection-awareSection-awareSection-awareYes
Duplo~7Text-only
Simian∞ (any text)Flat textFlat textFlat textFlat textText-only
PMD CPD36No
FallowJS/TS onlyJS blocks onlyNo

Within-Format Clones

Duplicates detected within the same file format.

ToolSvelte → SvelteAstro → AstroVue → VueMarkdownTotal
jscpd@53 (410 lines)3 (124 lines)6 (274 lines)7 (356 lines)19 (1,164 lines)
jscpd@43 (410 lines)3 (124 lines)4 (224 lines)7 (343 lines)17 (1,101 lines)
jscpd-rs3 (410 lines)5 (177 lines)6 (274 lines)8 (350 lines)22 (1,211 lines)
Duplo1 (165 lines)1 (112 lines)3 (219 lines)5 (195 lines)10 (691 lines)
Simian1 (231 lines)1 (162 lines)4 (148 lines)4 (219 lines)10 (760 lines)
PMD CPD002 (29 lines)02 (29 lines)
Fallow dupes1 (58 lines)02 (167 lines)03 (225 lines)

Cross-Format Clones (Svelte ↔ Astro)

Duplicates detected across different file formats — e.g., matching CSS blocks in both .svelte and .astro files.

jscpd@5
2 clones, 53 lines CSS (46 lines) + markup (7 lines)
jscpd@4
3 clones, 189 lines CSS (46 lines) + markup (7, 136 lines) + JS (28 lines)
jscpd-rs
4 clones, 235 lines CSS (46 lines) + markup (7, 46, 136 lines)
Duplo
8 clones, 92 lines Text matches: CSS (6, 5, 30, 5 lines) × 4 pairs
Simian
Reports aggregate blocks Not per-language
PMD CPD
No cross-format detection
Fallow dupes
No cross-format detection

Markdown Embedded-Code Detection

Whether the tool detects duplicates inside embedded code blocks (TypeScript, Python, YAML) within Markdown files, rather than treating .md as flat text.

jscpd@5TypeScript, Python, YAML, Markdown
jscpd@4TypeScript, Python, YAML, Markdown
jscpd-rsTypeScript, Python, YAML, Markdown, Coffeescript
DuploFlat text only — matches prose, not embedded code
SimianFlat text only — reports as aggregate blocks
PMD CPDNo cross-format or embedded-code detection
Fallow dupesOnly processes JS/TS files