I am trying to ignore some rules in my SQ-scan. Followed the steps mentioned here Narrowing the Focus | SonarQube DocsIgnore Issues on Multiple Criteria . But still the rules are identified in our scan results. Kindly suggest how to achieve “Ignoring Rules” in our pipeline scan.
(Few rules which needs to be blocked or whitelisted in our SQ scan results “go:S3776, go:S1192, python:S1192…”)
Also , Is there a way to whitelist/block few SonarQube rules through a script/configuration file (Please share an example of this).
FYI, I’m using the latest version of Sonarqube.
Thanks.
Writing the configuration for this exclusion manually can be tricky. I suggest you set it via the UI. Have you tried that? Alternately, have you considered removing the rules from your Quality Profile?
Yes, I set that via UI (SonarQube Dashboard), but still the rules are identified in our scan results.
And, Tried removing the rules from Quality profile (Deactivated the rules), but again the rules are identified.
So first, your second screenshot shows the correct way to set the exclusion. But since you want to exclude the rule for **/*.go then removing it from the profile would be the better option.
In fact, you say you did that, and re-ran analysis(?) and still had an issue from the removed rule show up? Can you verify that the new analysis was made with the edited profile?
Could you please share how to “verify the new analysis was made with the edited profile?”
(Checked the new sonarqube scan logs, but not sure if the new scan result was made with the edited profile or not)
the screenshot you showed was of a rule search. Whether or not the rule is used in your analysis, it’s always going to show up in the rule search results.
Are you seeing issues raised by this rule in your profile?
I’ve deactivated that rule (go:S3776) from my quality profile., and showing up in the rule search results is fine - no problem on that.
No, I don’t see issues from this in my profile.
And , My SonarQube Scan logs consists this particular rule and shows as critical. "rule": "go:S3776", "severity": "CRITICAL",
Is this always going to show up in the scan logs?
And I’m running this scan on one of my cluster - and it’s pod., if the current pod got deleted and a new pod comes in, will all the sonarqube settings apply for the new pod? Or Do we need to modify again he sonarqube profile/project settings to avoid some particular rule?
What you’ve shared aren’t analysis logs, but the results of a web service call. The Closed/Removed status & resolution indicate that the issue is no longer raised by analysis, but it used to be.
These closed issues should be taken care of by housekeeping in about a month.
This is all normal and expected and working as designed.
And I’m running this scan on one of my cluster - and it’s pod., if the current pod got deleted and a new pod comes in, will all the sonarqube settings apply for the new pod? Or Do we need to modify again he sonarqube profile/project settings to avoid some particular rule?