You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Too many chained references - Ignore when using LINQ #15
Hmm. This is an interesting one, because it might be that you're using a custom SelectMany extension method from another namespace, or even a custom operator, DistinctIgnoringCase or something.
I wonder if there's a good way to generalise this? Perhaps extend the check for "fluent" interfaces, where it doesn't count methods that return the same type that's passed in, e.g. IEnumerable<T>. It would need to ignore the actual type of T, for things like Select((string s) => s.Length, which would start as IEnumerable<string> and return IEnumerable<int>.
That would mean the chained LINQ methods are ignored, but if you have too many chained references after standard LINQ, they'd be marked as smelly code.
I think the inspection for "Too many chained references " should ignore anything in the LINQ namespace.