Skip to content

CAT 014

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-014 — File.read → streaming

Field Value
Severity info
Confidence high
Auto-fix

File.read → streaming — Use File.each_line or block-based I/O instead of File.read for large files to avoid loading everything into memory.

Bad code

content = File.read("large.log")
content.each_line { |line| ... }

Good code

File.each_line("large.log") { |line| ... }

Clone this wiki locally