Countung lines excluded from analysis

We are using SonarQube Server Developer Edition v2025.5.
Some of our developers are excluding lines using the comment nosonar. Some even exclude complete code blocks using the defined keywords
SONAR_EXCLUDE_START
SONAR_EXCLUDE_STOP
Does SonarQube in some way count the number of lines excluded from analysis

Hi,

While there is a rule for some languages to detect //NOSONAR usage, there’s no counting of excluded lines.

I think I can guess, but would you mind providing your use case for this?

 
Thx,
Ann

Hi,

The use case is quite simple, we want to know, if the feature is abused. So seeing the number of excluded lines growing rapidly would lead to a discussion with the developer, why she/he is using //nosonar instead of fixing the issues.

1 Like

Hi,

For //NOSONAR what language are we talking about? Because 12 different languages have rules to track that. Look for rule key S1291 or NoSonar.

 
Ann