Code Analysis CA1063 fires when deriving from IDisposable and providing implementation in base class

This is a false positive due to a minor bug in the rule itself. When trying to figure out if a class re-implements IDisposable (after figuring out that there’s a base class implementation that could be overridden), it only looks at whether the class’ interfaces include IDisposable. Unfortunately, the interface list that shows up in … Read more

Where can I find an actively developed lint tool for Ruby?

ruby -c myfile.rb will check for correct Ruby syntax. Reek checks Ruby code for common code smells. Roodi checks Ruby code for common object-oriented design issues. Flog can warn you about unusually complex code. [Plug] If your project is in a public Github repository, Caliper can run the latter three tools and others on your … Read more

C# – StyleCop – SA1121: UseBuiltInTypeAlias – Readability Rules

Just to clarify: not everyone agrees with the authors of StyleCop. Win32 and .NET guru Jeffrey Richter writes in his excellent book CLR via C#: The C# language specification states, “As a matter of style, use of the keyword is favored over use of the complete system type name.” I disagree with the language specification; … Read more

How to get the FxCop custom dictionary to work?

If you use it inside Visual Studio… From Visual Studio Code Analysis Team Blog To add a custom dictionary to a C# and Visual Basic project is simple: In Solution Explorer, right-click on the project and choose Add -> New Item… Under Templates, select XML File, enter a name for the dictionary, such as CodeAnalysisDictionary.xml … Read more

Assembly Binding Redirection and Code Analysis

Just to supplement with a little more precise answer: You need to either run FxCopCmd.exe with: fxcopcmd.exe /assemblyCompareMode:StrongNameIgnoringVersion or modify your Visual Studio project file for each build configuration’s property group, like this: <PropertyGroup Condition=” ‘$(Configuration)|$(Platform)’ == ‘Release|AnyCPU’ “> … <CodeAnalysisAdditionalOptions>/assemblyCompareMode:StrongNameIgnoringVersion</CodeAnalysisAdditionalOptions> </PropertyGroup>

Why do code quality discussions evoke strong reactions? [closed]

One obvious answer for the Stack Overflow part is that it isn’t a forum. It is a database of questions and answers, which means that duplicate questions are attempted avoided. How many different questions about code quality can you think of? That is why there aren’t 50,000 questions about “code quality”. Apart from that, anyone … Read more

Tools to detect duplicated code (Java) [closed]

I use the following tools: PMD/CPD (BSD-style License). Checkstyle (LGPL License) – support was removed, see details. Both tools have code duplication detection support. But both of them lack the ability to advise you how to refactor your code. JetBrains IntelliJ IDEA Ultimate has good static code analysis with code duplication support, but it is … Read more