mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Ruby: Attempt to fix performance of AppCandidate
`DataFlow::MethodNode.getAReturningNode` is expensive to compute. Instead we look for rack responses which flow to the `SynthReturnNode`. Each method has only one of these (vs many "returning" nodes) so it is a lot faster. I'm not sure yet whether the results are the same.
This commit is contained in:
@@ -20,7 +20,7 @@ module Rack {
|
||||
AppCandidate() {
|
||||
call = this.getInstanceMethod("call") and
|
||||
call.getNumberOfParameters() = 1 and
|
||||
isRackResponse(call.getAReturningNode())
|
||||
exists(DataFlow::LocalSourceNode resp | isRackResponse(resp) | resp.flowsTo(call.getReturn()))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user