mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
15 lines
241 B
Plaintext
15 lines
241 B
Plaintext
/**
|
|
* @name Test for well-formed foreachs
|
|
*/
|
|
|
|
import csharp
|
|
|
|
from Method m
|
|
where
|
|
m.getName() = "MainForeach" and
|
|
count(LocalVariable v |
|
|
v.getVariableDeclExpr().getEnclosingCallable() = m and
|
|
v.getName() = "s"
|
|
) = 1
|
|
select m
|