Applying extension tools to analyze code
Although the sample code delivered after the Code Style and Code Cleanup tools is better than the code we presented at the beginning of the chapter, it is clearly far removed from the best practices discussed in Chapter 17, Best Practices in Coding C# 9. In the next sections, you will be able to check the behavior of two extensions that can help you evolve this code: Microsoft Code Analysis 2019, and SonarLint for Visual Studio 2019.
Using Microsoft Code Analysis 2019
This extension is provided by Microsoft DevLabs and is an upgrade to the FxCop rules that we used to automate in the past. It can also be added to a project as a NuGet package, so it can become a part of the application CI build. Basically, it has more than 100 rules for detecting problems in the code as you type it.
For instance, just by enabling the extension and rebuilding the small sample we are using in this chapter, Code Analysis found a new issue to solve, as...