find_clones
Rank code clone classes by ROI using metrics like cross-module spread and cohesion. Filter by minimum similarity and copy count to prioritize high-value refactoring candidates.
Instructions
Ranked candidate clone classes (unrefined; exact overlap metrics). Returns classes sorted by ROI (cross-module spread × member count × token length × load-bearing factor × cohesion), with a completeness provenance block. min_similarity (if set) must be in [0.5, 1.0] (default 0.7). A LIMITED query (limit: N) is capped at the refine budget (currently 50) — it returns at most 50 classes, all refined; pass limit: null/omit it to retrieve all classes (only the top 50 refined). completeness.refine_budget_clamped is true when a supplied limit hit that cap.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of clone classes to return, sorted by ROI descending. A supplied limit is capped at the refine budget (currently 50): `limit: N` returns at most 50 classes, all refined. Omit (null) to retrieve all classes (only the top 50 refined, the rest unrefined). | |
| min_copies | No | Minimum number of copies for a class to be returned (defaults to 2). | |
| min_similarity | No | Minimum pairwise overlap/max_len similarity. Must be in the range [0.5, 1.0]; defaults to 0.7 (the θ threshold) when omitted. Out-of-range values are rejected. |