Inline variable

MSAL

Inline variables when they are immediately used to return or throw. Supports both variable declarations and assignments to local variables. A variable that is declared only to be returned or thrown on the very next line adds an unnecessary level of indirection without improving readability.

org.openrewrite.staticanalysis.InlineVariable
mod run . --recipe=org.openrewrite.staticanalysis.InlineVariable

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