Well, you can run the clone detector on your source code base every night.
Many clone detectors work by comparing source strings and can only find an exact duplicate of code.
CCFinder, above, works by comparing the language of tokens, so it is not sensitive to the gap of change. It can detect clones that are variants of the source code if there is only one change token (for example, change the variable X to Y per clone).
Ideally, what you want is higher, but the ability to find clones where variations are allowed are relatively arbitrary, for example, replace a variable with an expression, a statement with a block, etc.
Our clone detector CloneDR does this for Java, C #, C ++, COBOL, VB.net, VB6, Fortran and a variety of other languages. This can be seen at: http://www.semdesigns.com/Products/Clone/index.html
In addition to being able to manage multiple languages, the CloneDR engine is capable of handling various input styles, including ASCII, ISO-8859-1, UTF8, UTF16, EBCDIC, a number of Microsoft encodings, and (Japanese) Shift-JIS.
The site has several reports on the launch of clone checking, including one for C ++.
EDIT Feb 2014: Now handles all C ++ 14.
Ira Baxter Jun 28 '09 at 19:27 2009-06-28 19:27
source share