views:

400

answers:

6

I wish to get a quick feeling for how much “copy and paste” coding we have, there are many tools for C# / Java to check for this type of thing. Are there any such tools that work well with VB.NET?

(I have seen what looks like lots of repeated code, but wish to get some number to help me make a case for sorting it out)


Update on progress.

I have just tried Simian.

Clone Doctor does not support VB.NET (only C# and VB 6 and lot of other)
October 2010: VB.net added to langauges supported by CloneDR

Clone Detective for Visual Studio only supports C#

SolidSDD - Source Code Duplication Detector only supports C, C++, C# and Java

DuplicateFinder is open source, but otherwise looks very match like Simian, e.g it just works on lines of text

ConQAT - Continuous Quality Assessment Toolkit seems to have a clone detector that works for VB.NET (not tried it yet)

Gendarme is a bit like FXCop and has a AvoidCodeDuplicatedInSameClassRule rule, this looks very promising, as it avoids the problem of working at the text level. Just tried it, it is the best solution so far, pity it does not search with a greater scope.


Before claiming that this question is a duplicate, please check that the other question addresses VB.NET, as a lot of tools that work well for C# don't work so well for VB.NET. (However it would not surprise me if this question is a real duplicate)

+1  A: 

Simian: http://www.redhillconsulting.com.au/products/simian/

Marek
A: 

Try Simian:

Simian (Similarity Analyser) identifies duplication in Java, C#, C, C++, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files.

Anton Gogolev
A: 

[I'm the author of CloneDR ("Clone Doctor").]

CloneDR is parameterized by a full grammar for the programming language in question. So it doesn't just match lines. Rather, it can find clones which are syntactically well-formed, with variations that are more than just identifier changes, regardless of where they stop or start in a line.

The engine on which CloneDR rests, The DMS Software Reengineering Toolkit" is a tool for analyzing large scale systems in any programming language, and uses language descriptions to drive the analysis. DMS has a wide variety of language front ends already available.

Presently it has VBScript and VB6 (as dialects of "Visual Basic"). It doesn't have VB.net, but that would be pretty straightforward to do given the DMS infrastructure and our experience with lots of other languages.

So, CloneDR could do this just fine, with a small bit of effort on our part.

EDIT October 2010: VB.net added as a language CloneDR can process.

Ira Baxter
A: 

Roll up your sleeves and write your own parser to use it with CPD?

Anders Lindahl
A: 

See the question for the tools I found.

Ian Ringrose
A: 

I once saw an impressive demo of Pattern Insight; its CP Miner may be what you’re looking for: http://patterninsight.com/products/cp-miner.php. It seems to be language-independent, though I couldn’t find anything explicit about languages other than C/C++.

Flash Sheridan