What are good tools for identifying potentially du

2020-07-02 09:10发布

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.

6条回答
ら.Afraid
2楼-- · 2020-07-02 09:41

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

查看更多
beautiful°
3楼-- · 2020-07-02 09:44

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

查看更多
我命由我不由天
4楼-- · 2020-07-02 09:47

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.

查看更多
祖国的老花朵
5楼-- · 2020-07-02 09:50

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.

查看更多
萌系小妹纸
6楼-- · 2020-07-02 09:55

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.

查看更多
▲ chillily
7楼-- · 2020-07-02 10:04

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".

查看更多
登录 后发表回答