> ## Documentation Index
> Fetch the complete documentation index at: https://roe.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# roe dupes

> Find copy-pasted and copy-pasted-and-renamed code blocks.

Finds duplicated — copy-pasted, and optionally copy-pasted-and-renamed —
blocks of code across your solution.

```bash theme={null}
roe dupes [PATH]
```

```text theme={null}
2 occurrences (105 tokens, 24 lines)
  src/App/Billing/PaymentService.cs:40:5-63:6
  src/App/Shipping/ShippingService.cs:38:5-61:6

found 1 duplicate group · 48 duplicated lines — 1 project(s), 214 file(s) scanned in 61 ms
```

## Options

| Option                       | Description                                                                                                               |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `PATH`                       | Path to the codebase root — a directory, `.sln` file, or `.csproj` file. Defaults to the current directory.               |
| `-f, --format <human\|json>` | Output format. Defaults to `human`; `json` emits the stable v1 schema described in [JSON output](/reference/json-output). |
| `--mode <exact\|semantic>`   | Matching mode. Defaults to `exact`.                                                                                       |
| `--no-code`                  | Hide the duplicated source code printed under each group (human format only).                                             |
| `--min-tokens <N>`           | Minimum token-run length for a match to be reported. Defaults to `50`.                                                    |
| `--min-lines <N>`            | Minimum line span (of the shortest occurrence) for a match to be reported. Defaults to `5`.                               |
| `--min-occurrences <N>`      | Minimum number of occurrences for a match to be reported. Defaults to `2`.                                                |
| `--config <PATH>`            | Use this `roe.json`/`roe.yaml`/`roe.yml` instead of [auto-discovery](/configuration).                                     |

`--mode`, `--min-tokens`, `--min-lines`, and `--min-occurrences` fall back to
the `dupes` block of a [config file](/configuration) before their built-in
defaults, so a calibration is committed once instead of repeated on every
invocation. That block is also how a combined [`roe check`](/commands/check)
run, which takes no dupes flags, picks the calibration up.

## Exact vs. semantic mode

By default, `roe dupes` only matches code that's identical token-for-token.
Pass `--mode semantic` to also catch blocks that were copied and then had
their variable names or numeric literals changed, but are otherwise
structurally the same: identifiers and numeric literals are normalized to a
shared placeholder before matching, while string literals, keywords, and
punctuation always keep their exact text.

```bash theme={null}
roe dupes --mode semantic path/to/solution
```

## Ignoring files

Duplicates span multiple files, so there's no inline suppression comment for
them. Instead, use ignore globs in a [config file](/configuration): the
top-level `ignore` list applies to every command, and the `dupes.ignore`
list adds patterns only the duplicate analysis honours — so accepting an
intentional duplicate doesn't cost the file its dead-code and health
coverage.

```json roe.json theme={null}
{
  "dupes": {
    "ignore": ["**/InsurerUnionQuery.cs"]
  }
}
```
