I need a tool to find duplicates or similar blocks of text in a singular text file or set of text files

后端 未结 6 1327
甜味超标
甜味超标 2021-02-06 13:49

I want to automate moving duplicate or similar C code into functions.

This must work under Linux.

6条回答
  •  故里飘歌
    2021-02-06 13:53

    See CloneDR, a tool for finding exact copy and near-miss (copy-paste-edit) clones in source code. It uses full language parsers to enable it to find clones according to the language structure, minimizing false positives, and to be completely indendent of how the code is commented or formatted, thereby maximing true detection. The CloneDR will find clones when the cloned block has changed variable, inserted statemens or blocks of code.

    It has language front ends for C, C++, COBOL, C#, Java, PHP and a number of other langauges.

    You can see sample clone detection reports at the website.

提交回复
热议问题