File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
ruby/ql/consistency-queries Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1- import codeql.ruby.controlflow.internal.ControlFlowGraphImpl:: Consistency
1+ import codeql.ruby.controlflow.internal.ControlFlowGraphImpl:: Consistency as Consistency
2+ import Consistency
23import codeql.ruby.AST
34import codeql.ruby.CFG
45import codeql.ruby.controlflow.internal.Completion
@@ -19,3 +20,14 @@ query predicate nonPostOrderExpr(Expr e, string cls) {
1920 c instanceof NormalCompletion
2021 )
2122}
23+
24+ query predicate scopeNoFirst ( CfgScope scope ) {
25+ Consistency:: scopeNoFirst ( scope ) and
26+ not scope = any ( StmtSequence seq | not exists ( seq .getAStmt ( ) ) ) and
27+ not scope =
28+ any ( Callable c |
29+ not exists ( c .getAParameter ( ) ) and
30+ not c .( BodyStmt ) .hasEnsure ( ) and
31+ not exists ( c .( BodyStmt ) .getARescue ( ) )
32+ )
33+ }
You can’t perform that action at this time.
0 commit comments