Use indexOf(String, int)

MSAL

Replaces indexOf(String) in binary operations if the compared value is an int and not less than 1. Using the two-argument indexOf(String, int) form with a start position avoids redundantly scanning the beginning of the string when you already know the match must occur after a certain index.

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

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