Branches with identical implementations should be merged

MSAL

When two consecutive branches of an if/else if chain execute the same code, they can be merged by combining their conditions with ||. This removes duplication and makes the intent clearer.

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

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