Fixed issues are reappearing


(Divya Gupta) #1

Hi,

There are some bugs in sonar cloud which we think are not valid. If we try to marked them as fix , they just reappear if we pushed the next build to GitHub as reopened. Is there any solution for this?
Also, we are not able to deactivate the rule in Sonar Cloud for my organization.
Please suggest on this.


(Benoit) #2

Hi,

They might reappeared because they are considered as new issue. See the doc under “Understanding which Issues are ‘New’” to understand when an issue is considered as new. If you don’t think your case match one those mentioned in the doc, share details about changes the push introduces (e.g. does it change the line where the issue is raised, etc…?)

I assume you’re using a built in quality profile? Because built-in quality profiles are immutable. You have to copy or extend it, and then you’ll be able to disable the rules from the copied quality profiles.

HTH


(Divya Gupta) #3

Thanks for the reply Benoit.

We are not using the built in quality profile. We have copied the Sonar way build in quality profile and marked it as default. But still admin is not able to deactivate the rule in Sonar Cloud.
The deactivate button is disabled. It is displaying" This rule is inherited and cannot be deactivated."
Is there something we can do?


(Benoit) #6

Have you extended or copied the built-in quality profiles?
I was wrong in my first message, it’s possible to deactivate a rule only if you copied the built-in quality profile. So if you extended it, you won’t be able to deactivate rules but only activate new ones (hence the “extend” naming).


(Adam Gabryś) #7

Fixed means the issue has been fixed. The issue is Reopened after the next analysis because you didn’t fix it. You only marked it as Fixed. The Fixed state is always updated by the Scanner, so you shouldn’t choose it manually.

If you want to “hide” the issue (because it is invalid), then you have to mark it as Won't Fix or False Positive.

  • Won't fix means that the code breaks the rule, but you don’t want to change it (for example it is a deprecated code which will be removed soon or the issue is not valid in your context)
  • False Positive means that the rule works incorrectly (for example marks a used filed as an unused filed - forces you to remove a dead code which is not a true dead code)