Skip to content

CAT 030

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-030 — keys.includes? → has_key?

Field Value
Severity info
Confidence high
Auto-fix

keys.includes? → has_key? — Use has_key? instead of .keys.includes? to check key existence without allocating an array.

Bad code

hash.keys.includes?(:foo)

Clone this wiki locally