Why this matters
Prevents NoMethodError from nil and clarifies fallbacks.
Use `&.` and presence/|| to safely traverse possibly-nil chains and provide defaults.
Prevents NoMethodError from nil and clarifies fallbacks.
Side-by-side examples engineers can pattern-match during review.
city = user.address.city.downcasecity = user&.address&.city&.downcase || "unknown"obj.child.valueobj&.child&.value || defaultFrom the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.