We should follow some listed rules while writing code that includes variable, method names, comments…etc. Microsoft code provides FxCop as code analysis tool, you can download latest FxCop tool for Visual Studio 2017 from Microsoft website at https://marketplace.visualstudio.com/items?itemName=VisualStudioPlatformTeam.MicrosoftCodeAnalysis2017 .
By default, Code Analysis option disabled with Visual Studio installation. To enable it, right click on project, select “Code Analysis” and check “Enable Code Analysis on Build” checkbox. Select proper Rule Set; if you are new to code analysis, starts with “Microsoft Basic Design Guideline Rules”.