C/C++ False-positive: “Remove the commented out code.”

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube Enterprise Edition Version 9.9 (build 65466)
  • how is SonarQube deployed: zip, Docker, Helm
    Not sure, separate server
  • what are you trying to achieve
    I want to add https links in my documentation with the following style:
/* 
* {*XXX/XXX/XXXXX} 
* | https://XXX.XXX.nl/XXX/.
*/

but this throws the violation: “Remove the commented out code.”. I think this violation is not necessary here, since a https link should be fine.

  • what have you tried so far to achieve this
    I have not tried to change the code under test, as that is standardized.

Hi @abemat,

This rule uses heuristics that aren’t perfect. It gets it right most of the time. When it doesn’t you should simply mark it as a false-positive in the UI.

For example, if you use parentheses instead of curly braces the issue disappears.
You can check it out here.

Thanks,

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