Prefer while over for loops

MSAL

When only the condition expression is defined in a for loop, and the initialization and increment expressions are missing, a while loop should be used instead to increase readability. A for loop with empty init and update sections signals iteration mechanics that do not exist, whereas while clearly communicates a simple conditional loop.

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

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