mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Ruby: Weaken scopeNoFirst check
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import codeql.ruby.controlflow.internal.ControlFlowGraphImpl::Consistency
|
import codeql.ruby.controlflow.internal.ControlFlowGraphImpl::Consistency as Consistency
|
||||||
|
import Consistency
|
||||||
import codeql.ruby.AST
|
import codeql.ruby.AST
|
||||||
import codeql.ruby.CFG
|
import codeql.ruby.CFG
|
||||||
import codeql.ruby.controlflow.internal.Completion
|
import codeql.ruby.controlflow.internal.Completion
|
||||||
@@ -19,3 +20,14 @@ query predicate nonPostOrderExpr(Expr e, string cls) {
|
|||||||
c instanceof NormalCompletion
|
c instanceof NormalCompletion
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
query predicate scopeNoFirst(CfgScope scope) {
|
||||||
|
Consistency::scopeNoFirst(scope) and
|
||||||
|
not scope = any(StmtSequence seq | not exists(seq.getAStmt())) and
|
||||||
|
not scope =
|
||||||
|
any(Callable c |
|
||||||
|
not exists(c.getAParameter()) and
|
||||||
|
not c.(BodyStmt).hasEnsure() and
|
||||||
|
not exists(c.(BodyStmt).getARescue())
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user