Closed Indigo744 closed 6 months ago
Hi @Indigo744, this SonarDelphi fork is no longer maintained and does not contain an EmptyBlock rule.
From the rule description (which I wrote!) it looks like you're using the actively maintained integrated-application-development/sonar-delphi (the version on the Sonar Marketplace). If you re-raise your issue on that repository, we can discuss this improvement there.
@fourls Indeed you're right! Sorry, I'll recreate there.
The EmptyBlock rule is currently defined as is:
I think the last exception can be made broader: any blocks that are empty apart from a comment.
Example that triggers a finding related to this rule, but should not:
This is the way other scanner are implementing this rule. And it makes sense! Comments are part of the code (and act as documentation).
For reference: https://sonarsource.github.io/rspec/#/rspec/S108/csharp