mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
Ruby: Add getBlock and getNumberOfArguments predicates to DataFlow::CallNode
This commit is contained in:
@@ -61,6 +61,12 @@ class CallNode extends LocalSourceNode {
|
||||
|
||||
/** Gets the name of the the method called by the method call (if any) corresponding to this data-flow node */
|
||||
string getMethodName() { result = node.getExpr().(MethodCall).getMethodName() }
|
||||
|
||||
/** Gets the number of arguments of this call. */
|
||||
int getNumberOfArguments() { result = node.getNumberOfArguments() }
|
||||
|
||||
/** Gets the block of this call. */
|
||||
Node getBlock() { result.asExpr() = node.getBlock() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -84,8 +84,6 @@ private class CallAgainstConfig extends DataFlow::CallNode {
|
||||
CallAgainstConfig() { this.getReceiver() instanceof ConfigNode }
|
||||
|
||||
MethodCall getCall() { result = this.asExpr().getExpr() }
|
||||
|
||||
Block getBlock() { result = this.getCall().getBlock() }
|
||||
}
|
||||
|
||||
private class ActionControllerConfigNode extends DataFlow::Node {
|
||||
|
||||
@@ -26,8 +26,6 @@ class KernelMethodCall extends DataFlow::CallNode {
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
int getNumberOfArguments() { result = methodCall.getNumberOfArguments() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user