Issues Count for "// NOSONAR" comments always falsely shown as 0

Hi,

We are currently using SonarQube 10.2.
We found an issue with “// NOSONAR” rules in Rules.
The issue count for C language is always being shown as 0.
Below is how it looks like in the Rules page:

Issues([0]
No issues were detected for this rule in the main project branches.

Is the issue count really working?
We have done physical count and there are at least a few hundreds of LOC with that comment.

Thanks and Regards.
HS

Hi, any updates to this question?

Hey there.

This rule is not activated in the default Sonar Way Quality Profile. You may want to create a new Quality Profile with it turned on, apply it to your projects (or set it as the default), and run a new analysis of the main branch.

Hi Colin, I have already activated this rule in my quality profile, but it is still returning 0.

You’ll have to share some screenshots, a file where you can reproduce the issue, etc.

Hi Colin, thanks for your reply. Can I check what screenshots are you looking for? A screenshot where it shows that profile with the rule turn on and still returning (0)?

Hi Colin, any updates?

Thanks and Regards.
HS

A project where the rule is activated in the Quality Profile, but no issues are being raised on // NOSONAR.

That being said, I just came across this ticket: CPP-2049

It is super surprising to me that we haven’t handled this ticket in the 6 years since it was created. I will follow-up on that.

Hi Colin, sorry maybe I am not being clear. The comment “// NOSONAR” is working during the scanning of the codes. I am talking about the count in the Rules page, where it is always shown as “0”. Please see screenshot.

image

Hey @HSNG

Yes – you’re right. NOSONAR is working… in fact, it’s working so well that it removes S1291. That’s what the open ticket is for (CPP-2049)