CodeQL library for C#
codeql/csharp-all 3.1.1-dev (changelog, source)
Search

Predicate missedAllOpportunity

Holds if foreach statement fes could be converted to a .All() call. That is, the ForeachStmt contains a single if with a condition that accesses the loop variable and with a body that assigns false to a variable and breaks out of the foreach.

Import path

import Linq.Helpers
predicate missedAllOpportunity(ForeachStmtGenericEnumerable fes)