Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2012 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3819157 to your computer and use it in GitHub Desktop.
Save anonymous/3819157 to your computer and use it in GitHub Desktop.
// <Name>Use List<T>.BugFreeSort() instead of List<T>.Sort()</Name>
warnif count > 0
let listSortMethods = ThirdParty.Methods
.WithFullNameWildcardMatch(@"System.Collections.Generic.List<T>.Sort*")
from m in Application.Methods.UsingAny(listSortMethods)
where m.ParentType.FullName != "NDepend.Helpers.Collections.ListSortExtensionMethods"
select new { m, sortMethodCalled = m.MethodsCalled.Intersect(listSortMethods) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment