Multi-Format Detection
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.
| Tool | Languages | .vue | .svelte | .astro | .md | Cross-Format |
|---|---|---|---|---|---|---|
| jscpd@5 | 223 | Section-aware | Section-aware | Section-aware | Section-aware | Yes |
| jscpd@4 | 224 | Section-aware | Section-aware | Section-aware | Section-aware | Yes |
| jscpd-rs | 223 | Section-aware | Section-aware | Section-aware | Section-aware | Yes |
| Duplo | ~7 | — | — | — | — | Text-only |
| Simian | ∞ (any text) | Flat text | Flat text | Flat text | Flat text | Text-only |
| PMD CPD | 36 | — | — | — | — | No |
| Fallow | JS/TS only | JS blocks only | — | — | — | No |
Within-Format Clones
Duplicates detected within the same file format.
| Tool | Svelte → Svelte | Astro → Astro | Vue → Vue | Markdown | Total |
|---|---|---|---|---|---|
| jscpd@5 | 3 (410 lines) | 3 (124 lines) | 6 (274 lines) | 7 (356 lines) | 19 (1,164 lines) |
| jscpd@4 | 3 (410 lines) | 3 (124 lines) | 4 (224 lines) | 7 (343 lines) | 17 (1,101 lines) |
| jscpd-rs | 3 (410 lines) | 5 (177 lines) | 6 (274 lines) | 8 (350 lines) | 22 (1,211 lines) |
| Duplo | 1 (165 lines) | 1 (112 lines) | 3 (219 lines) | 5 (195 lines) | 10 (691 lines) |
| Simian | 1 (231 lines) | 1 (162 lines) | 4 (148 lines) | 4 (219 lines) | 10 (760 lines) |
| PMD CPD | 0 | 0 | 2 (29 lines) | 0 | 2 (29 lines) |
| Fallow dupes | 1 (58 lines) | 0 | 2 (167 lines) | 0 | 3 (225 lines) |
Cross-Format Clones (Svelte ↔ Astro)
Duplicates detected across different file formats — e.g., matching CSS blocks in both .svelte and .astro files.
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.