Repository navigation
Description
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.
| Status | Issue | PR | Title |
|---|---|---|---|
| ❌ Closed | #43971 | N/A | [Platform Compatibility Analyzer] Nested APIs shouldn't be allowed to expand the platform set |
| ❌ Closed | #33781 | N/A | Replace local allocations with stack allocated spans |
| ✔️ @buyaa-n | #45851 | #4838 | Referring to unknown platform names should result in warnings |
| ✔️ @mahdiva | #33765 | #5242 | Pass number of bytes to Buffer.BlockCopy |
| ✔️ @NewellClark | #33777 | #4764 | Use span-based string.Concat |
| ✔️ @NewellClark | #33784 | #4806 | Prefer string.AsSpan() over string.Substring() when parsing |
| ✔️ @NewellClark | #33789 | #4726 | Override Stream.ReadAsync/WriteAsync |
| ✔️ @ryzngard | #33806 | #4841 | Do not call Task.WhenAll with a single argument |
| ✔️ @ryzngard | #33807 | #4841 | Do not call Task.WaitAll with a single argument |
| ✔️ @NewellClark | #35343 | #4687 | Replace Dictionary<,>.Keys.Contains with ContainsKey |
| ✔️ @stephentoub | #42948 | #4909 | Environment.ProcessPath |
| ✔️ @stephentoub | #43257 | #4909 | Environment.CurrentManagedThreadId |
| ✔️ @jeffhandley | #43328 | #5347 | Warn on use of module initializer |
| ✔️ @NewellClark | #45552 | #5116 | Use String.Equals instead of String.Compare |
| ✔️ @jkoritzinsky | #46830 | #5043 | Expose interop manipulation of SafeHandle |
| ✔️ @MeikTranel | #47180 | #4908 | Use String.Contains(char) instead of String.Contains(String) |
| ✔️ @maryamariyan | #36064 | #5244 | Logging Analyzers |
| @mahdiva | #45661 | #5367 | Call async methods when in an async method |
Work Items Not Completed in .NET 6.0
| Status | Issue | PR | Title |
|---|---|---|---|
| Up for grabs | #27997 | Hide Thread.VolatileRead and Thread.VolatileWrite analyzer |
|
| @Mrnikbobjeff | #33769 | #4126 | Use AsParallel() correctly |
| @fowl2 | #33770 | #4328 | Do not use OfType<T>() with impossible types |
| @steveberdy | #33794 | #5383 | Extract array of const to static readonly field |
| @psxvoid | #33796 | Constructor parameters should match property names | |
| @chucker | #33797 | #4836 | Don't guard Dictionary<K, V>.Remove(key) by ContainsKey(key) |
| @CollinAlpert | #33798 | #4851 | Prefer Dictionary<K, V>.TryGetValue() over guarded indexer access |
| @CollinAlpert | #33799 | Prefer Dictionary<K, V>.TryAddValue(key) over guarded Add(key) |
|
| @Mrnikbobjeff | #35695 | #4130 | Prefer ExactSpelling=true on [DllImport] for known APIs |
| @wzchua | #40579 | #4797 | Prefer static HashData methods over ComputeHash |
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-]User Story: Support more Analyzers & Code Fixers[/-][+]User Story: .NET Core developers can verify more APIs for their correct usage to speed up their development [/+]danmoseley commentedon Nov 29, 2020
cc @jeffhandley
jeffhandley commentedon Dec 2, 2020
cc @carlossanlop @buyaa-n
danmoseley commentedon Jul 26, 2021
@jeffhandley A nice list of analyzers done for 6.0. Is there more to do here for 6.0 or shall we move to 7.0?
jeffhandley commentedon Jul 26, 2021
I'd like to keep this in 6.0.0 until @mahdiva's assigned analyzers are completed, and the others in progress are captured with their final 6.0.0 status. Thereafter, I'll move this to 7.0.0 for the remainder.
jeffhandley commentedon Aug 20, 2021
Closing this user story. Only #45661 remains open for .NET 6.0; the remainder of the analyzers have been captured in #57797 for .NET 7.
jeffhandley commentedon Aug 20, 2021
Minor correction; #40579 might also land in .NET 6.0 (RC2).
[-]User Story: .NET Core developers can verify more APIs for their correct usage to speed up their development [/-][+]User Story: .NET 6.0 developers can verify more APIs for their correct usage to speed up their development [/+]