Pattern: Redundant nil check
Issue: -
This rule checks for non-nil checks, which are usually redundant. Non-nil checks are allowed if they are the final nodes of predicate.
# bad
if x != nil
# good (when not allowing semantic changes)
# bad (when allowing semantic changes)
if !x.nil?
# good (when allowing semantic changes)
if x
Attribute | Value |
---|---|
IncludeSemanticChanges | false |