如何在开发过程中检测代码重复? [英] How to detect code duplication during development?

查看:343
本文介绍了如何在开发过程中检测代码重复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个相当大的代码库,C ++的400K LOC,代码复制是一个问题。是否有任何工具可以有效地检测重复的代码块?

We have a fairly large code base, 400K LOC of C++, and code duplication is something of a problem. Are there any tools which can effectively detect duplicated blocks of code?

理想情况下,这是开发人员可以在开发过程中使用的东西,而不是偶尔运行,以查看问题。如果我们可以将这样的工具与CruiseControl集成,以便在每次签入后生成一个报告,这也是很好的。

Ideally this would be something that developers could use during development rather than just run occasionally to see where the problems are. It would also be nice if we could integrate such a tool with CruiseControl to give a report after each check in.

我看看Duploc 一段时间以前,它显示了一个不错的图,但需要一个smalltalk环境来使用它,这使得自动运行相当困难。

I had a look at Duploc some time ago, it showed a nice graph but requires a smalltalk environment to use it, which makes running it automatically rather difficult.

免费工具会很好,但如果有一些好的商业工具,我也会感兴趣。

Free tools would be nice, but if there are some good commercial tools I would also be interested.

推荐答案

Simian 在C ++项目中检测到重复的代码。

Simian detects duplicate code in C++ projects.

更新:也适用于Java,C#,C,COBOL,Ruby,JSP,ASP,HTML,XML,Visual Basic,Groovy源代码甚至纯文本文件

Update: Also works with Java, C#, C, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files

这篇关于如何在开发过程中检测代码重复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆