Based on Pluralsight course : Code Analysis in Visual Studio 2019
- ruleset will soon be replaced with .editorconfig
- dotnet_code_quality:api_surface, ex. public private
- https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-quality-rule-options
- remove unneccessary usings
- fix method names
- fix formattings
- highlight a section of the code and make method
- configure profile to add fixers
- per page
- applies to whole solution
- determine the scope of the analyzer
- options > text editor > C# > code style
- setting preferences to appear with warning or errors
- create .editorconfig file to store in the solutio/ project level.
- anyone working on this solution can get this configuration
- configure
- install
- using roslynator extension as analyzer, not nuget.
- using roslynator as nuget.
- and fxcop analyzer?
- with nuget the warnings shows up in the build.
- for certain lines of code
- ex. setting to readonly
- creates assembly file
- modify the file to target type over member etc.
- for all active issues
- apply to a specific set of code only
- create .ruleset file
- add reference in csproj
- update ruleset by selecting the analyzer rule sets under the project
- set to error which will prevent build unless fixed
running from cmd
- dotnet-format
- add to build process
- Build the application (write code and setup the Roslyn Analyzers)
- Push Code to Build Server (Build solution and run quality checks to produce deployable package)
- Deploy to stage environments (manual stakeholder testing and sign off on new features)
- Deploy to production (release to end users or customers)
- doesn't allow build on azure even when checked in without build
- cyclomatic complexity
- inheritance depth
- class coupling
- lines of code
- maintainability index