What are good tools for identifying potentially du

2020-07-02 08:58发布

问题:

see also "Any tools to check for duplicate VB.NET code?"

A friend of mine only has access to the Express editions of Visual Studio and I am trying to help him refactor to remove a lot of duplication.

回答1:

You could take a look at Simian or DuplicateFinder. Neither have a dependency on the IDE, although you can integrate Simian quite easily.



回答2:

Clone Detective appears as though it might work for you. I haven't used it before, but I stumbled across it on codeplex this week.



回答3:

Your friend should take a look at Gendarme, a FOSS and cross-platform alternative to Microsoft's FxCop/Code Analysis which is part of the Mono project. It includes rules that check for duplicated code.



回答4:

Try Atomiq:

Atomiq Code Similarity Finder is a tool for developers to find and eliminate duplicate code. It is designed for .NET developers, but works equally well for developers of other languages and even web designers! Atomiq works with a wide variety of source code:

We currently support C#, VB.Net, ASPX, Ruby, Python, Java, C, C++, ActionScript, and XAML, with more extensions on the way soon. It is the perfect companion tool for someone who updates their code infrequently and can't possibly remember everything in it or for a team of 2 or more developers working on the same project that don't know everything in it since they didn't write it all themselves.

Eliminate similar code

(and the banging your head against the wall that comes with it) Atomiq doesn't just find exact matches, it finds similar code. It ignores "fluff" like whitespace, string content, curly braces, comments and using/import statements so you can find the duplicate code that causes problems. 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".



回答5:

More as fyi, since you mentioned 'express edition' you might need to look for something that would work outside of VS, since I don't believe the express editions support plugins



回答6:

See our CloneDR, which operates on many langauges, including C#.

EDIT October 2010: VB6, VBScript and VB.net added as languages supported by CloneDR. There is no specific support for MS IDEs, but it operates on a simple list of source files, and produces a nice HTML report, so not much integration is needed. See sample reports at link.