Near-duplicate function pairs
list_duplicate_functionsIdentify near-duplicate function pairs in your repo before a refactor. Uses containment similarity to surface up to 50 twins, skipping small and same-file functions.
Instructions
Lists near-duplicate function pairs in the newest run, at most 50. Use it before a refactor so twins are folded together, and get_function_brief for one function's twins. It shingles source on every call, seconds on a large repo, skips functions under 8 lines and same-file pairs, and an empty list means no pair reached similarity. similarity is shared shingles over the smaller function: 1.0 admits only a function found whole inside another, 0.8 four lines in five, and repo may be any directory under the checkout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | path to the scored repo's root (default: the repo the server was started in) | |
| similarity | No | containment threshold, shared over smaller, 0 to 1 (default 0.8) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pairs | No | pairs at or above similarity, best containment first, at most 50 | |
| run_id | No | the newest run whose rows were compared | |
| schema | No | payload schema version, 1 |