After upgrading from SonarQube 8.9.5 to 9.3.0 we faced some issues of common-cs:InsufficientCommentDensity as issue on new code even the code was not changed for years.
The recent change was made in 2018.
The Quality Profile was recently changed on 10th march.
So, there is no correlation between change of QP and the issue date.
It is related to the date of SQ 9.3 installation.
I know this looks dormant, but we haven’t forgotten about it. Discussions have ensued behind the scenes.
In the meantime, I’ve just had another thought. The issue you’re highlighting is raised at file level, not on a particular line. Can you check the history on this file and see if comments were deleted recently?
Did you see it happen seldom or rather often, on many files?
Did it happen only on specific projects / files or there isn’t an obvious pattern from this point of view?
Did you change anything else on the CI machines between the 8.9.5 and 9.3.0 scans (e.g. version of msbuild being used)? If the C# compiler versions changes, there might be different behaviors.
This issue might happen either if:
the computed measures for the files has changed between SonarQube versions (for example, a different measure of “lines of code” and “comments”), and SonarQube failed to “backdate” the issue (detect that there was no change on the file and ignore the newly raised issue)
if no measure has changed, then something else inside SonarQube has changed which triggered this issue
We did make some changes around counting lines of code between these SQ versions around C# 9 support, however I doubt this would have affected files from 2018. So, in short, what you experienced is unexpected.
I’ll do some tests and analyze a project with 8.9.5 and 9.3.0 and see if the LOC measures of the files in the project had any change and come back here.