Can you please recommend an industry standard static code analysis tool for C# language. It should take care of all the coding guidelines. Got the below tools which are licensed. Currently using airbnb lint for react code review. Similarly is there any industry standards available for C#. Found SonarQube but the enterprise edition is licensed. Is there any open source available which can be used straight away.
1 Answer
Visual Studio can perform code analysis of managed code in two ways: with Binary analyzers, also known as FxCop static analysis of managed assemblies, and with the more modern Roslyn analyzers. Roslyn analyzers, which analyze your code live as you type, replace FxCop static analysis, which only analyzes your code after a build. source Visual Studio IDE is available from Microsoft in Community (free), Professional and Enterprise editions.
For more information on alternatives to built-in code analysis features in Visual Studio grouped by tool categories (code violation detection, quality metric tools, style checking tools, duplication detection, and refactoring tools) see this answer. Most of these tools are not open source.
Refactoring Essentials for Visual Studio and other IDEs is an open source tool that has features which include refactorings for C# and analyzers and code fixes for C#.
-
I believe fxcop is now deprecated. StyleCop is meant to be used with C#.– ChillieJul 10, 2019 at 19:01