Skip to content

Port remaining FxCop rules into .NET as Roslyn Analyzers #61964

Open

Description

@Evangelink

In roslyn-analyzers there is a bunch of tickets open related to porting some old FxCop rules. Because most of these are dated from 2015, we were wondering if it would be worth having them under review as their relevance or the context in which they apply may have changed.

I have tried to filter down the ones related to .NET API but I may have missed or included incorrect ones (if you want to review them all, please look at https://github.com/dotnet/roslyn-analyzers/issues?q=is%3Aopen+label%3AFxCop-Port+-label%3A%22Needs-Fixer%22):

(tagging @mavasani )

Native resources/Interop

WinForms

Serialization

Others

Activity

  1. ghost added
    untriaged
    on Nov 23, 2021
  2. mavasani commented on Nov 23, 2021

    @mavasani
  3. stephentoub commented on Nov 23, 2021

    @stephentoub
    Member

    We should just close any of these that are no longer relevant / stale / etc.

    @AaronRobinsonMSFT / @jkoritzinsky / @elinor-fung to comment on the interop rules.

    I suggest we close all of the serialization ones. We're in the process of deprecating BinaryFormatter, we're no longer encouraging implementation of ISerializable nor implementing it ourselves on new types, etc. @GrabYourPitchforks

    @merriemcgaw for WinForms.

  4. added
    code-analyzer
    on Nov 23, 2021
  5. Evangelink commented on Nov 25, 2021

    @Evangelink
    MemberAuthor

    @stephentoub Out of curiosity, are you simply no longer encouraging the implementation of ISerializable or shall we go even one step further and have analyzers guarding against (there could be a dotnet version check)?

  6. merriemcgaw commented on Dec 1, 2021

    @merriemcgaw

    @RussKie can you look at the WinForms ones and see if they make any sense in the current context?

  7. GrabYourPitchforks commented on Dec 2, 2021

    @GrabYourPitchforks
    Member

    @Evangelink Basically, we're no longer marking any new types as [Serializable] or applying the ISerializable interface. There are some exceptions for the sake of compatibility, but those use cases are definitely in the minority.

  8. RussKie commented on Dec 6, 2021

    @RussKie
    Contributor

    WinForms:

    These look worthy of a port.

    Over the months we had several team discussions and bounced ideas about how we can enhance the developer and end user experiences with various Windows Forms analyzers. I also had an offline thread with @jmarolf @sharwell @mavasani about the same subject, and for the general purpose analyzers (like these) https://github.com/dotnet/roslyn-analyzers looked like a good home.

  9. AaronRobinsonMSFT commented on Jan 7, 2022

    @AaronRobinsonMSFT
    Member

    The Interop team has gone through the list. The below list contains what we think makes sense to port. All others can be closed.

    dotnet/roslyn-analyzers#420
    dotnet/roslyn-analyzers#421
    dotnet/roslyn-analyzers#425
    dotnet/roslyn-analyzers#428
    dotnet/roslyn-analyzers#430

  10. Evangelink commented on Jan 7, 2022

    @Evangelink
    MemberAuthor

    @AaronRobinsonMSFT Would it be possible to get a short description on why the team thinks the following two rules are not worth being implemented?
    dotnet/roslyn-analyzers#395
    dotnet/roslyn-analyzers#530

  11. Evangelink commented on Jan 7, 2022

    @Evangelink
    MemberAuthor

    @stephentoub @GrabYourPitchforks Could you please confirm that's ok to close all the tickets about serialization?

    The tickets in the Other section are still waiting for review/decision.

  12. AaronRobinsonMSFT commented on Jan 7, 2022

    @AaronRobinsonMSFT
    Member

    @Evangelink Sure. Would you like the comments here or in the specific issues?

  13. Evangelink commented on Jan 8, 2022

    @Evangelink
    MemberAuthor

    Maybe directly on the tickets but I am fine here too. The two rules seem to make sense to me (like if you own native or disposable resources you must be disposable, and for the 2nd what's the point of using an interop if the fwk allows for the same fnctionality).

  14. 1 remaining item

  15. stephentoub commented on Jan 21, 2022

    @stephentoub
    Member

    @stephentoub @GrabYourPitchforks Could you please confirm that's ok to close all the tickets about serialization?

    Yes, go ahead. Thanks.

  16. changed the title [-][API Proposal]: Review FxCop rules remaining to port[/-] [+]Port remaining FxCop rules into .NET as Roslyn Analyzers[/+] on Jan 22, 2022
  17. added
    Epic
    and removed
    untriaged
    on Jan 22, 2022
  18. added this to the 7.0.0 milestone on Jan 22, 2022
  19. jeffhandley commented on Jan 22, 2022

    @jeffhandley
    Member

    @buyaa-n & @carlossanlop Please review the analyzers in the 'Other' category to determine if we want to bring those for API Review and include them in our plans. Thanks!

  20. jeffhandley commented on Jan 22, 2022

    @jeffhandley
    Member

    that's ok to close all the tickets about serialization

    Done

  21. self-assigned this
    on Jan 22, 2022
  22. added
    Priority:3
    on Feb 6, 2022
  23. modified the milestones: 7.0.0, 8.0.0 on Jul 6, 2022
  24. modified the milestones: 8.0.0, Future on Jul 14, 2022
  25. jeffhandley commented on Aug 11, 2022

    @jeffhandley
    Member

    We were not able to finish this list. Changing the milestone to Future to keep the epic alive. More of these analyzers will be considered as part of .NET 8 planning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

EpicPriority:3Team:Librariesarea-Metacode-analyzer

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions