sonar-delphi
sonar-delphi copied to clipboard
Add ignore keyword list to CommentedOutCode
Prerequisites
- [X] This improvement has not already been suggested.
- [X] This improvement should not be implemented as a separate rule.
Rule to improve
CommentedOutCode
Improvement description
CommentedOutCode detects code in comments like:
foo.CheckCondition({var}param);
I'd like this {var} not to match with this rule.
Rationale
We often use {var} comment to indicate the 'param' may be chanegd. In this case, CheckCondition function is defined blow:
procedure CFoo.CheckCondition(var ACode: Integer);
begin
// do something
end;
On the other hand, this {var} may be a code to be detected. So, I wish I could add an Ignore-Keyword-List to CommentedOutCode rule.
{out} is also frequently used for the same reason.
A possible (simpler) alternative condition for exclusions from the rule would be a minimum comment length.
That's nice! I agree with the minimum comment length.