dotnet / dotnet/sdk

Enable more code analysis rules for code analyzers

Open
#50,365 0 comments 1 reaction 0 assignees View on GitHub
Area-Microsoft.CodeAnalysis.NetAnalyzers untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

Currently `AnalysisMode` is not explicitly set for code analyzer projects and therefore has `Default` mode. I would suggest to enable more rules by setting it explicitly.

It would probably be easier to start doing this in separate projects setting `AnalysisMode` to `Minimum` first and then gradually increasing to the desired level. Then it could be set in `Directory.Build.props` when all projects are ready.

This should particularly improve performance as there are quite a few performance-related analyzers, I think code analysis performance is really important as it directly affects build times. For example, it should help catch [CA1860](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1860) errors, I'm fixing one of them in #50310.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.