Use Option safely

Proprietary

Finds calls to .get on Option values. Calling .get on Option can throw NoSuchElementException; prefer getOrElse, map, fold, or pattern matching.

org.openrewrite.scala.cleanup.UseOptionSafely
mod run . --recipe=org.openrewrite.scala.cleanup.UseOptionSafely

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