indexOf() replaceable by contains()
MSALChecking if a value is included in a String or List using indexOf(value)>-1 or indexOf(value)>=0 can be replaced with contains(value). Using contains() expresses the intent more directly and avoids the mental overhead of interpreting index comparisons.
org. openrewrite. staticanalysis. IndexOfReplaceableByContainsmod run . --recipe= org. openrewrite. staticanalysis. IndexOfReplaceableByContainsInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.