Giter Site home page Giter Site logo

Microsoft Code Analysis about fo-dicom HOT 2 OPEN

amoerie avatar amoerie commented on September 21, 2024
Microsoft Code Analysis

from fo-dicom.

Comments (2)

gofal avatar gofal commented on September 21, 2024

Of course it is a good idea to enable code analysis.

But still, the code analysis can warn or give suggestions. Often the warnings are a good idea, but sometimes they are false warnings. Meaning, we should not blindly trust the code analysis like lemmings.
If working on a issue and testing it, then the analysis and warnings of this code should be fixed or evaluated by the programmer.

But we should not turn on code analysis, and then also turn on TreatWarningsAsError, which then forcues us to change all the code across all the project.

from fo-dicom.

amoerie avatar amoerie commented on September 21, 2024

Of course it is a good idea to enable code analysis.

But still, the code analysis can warn or give suggestions. Often the warnings are a good idea, but sometimes they are false warnings. Meaning, we should not blindly trust the code analysis like lemmings. If working on a issue and testing it, then the analysis and warnings of this code should be fixed or evaluated by the programmer.

But we should not turn on code analysis, and then also turn on TreatWarningsAsError, which then forcues us to change all the code across all the project.

In general my experience with Microsoft.CodeAnalysis is that they are quite conservative, and safe to apply. If we disagree with a specific warning, or if it would introduce too much work, we can disable them (and I have already done so a few times in my PR).

You can configure the severity level of each rule separately in .editorconfig. I have set everything in the "reliability" and "performance" category to "Warning" for now, since these are important aspects of a library. For example, "ConfigureAwait" is only a suggestion by default, but as you have experienced, they can cause quite some trouble.
The other rules are still set to their default values.

If you have some time, please look at some of the changes I made with the currently activated set of rules. Please say so if disagree with some of them. I made separate commits per rule, so it is just a matter of reverting the commit and changing the severity of the rule.

from fo-dicom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.