In .NET 5, we shipped approximately 250 analyzers with the .NET SDK. Many of them already existed but were shipped out-of-band as NuGet packages. Now, .NET comes with an in-depth code analysis and code fixer experiences. This means developers don't have to purely rely on their choices based on reading code completion; .NET can help them pro-actively identify when their code has issues, right from the start. However, many of the code analyzers created don’t come with code fixers yet. We will look at telemetry and customer feedback to prioritize (around a TBD set of principles) which code analyzers would most benefit from code fixers along with which are most popular and consider adding fixers for those. Also, there is a sizable backlog of code analyzers that didn't get included in .NET 5, which will need to prioritized and considered. Furthermore, our goal for .NET 6 is that new features in .NET 6 should come with analyzers.
Work Items
The getting started guide should be referenced for the Definition of Done to be used for each issue.
External contributors: If you'd like to work on one of the issues marked as "up for grabs", please add a comment directly on that issue asking to get it assigned to you, and tag @carlossanlop or @buyaa-n.
Work Items Not Completed in .NET 6.0
In .NET 5, we shipped approximately 250 analyzers with the .NET SDK. Many of them already existed but were shipped out-of-band as NuGet packages. Now, .NET comes with an in-depth code analysis and code fixer experiences. This means developers don't have to purely rely on their choices based on reading code completion; .NET can help them pro-actively identify when their code has issues, right from the start. However, many of the code analyzers created don’t come with code fixers yet. We will look at telemetry and customer feedback to prioritize (around a TBD set of principles) which code analyzers would most benefit from code fixers along with which are most popular and consider adding fixers for those. Also, there is a sizable backlog of code analyzers that didn't get included in .NET 5, which will need to prioritized and considered. Furthermore, our goal for .NET 6 is that new features in .NET 6 should come with analyzers.
Work Items
The getting started guide should be referenced for the Definition of Done to be used for each issue.
External contributors: If you'd like to work on one of the issues marked as "up for grabs", please add a comment directly on that issue asking to get it assigned to you, and tag @carlossanlop or @buyaa-n.
Buffer.BlockCopystring.Concatstring.AsSpan()overstring.Substring()when parsingStream.ReadAsync/WriteAsyncTask.WhenAllwith a single argumentTask.WaitAllwith a single argumentDictionary<,>.Keys.ContainswithContainsKeyEnvironment.ProcessPathEnvironment.CurrentManagedThreadIdString.Equalsinstead ofString.CompareSafeHandleString.Contains(char)instead ofString.Contains(String)Work Items Not Completed in .NET 6.0
Thread.VolatileReadandThread.VolatileWriteanalyzerAsParallel()correctlyOfType<T>()with impossible typesDictionary<K, V>.Remove(key)byContainsKey(key)Dictionary<K, V>.TryGetValue()over guarded indexer accessDictionary<K, V>.TryAddValue(key)over guardedAdd(key)ExactSpelling=trueon[DllImport]for known APIsHashDatamethods overComputeHash