sonar-delphi
sonar-delphi copied to clipboard
`VariableInitialization` rule should treat `out` parameters as uninitialized
Prerequisites
- [X] This improvement has not already been suggested.
- [X] This improvement should not be implemented as a separate rule.
Rule to improve
VariableInitialization
Improvement description
Current behavior
Routine parameters are currently always considered initialized at the start of a routine.
Suggested behavior
out
parameters should be considered uninitialized at the start of a routine.
Rationale
out
parameters are meant to be routine results, and should never be assumed to be initialized.
Indeed, if they are initialized then it's actually more of a smell (see #133).