Skip to main content

ovecc dupes

Detects duplicated code — clone families over a normalized token stream — with exact path:start-end ranges, so you catch duplicated logic before it propagates.

Usage: ovecc dupes [OPTIONS]

Example

$ ovecc dupes
Duplication: 1 clone family (scanned 11 files, >= 50 tokens / 5 lines)

1. 89 tokens / 12 lines, 2 copies:
src/services/reports.ts:3-14
src/services/reports.ts:16-27

The scan line always states coverage and thresholds, so "no duplication" is a verified claim, not a silent skip:

Duplication: 0 clone families (scanned 9 files, >= 50 tokens / 5 lines)
(no duplication above the threshold)

Options

OptionDefaultEffect
--min-tokens <N>50Minimum shared run, in tokens, to report as a clone
--min-lines <N>5Minimum line span for a clone region
--cross-file-onlyoffOnly report clones spanning at least two files

Plus the global options.

Notes

  • Same-file duplication is reported by default — copy-paste within one file is still duplication (the example above is exactly that). Pass --cross-file-only when you only care about cross-file families.
  • Matching runs over a normalized token stream, so trivially-renamed copies still cluster into one family.
  • review includes a change-scoped duplication section: the clone families your change added, including clones against pre-existing code.