@@ -8,6 +8,7 @@ private import codeql.ruby.dataflow.internal.FlowSummaryImplSpecific
8
8
private import codeql.ruby.frameworks.core.Gem
9
9
private import codeql.ruby.frameworks.data.ModelsAsData
10
10
private import codeql.ruby.frameworks.data.internal.ApiGraphModelsExtensions
11
+ private import queries.modeling.internal.Util as Util
11
12
12
13
/** Holds if the given callable is not worth supporting. */
13
14
private predicate isUninteresting ( DataFlow:: MethodNode c ) {
@@ -130,12 +131,10 @@ class TestFile extends File {
130
131
*/
131
132
class SinkCallable extends DataFlow:: MethodNode {
132
133
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 , _)
139
138
)
140
139
}
141
140
}
@@ -144,7 +143,13 @@ class SinkCallable extends DataFlow::MethodNode {
144
143
* A callable where there exists a MaD source model that applies to it.
145
144
*/
146
145
class 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
+ }
148
153
}
149
154
150
155
/**
0 commit comments