ACR Rules

⌘K
  1. Home
  2. Docs
  3. ACR Rules
  4. Reliability (41)
  5. Variables should not be indirectly compared to empty

Variables should not be indirectly compared to empty

This is likely a bug. If an object, variable or attribute is guaranteed to be empty then it does not make a lot of sense to compare against it. Use an explicit empty instead.

Noncompliant example:

if $Object = empty and $Object/Attribute = $Var
then 'A'
else 'B'

Compliant example:

if $Object = empty or $Object/Attribute = $Var
then 'A'
else 'B'