Efrain
Efrain

Reputation: 3364

Rosyln/NetAnayzers/Stylecop Analyzers: Generate Inspection Report

We are using the Microsoft.CodeAnalysis.NetAnalyzer and StyleCop.Analyzer roslyn Analyzers in our solutions to check code quality. We've been asked to provide evidence that we run these analyzers to some stakeholders. Unfortunately, we only get a list of warnings/errors when there are issues, but nothing when everything is fine. I.e. I would need a list that shows all the inspections performed and that they passed.

Any ideas on how I could come up with such a report?

(I found that there is a possibility to create a file with the warnings/errors found, using an <ErrorLog> tag in the csproj. But here it's the same problem - I don't get a list of the checks performed in the successful case, only if problems are found.)

Upvotes: 0

Views: 232

Answers (1)

meziantou
meziantou

Reputation: 21337

You can use <ReportAnalyzer>true</ReportAnalyzer> and compile using the /bl option to generate a binlog. The binlog contains the list of rules (and the execution time for each rule). Note that it doesn't show the severity of each rules. So, you need to also check all .editorconfig files and the csproj to get these information (you can search for AnalyzerConfigFiles in the binlog).

https://www.meziantou.net/understanding-the-impact-of-roslyn-analyzers-on-the-build-time.htm

Upvotes: 1

Related Questions