#endif Triggering "Remove the commented out code"

After upgrading to the latest SonarQube LTS, sonar is doing a better job finding commented out code! A little too much better in fact! Our code formatter adds comment tags after #endif for each preprocessor if/endif pair. Is there any way to (for example) exclude lines containing #endif from analysis? Thanks!

#if SOMETHING
...
#endif /* if (SOMETHING) */
  • SonarQube Developer Edition Version 8.9.2 (build 46101)
  • SonarScanner 4.6.2.2472
  • Sonar Build Wrapper 6.2

hello @JonPovirk,

This rule has many limitations, it needs redesigning. I suggest disabling it if it creates a lot of noise until we implement a better version.

Thanks,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.