Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8555e8c commit f675a14Copy full SHA for f675a14
1 file changed
ruby/ql/src/queries/variables/UninitializedLocal.ql
@@ -37,23 +37,12 @@ predicate isGuarded(LocalVariableReadAccess read) {
37
guard.getAstNode() = read.getVariable().getAnAccess() and
38
branch = true
39
or
40
- // guard is `!var`
41
- guard.getAstNode().(NotExpr).getOperand() = read.getVariable().getAnAccess() and
42
- branch = false
43
- or
44
// guard is `var.nil?`
45
exists(MethodCall c | guard.getAstNode() = c |
46
c.getReceiver() = read.getVariable().getAnAccess() and
47
c.getMethodName() = "nil?"
48
) and
49
branch = false
50
51
- // guard is `!var.nil?`
52
- exists(MethodCall c | guard.getAstNode().(NotExpr).getOperand() = c |
53
- c.getReceiver() = read.getVariable().getAnAccess() and
54
- c.getMethodName() = "nil?"
55
- ) and
56
- branch = true
57
)
58
}
59
0 commit comments