Find deeply nested control flow statements

Proprietary

Marks the if, for, while, do, switch or try statement, or switch expression, that first nests deeper than three enclosing control flow statements. Only the statement that crosses the limit is marked, not the ones nested inside it, so each independently nested chain yields one result. An else if continues the nesting level of the if it belongs to instead of adding one, and is never marked itself; the resource list, catch clauses and finally block of a try sit at the try's own level rather than one deeper. Nesting is counted lexically over the whole file, so the body of a lambda, anonymous class or local class continues the count of the statements that enclose it rather than starting over. Test sources are not searched.

io.moderne.staticanalysis.FindDeeplyNestedControlFlow
mod run . --recipe=io.moderne.staticanalysis.FindDeeplyNestedControlFlow

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