Ruby: Remove redundant .getExpr()

This commit is contained in:
Rasmus Wriedt Larsen
2022-08-23 15:41:15 +02:00
parent 717a355913
commit eccc7d6d6f
4 changed files with 3 additions and 13 deletions

View File

@@ -118,12 +118,7 @@ class CallNode extends LocalSourceNode, ExprNode {
.asExpr()
.(CfgNodes::ExprNodes::HashLiteralCfgNode)
.getAKeyValuePair() and
exprNode(pair.getKey())
.getALocalSource()
.asExpr()
.getExpr()
.getConstantValue()
.isStringlikeValue(name) and
exprNode(pair.getKey()).getALocalSource().asExpr().getConstantValue().isStringlikeValue(name) and
result.asExpr() = pair.getValue()
)
}

View File

@@ -87,7 +87,6 @@ class ExconHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNode
.getArgument(0)
.getALocalSource()
.asExpr()
.getExpr()
.getConstantValue()
.isStringlikeValue("ssl_verify_peer") and
disablingNode = disableCall.getArgument(1) and

View File

@@ -65,7 +65,7 @@ class FaradayHttpRequest extends HTTP::Client::Request::Range, DataFlow::CallNod
exists(CfgNodes::ExprNodes::PairCfgNode p, DataFlow::Node key |
p = sslValue.asExpr().(CfgNodes::ExprNodes::HashLiteralCfgNode).getAKeyValuePair() and
key.asExpr() = p.getKey() and
key.getALocalSource().asExpr().getExpr().getConstantValue().isStringlikeValue(argName) and
key.getALocalSource().asExpr().getConstantValue().isStringlikeValue(argName) and
result.asExpr() = p.getValue()
)
)

View File

@@ -86,11 +86,7 @@ class OpenUriKernelOpenRequest extends HTTP::Client::Request::Range, DataFlow::C
optionsNode.flowsTo(this.getArgument(any(int i | i > 0))) and
p = optionsNode.asExpr().(CfgNodes::ExprNodes::HashLiteralCfgNode).getAKeyValuePair() and
key.asExpr() = p.getKey() and
key.getALocalSource()
.asExpr()
.getExpr()
.getConstantValue()
.isStringlikeValue("ssl_verify_mode") and
key.getALocalSource().asExpr().getConstantValue().isStringlikeValue("ssl_verify_mode") and
result.asExpr() = p.getValue()
)
}