Find non-case labels in switch statements

MSAL

Marks statement labels placed directly among the case labels of a switch. Such a label is often a case with a missing keyword, which compiles but never matches, or a labeled loop whose break is easily misread as leaving the switch. Labels nested in a block or statement within a case are not marked. Review these before running RemoveUnusedLabels, which would remove unused ones.

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

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