robotframework-robocop icon indicating copy to clipboard operation
robotframework-robocop copied to clipboard

[Rule] Not all If branches define variable

Open bhirsz opened this issue 9 months ago • 1 comments

If new variable is set in If, it should be set in all branches:

 IF  ${True}
     ${var}  Set Variable  value
ELSE
     ${var}  Set Variable  other value 
END

bhirsz avatar Oct 07 '23 08:10 bhirsz

Only potential issue is global variable with default value that can be overwriten if one condition is true. But it is still better to be explicit and set it in every branch.

bhirsz avatar Oct 07 '23 08:10 bhirsz