Find bare as casts (unsafe)

Proprietary

A bare as cast throws ClassCastException on a mismatch — every cast is a runtime contract the compiler can't enforce. Where the result might legitimately be the wrong type, prefer as? (returning null) so the failure surfaces as a nullable handling decision rather than an exception.

org.openrewrite.kotlin.search.FindUnsafeCast$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.search.FindUnsafeCast$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.