Skip to content

CAT 012

unurgunite edited this page Jul 11, 2026 · 3 revisions

CAT-012 — JSON.parse → Serializable

Severity: infoConfidence: lowAuto-fix:

Caution

Low confidence rule — may produce false positives.

Description

JSON.parse → Serializable — Using JSON.parse returns untyped JSON::Any. Use JSON::Serializable for typed, efficient deserialization.

Bad code

json = JSON.parse(raw)
name = json["name"].as_s

Benchmark

Note

See bench results at bench/cat-012/

Clone this wiki locally