Cut and Paste Code Reuse - JavaScript and C#
What is the best tool(s) for tracking down "cut and paste reuse" of code in JavaScript and C#? I've inherited a really big project and the amount of code that is repeated throughout the app is 'epic'. I need some help getting handle on all the stuff that can be refactored to base classes, reusable js libs, etc...
If it can plug into开发者_开发百科 Visual Studio 2010, that would be an added bonus.
Simian has built in support for C# and JavaScript. There is also a tool called Clone Detective that works as an add-in for Visual Studio, although it doesn't look like it works with JavaScript.
A couple that I know,
- DuplicateFinder
- Team City
- CloneDetective
And a worthy reading article.
The SD CloneDR is a tool that finds exact and near-miss blocks of duplicate code using the language structure to guide the analysis and minimize false positives. It tends to find 10%+ duplicated code in almost anything that human beings write.
CloneDR has compiler-quality langauge front ends for C, C++, Java, COBOL, PHP. Python, Fortran, as well as C# and Javascript.
You can see clone detection reports at the web link report for a variety of systems.
精彩评论