|
CopyPasteKiller - Code Similarity Finder
CopyPasteKiller is a free tool for .Net developers that will analyze a directory of code and find large chunks
of similar code in multiple locations. This similar code can then be refactored either by creating a
base class or by reducing the protection level on the method so it can be called by multiple classes. Technically,
CopyPasteKiller should be called CopyPasteFinder because its up to you to remove the duplicate code, but
CopyPasteFinder isn't nearly as fun a name as CopyPasteKiller.
CopyPasteKiller finds similar code, not exact matches. It ignores "fluff" like whitespace, string content,
curly braces, comments and using/import statements. In VB.NET it will also ignore lines that contain only
"Next", "End While", "End Try", "End If", "End Property", "End Get" and "End Set".
CopyPasteKiller isn't perfect (especially the UI) but I'll continue to release improvements as I get
time to work on it. If you
have any questions/comments/bugs please shoot me an email. You can
subscribe to the Nitriq Blog to be updated about new releases of
CopyPasteKiller. I'll also be tweeting about CopyPasteKiller @nitriq.
Known Issues:
-
Sometimes CopyPasteKiller will find similar code in two different places within a single file, but the last 4-5 lines
aren't similar at all. Not sure what is causing it yet, but I'll get a fix out as soon as I can. Similarities
found between two different files should be fine.
-
In C# CopyPasteKiller doesn't properly ignore multiline verbatim string literals
(strings that start with the @ symbol and span multiple lines). It also does not properly ignore
comments marked with /* */ that span multiple lines.
If you like CopyPasteKiller, you should checkout Nitriq Code Analysis for .Net.
|
|
|