2

Our organization is using SonarQube for managing code quality as well as Docco for handling production of documentation from code comments.

We're running into a conflict between including things like method names in comments for Docco and the 'Sections of Code should not be "commented out"' rule in SonarQube.

Are there any known best practices to get SonarQube to ignore code in comments that are for documentation (even better if for Docco in particular) while still catching old code that has been commented out instead of being removed?

Dale
  • 21
  • 3

2 Answers2

0

The rule "Sections of code should not be commented out" could be simply disabled in the quality profile related to your project.

Simon Brandhof
  • 5,137
  • 1
  • 21
  • 28
  • Simon, thanks for the response but we are still looking to catch commented out code but exclude catching commented code that is part of documentation. I'm hoping there some wrapper or something we can put around commented code we do want while still catching code that has been just commented out instead of removed. – Dale Jun 06 '15 at 17:19
0

sharing this as it could help if anyone having similar issue.

one way is to comment the code along with additional lines or single quote to ignore that line which worked for me

example

#  print("sample")

you can write this as

# ' print("sample")