@@ -8,6 +8,7 @@ private import codeql.ruby.dataflow.internal.FlowSummaryImplSpecific
88private import codeql.ruby.frameworks.core.Gem
99private import codeql.ruby.frameworks.data.ModelsAsData
1010private import codeql.ruby.frameworks.data.internal.ApiGraphModelsExtensions
11+ private import queries.modeling.internal.Util as Util
1112
1213/** Holds if the given callable is not worth supporting. */
1314private predicate isUninteresting ( DataFlow:: MethodNode c ) {
@@ -130,12 +131,10 @@ class TestFile extends File {
130131 */
131132class SinkCallable extends DataFlow:: MethodNode {
132133 SinkCallable ( ) {
133- this = ModelOutput:: getASinkNode ( _) .asCallable ( ) and
134- exists ( string type , string path , string kind , string method |
135- sinkModel ( type , path , kind ) and
136- path = "Method[" + method + "]" and
137- method = this .getMethodName ( )
138- // TODO: (type, path) corresponds to this method
134+ exists ( string type , string path , string method |
135+ method = path .regexpCapture ( "(Method\\[[^\\]]+\\]).*" , 1 ) and
136+ Util:: pathToMethod ( this , type , method ) and
137+ sinkModel ( type , path , _)
139138 )
140139 }
141140}
@@ -144,7 +143,13 @@ class SinkCallable extends DataFlow::MethodNode {
144143 * A callable where there exists a MaD source model that applies to it.
145144 */
146145class SourceCallable extends DataFlow:: CallableNode {
147- SourceCallable ( ) { sourceElement ( this .asExpr ( ) .getExpr ( ) , _, _, _) }
146+ SourceCallable ( ) {
147+ exists ( string type , string path , string method |
148+ method = path .regexpCapture ( "(Method\\[[^\\]]+\\]).*" , 1 ) and
149+ Util:: pathToMethod ( this , type , method ) and
150+ sinkModel ( type , path , _)
151+ )
152+ }
148153}
149154
150155/**
0 commit comments