Files
codeql/csharp/ql/test/library-tests/csharp9/global/globalStmt.ql
2021-12-10 10:42:29 +01:00

17 lines
508 B
Plaintext

import csharp
private import semmle.code.csharp.commons.Util
query predicate global_stmt(Stmt stmt) { stmt.isGlobal() }
query predicate globalBlock(BlockStmt block, Method m, Parameter p, Type t) {
block.isGlobalStatementContainer() and
block.getEnclosingCallable() = m and
m.getDeclaringType() = t and
m.getAParameter() = p
}
query predicate methods(Method m, string entry) {
m.getFile().getStem() = "GlobalStmt" and
if m instanceof MainMethod then entry = "entry" else entry = "non-entry"
}