Skip to content

User Story: .NET 6.0 developers can verify more APIs for their correct usage to speed up their development  #43617

Closed

Description

@cathysull

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

Activity

  1. added
    User Story
    on Oct 19, 2020
  2. added
    untriaged
    on Oct 19, 2020
  3. added
    Priority:1
    on Oct 30, 2020
  4. removed
    untriaged
    on Nov 27, 2020
  5. changed the title [-]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 [/+] on Nov 27, 2020
  6. danmoseley commented on Nov 29, 2020

    @danmoseley
    Contributor
  7. jeffhandley commented on Dec 2, 2020

    @jeffhandley
    Member
  8. self-assigned this
    on Dec 2, 2020
  9. added this to the 6.0.0 milestone on Jan 12, 2021
  10. added
    Cost:XL
    on Jan 14, 2021
  11. danmoseley commented on Jul 26, 2021

    @danmoseley
    Contributor

    @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?

  12. jeffhandley commented on Jul 26, 2021

    @jeffhandley
    Member

    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.

  13. jeffhandley commented on Aug 20, 2021

    @jeffhandley
    Member

    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.

  14. jeffhandley commented on Aug 20, 2021

    @jeffhandley
    Member

    Minor correction; #40579 might also land in .NET 6.0 (RC2).

  15. changed the title [-]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 [/+] on Aug 22, 2021
  16. ghost locked as resolved and limited conversation to collaborators on Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Cost:XLPriority:1Team:LibrariesUser Storyarea-Meta

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions