Mid last week, our primarily JS/TS repo had a spike of almost 200 issues! I’m unsure why–we did not change our rules or quality profiles. We’re pretty strict about addressing issues, so to have such a spike in one days is very jarring for our small team. Does SonarQube update rules in the default profiles behind the scenes? If so, how can I be notified of such changes?
SonarQube Server does not update rules behind the scenes. You have to have upgraded your SonarQube instance for the rules to suddenly become “smarter”. You can double check that your Quality Profile hasn’t changed by looking at the changelog.
A dear colleague just pointed out to me that you use SonarQube Cloud! Yes, rules are regularly updated, and may either find more issues (because the rules got smarter), or new rules could be added to the Quality Profile you use (if you use a built-in QP). You can still double check that your Quality Profile hasn’t changed by looking at the changelog.
If you come up short there, the below is still valid:
A likely culprit is a change to analysis scope. If you still have the scanner logs from previous runs, you can check to see if something like the number of files indexed has changed.
You can also check the Scanner Context for your background tasks and see if anything changed between the analyses
What are the code smells (which rules)? Could they have been influenced by some other change to the code?
I’ve looked into and checked those things, and I see nothing out of sorts. I ran a diff in the Scanner Context and the only change (besides a time stamp) was sonar.projectVersion=v8.33.0 changed to sonar.projectVersion=v8.34.0.
The new funky thing is, as of yesterday, all those other random issues have now gone away despite us not doing anything. This must have been some sort of bug or glitch in SonarQube that sorted itself out.
How can I determine which rules are newly included or not? If I filter by creation date, it only shows issues for new code, but if one of the issues we’re searching for is on code from years ago–I don’t know of a good way to find it.