List the clones of one file
get_file_clonesList every clone from the last scan involving a file to see which other files share code before refactoring, splitting, or deleting it.
Instructions
List every clone of the last scan that involves one file, to see which other files share code with it. Use it before refactoring, splitting or deleting a file. Returns {file, kinds, clones, returned, duplications[]}, each duplication with 'kind', 'format', 'fileA', 'startA', 'endA', 'fileB', 'startB', 'endB', 'lines' and 'tokens' ('similarity' and 'method' for similar and semantic ones), biggest first; the file may be fileA or fileB. A path that was not part of the scan gets clones 0 and a 'note'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The file, relative to the scan root as other results show paths (e.g. 'src/cart.js'), or absolute. | |
| kinds | No | The kinds of clone to look for: exact (type1), renamed (type2), similar (type3; 'gap' or 'ast' for one of its two mechanisms) and semantic (type4). Without it: exact, what jscpd reports with this server's options. Renamed and similar clones may need one scan more, and semantic ones run an embedding model, which takes a while the first time. | |
| limit | No | Maximum number of clones in the response. 'clones' always carries the full count, so a small limit still tells you how much was found. |