Find OrderBy applied to an ordered sequence

Proprietary

Find OrderBy or OrderByDescending called on the result of OrderBy, OrderByDescending, ThenBy or ThenByDescending. The last call becomes the primary sort key; LINQ to Objects keeps the earlier ordering only for ties, and query providers may ignore it. If a secondary key was intended, use ThenBy, which changes the result ordering, so review each occurrence.

OpenRewrite.Recipes.CSharp.CodeQuality.Linq.FindOrderByAfterOrderBy
mod run . --recipe=OpenRewrite.Recipes.CSharp.CodeQuality.Linq.FindOrderByAfterOrderBy

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