Query module BadMultipleIteration

name
Bad multiple iteration
description
Not every enumerable sequence is repeatable, so it is dangerous to write code that can consume elements of a sequence in more than one place.
kind
problem
problem.severity
warning
precision
medium
id
cs/linq/inconsistent-enumeration
tags
reliability maintainability language-features external/cwe/cwe-834

Imports

Helpers

Helpers.qll Provides helper classes and methods related to LINQ.

csharp

The default C# QL library.

Predicates

likelyNonRepeatableSequence

The enumerable sequence is likely not to be repeatable.

potentiallyConsumingAccess

An access to an enumerable sequence that potentially consumes sequence elements.

sequenceSource

The source of an enumerable sequence (an expression used to initialise it, or the right-hand side of an assignment to it).