switch statements should have at least 3 case clauses

MSAL

switch statements are useful when many code paths branch depending on the value of a single expression. For just one or two code paths, the code will be more readable with if statements. Using switch for trivial branching adds unnecessary syntactic overhead and obscures the simplicity of the logic.

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

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