switch statements should have at least 3 case clauses
MSALswitch 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. MinimumSwitchCasesmod run . --recipe= org. openrewrite. staticanalysis. MinimumSwitchCasesInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.