sonar-delphi icon indicating copy to clipboard operation
sonar-delphi copied to clipboard

`VariableInitialization` rule should treat `out` parameters as uninitialized

Open Cirras opened this issue 1 year ago • 0 comments

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).

Cirras avatar Dec 12 '23 01:12 Cirras