mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Ruby: simplify some charpreds
This commit is contained in:
@@ -127,7 +127,7 @@ abstract class ParamsCall extends MethodCall {
|
||||
* ActionController parameters available via the `params` method.
|
||||
*/
|
||||
class ParamsSource extends RemoteFlowSource::Range {
|
||||
ParamsSource() { exists(ParamsCall call | this.asExpr().getExpr() = call) }
|
||||
ParamsSource() { this.asExpr().getExpr() instanceof ParamsCall }
|
||||
|
||||
override string getSourceType() { result = "ActionController::Metal#params" }
|
||||
}
|
||||
@@ -144,7 +144,7 @@ abstract class CookiesCall extends MethodCall {
|
||||
* ActionController parameters available via the `cookies` method.
|
||||
*/
|
||||
class CookiesSource extends RemoteFlowSource::Range {
|
||||
CookiesSource() { exists(CookiesCall call | this.asExpr().getExpr() = call) }
|
||||
CookiesSource() { this.asExpr().getExpr() instanceof CookiesCall }
|
||||
|
||||
override string getSourceType() { result = "ActionController::Metal#cookies" }
|
||||
}
|
||||
|
||||
@@ -19,19 +19,14 @@ module Kernel {
|
||||
*/
|
||||
class KernelMethodCall extends DataFlow::CallNode {
|
||||
KernelMethodCall() {
|
||||
exists(MethodCall methodCall |
|
||||
methodCall = this.asExpr().getExpr() and
|
||||
(
|
||||
this = API::getTopLevelMember("Kernel").getAMethodCall(_)
|
||||
or
|
||||
methodCall instanceof UnknownMethodCall and
|
||||
(
|
||||
this.getReceiver().asExpr().getExpr() instanceof SelfVariableAccess and
|
||||
isPrivateKernelMethod(methodCall.getMethodName())
|
||||
or
|
||||
isPublicKernelMethod(methodCall.getMethodName())
|
||||
)
|
||||
)
|
||||
this = API::getTopLevelMember("Kernel").getAMethodCall(_)
|
||||
or
|
||||
this.asExpr().getExpr() instanceof UnknownMethodCall and
|
||||
(
|
||||
this.getReceiver().asExpr().getExpr() instanceof SelfVariableAccess and
|
||||
isPrivateKernelMethod(this.getMethodName())
|
||||
or
|
||||
isPublicKernelMethod(this.getMethodName())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user