I want to do code analysis in my project and I am using Visual Studio 2013. I can see a Analyze tab which will help to do the code analysis. So my questions is below
Just found a post here, but I am not sure whether to use Fxcop or not?
http://michaelsync.net/2014/07/19/status-of-fxcop-code-analysis
FxCop provides a tool to help developers to follow their company's coding standards. FxCop does code analysis to check whether the new code is compliant with the coding standards and naming conventions followed by the company. FxCop will ensure that the specified rules are used in the source code.
StyleCop is a source code analysis tool that provides developers with an effective way to follow C# coding standards. FxCop runs against the compiled binaries as a way to understand and enforce the.NET Framework Guidelines for managed code assemblies.
Make a sensibly named folder for the FxCop setup file to go into, for example, create a folder called C:\Downloads\Microsoft\FxCop\Setup. 13. Right-click on the “WinSDK_FxCopSetup.exe + gobbledygook” file and select Copy. Copy the“WinSDK_FxCopSetup.exe + Guid” file into C:\Downloads\Microsoft\FxCop\Setup folder.
In Solution Explorer, select the project. On the Analyze menu, select Run Code Analysis on [Project Name].
(Disclaimer: I worked on Visual Studio at Microsoft, though not on the C# or CIL/FxCop teams and I have no inside knowledge of their work)
My understanding is that the Code Analysis engine in Visual Studio 2013 (under the Analyze menu) is essentially the same engine as used in FxCop, except built-in to Visual Studio and MSBuild (which makes build analysis easier to automate). VS2013 uses the old "hand-written" native C# and VB.NET compilers.
Visual Studio 2015 ("VS 14") uses the new "Roslyn" compiler set and its analysis engine is different. The blog article you linked to makes this clear:
we’re proving out our new Roslyn-based diagnostics by reimplementing the high-value, low-false-positive FxCop rules using Roslyn. We haven’t yet decided when to pull the switch and officially swap out the IL-based FxCop rules for rules built on Roslyn, but the new live analysis engine will be built into the C#/VB compilers in VS “14”
...from that, it's said that VS2015 includes the old FxCop rules in addition to new Roslyn-based rules, but the less reliable FxCop CIL-based rules have been replaced with Roslyn rules.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With