Resetting Severity of Code Smells Local Fails for suggestion and others

Please provide

  • Operating system: Windows 10
  • SonarLint plugin version: Installed latest on 2 days ago
  • Programming language you’re coding in: C#
  • Is connected mode used:
    • Connected to SonarCloud or SonarQube (and which version): SonarCloud

If you add the following to the .editconfig file, then nothing changes S107 still behaves as if the severity is error. All other severity changes do the same, except for setting the severity to nothing works as expected.
dotnet_diagnostic.S107.severity = suggestion

@duncanp Do you have any suggestions with changing a sonarlint compiler error to a warning. See above issue.

Hey there.

Please do not tag individuals not already involved in threads

@Colin ok.

I am new to using Sonar Lint and in the Sonar Community.

@Colin Can I send you a direct message?

Where do I find structured support for Sonar Lint?

SonarLint is a free, open-source tool: and your patience is appreciated. This is a Community forum.

@Colin Thank you. Do you know of a 3rd party that offers paid support?

This image shows that we can change S107 from an error to a warning, suggestion. or nothing. But when I change it to a suggestions or warning, it remains and error. When I change to none it goes away complete. Changing to none is not helpful. I need to change to warning. This we allow us to practice clean as you code for very large C# solutions.

@Charles, none of the SonarLint rules have a severity of Error by default (and if you are using Connected Mode even Sonar Critical issues won’t be mapped to a VS Error - see here).

Do you have <TreatWarningsAsErrors>true</TreatWarningsAsErrors> set in your MSBuild project file? (TreatWarningsAsErrors is a compiler-level setting that overrides whatever you have set in ruleset/.editorconfig)

1 Like

Thank you very much for you help. That was it. By changing to the following in the project file I am able to correctly change from error to warning:

1 Like

Glad to hear it’s resolved, @p97.

On an unrelated topic, I see from your screen shot that there is a gold bar in Visual Studio saying that VS was unresponsive and suggesting that SonarLint might the cause.

We take gold bar performance issues seriously and do our best to eliminate them. Currently the only issues were know about are here.

Can you reproduce the gold bar, and if so how? Thanks.

Hi @duncanp ,

Thank you for asking about the performance issue. The project has almost 600,000 lines of code, which includes about 200 projects. It takes a while to open, and there are likely many things going on when Visual Studio blamed Sonar Lint. Thus, I can reproduce this issue each time I open it. Do you have any suggestions for me to help analyze this issue? I see that Visual Studio takes most of of the memory (85%) and CPU went to 100% just before it displayed that message. The CPU dropped then within 5 seconds the message displayed as memory used inched up to 90%. It displayed the very moment that the list of messages displayed in the error list including the Sonar Warnings.

I restarted my computer and closed apps that consume lots of memory. When I open Visual Studio I get the same message with CPU usage is 51% and memory is at 54%. Let me know if you would like for me to try something else.

Thanks for the additional info, @p97. Performance-related gold bars tend to be caused if VS thinks that an extension has tied up the UI thread for too long.

As far as I’m aware, VS doesn’t check the memory/CPU usage. However, I might be wrong; exactly what VS tracks is not documented publicly, and seems to have become more stringent over time.

My guess is that it is the number of projects that is a problem rather than the number of lines of code.
I’ll try to repro the issue with a connected-mode solution with a large number of projects.

Thanks for the offer of assistance. I can’t think of anything else to try at the moment, but if I do I’ll let you know.

You are welcome.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.