简体   繁体   English

剪切和粘贴代码重用-JavaScript和C#

[英]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#? 跟踪JavaScript和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... 我需要一些帮助来处理所有可以重构为基类,可重用js库等的内容...

If it can plug into Visual Studio 2010, that would be an added bonus. 如果它可以插入Visual Studio 2010,那将是一个额外的好处。

Simian has built in support for C# and JavaScript. Simian内置了对C#和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. 还有一个名为“ 克隆侦探”的工具可作为Visual Studio的外接程序使用,尽管它看起来不像与JavaScript一起使用。

A couple that I know, 我认识的一对

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. SD CloneDR是一种工具,该工具使用语言结构查找精确的和几乎未命中的重复代码块,以指导分析并最大程度地减少误报。 It tends to find 10%+ duplicated code in almost anything that human beings write. 它几乎可以在人类编写的所有内容中找到10%以上的重复代码。

CloneDR has compiler-quality langauge front ends for C, C++, Java, COBOL, PHP. CloneDR具有适用于C,C ++,Java,COBOL,PHP的具有编译器质量的语言前端。 Python, Fortran, as well as C# and Javascript. Python,Fortran以及C#和Javascript。

You can see clone detection reports at the web link report for a variety of systems. 您可以在各种系统的Web链接报告中查看克隆检测报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM