Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What StyleCop like tools are there for VB.NET

Tags:

see also VB.NET Static Code Anaylsis

For better or for worst we now have a VB.NET coding standards document that is based on a C# coding standard as enforced by StyleCop.

For example

  • the number of spaces you should put in each side of a “+” sign etc
  • all instance Members (fields and methods!) must be access as “me.fieldName”
  • all shared members must be accessed as “className.fieldName”

As I tend to think:

If it’s in a requirements document it should be check for by an automatic system

I am looking for (ideally free) tools that will check for that short of rules on VB.NET code, as these are style issues that don’t make it into the compiled output, FxCop is not useful.

(I would personally match rather that we just check for important things like duplicated code and single reasonability for each class (so no more multi thousand line classes!), but as I need to keep to the coding standard document I wish to have a tool to help me do so.)

see also Enforcing using the class name whenever a shared member is accessed.

About the bounty.
I am looking for a list of VB.NET code checking tools, with a short summery of what each tool can do and its limitations. If the tools are not free, please include some ideal of cost.


Does anyone have experience using CodeRush/Refactor! or ReSharper with VB.NET to check for this type of coding style issues?

like image 475
Ian Ringrose Avatar asked Jan 25 '10 09:01

Ian Ringrose


People also ask

Is StyleCop still used?

StyleCop used to be a Visual Studio plugin and a NuGet package. You can still use this in Visual Studio 2019, but the current recommended way to use StyleCop is to use the Roslyn-based analyzers.

What is StyleCop used for?

StyleCop is a C# source code analyzer that allows you to enforce a set of style and consistency rules. You can adapt the rules that you don't want to check depending on your needs. This kind of tools helps you to have a code: Readable.

Is VB.NET cross platform?

No. Xamarin only supports C# and F#. There is no comparable platform that supports VB.NET.


1 Answers

I know of no free source code analysis tools with good VB support. There are, however, at least two commercial tools that may be suitable:

  1. submain CodeIt.Right
  2. SSW Code Auditor

Personally, I prefer the CodeIt.Right rule authoring mechanism, so I would favour it if considerable custom rule development were planned. However, if you just want to use out-of-the box rules, Code Auditor ships with quite a few more code style rules than CodeIt.Right, most of whose built-in rules target the compiled IL (like FxCop).

like image 156
Nicole Calinoiu Avatar answered Sep 23 '22 17:09

Nicole Calinoiu