File tree 2 files changed +32
-2
lines changed
javascript/ql/lib/semmle/javascript/frameworks/data/internal
python/ql/lib/semmle/python/frameworks/data/internal
2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -164,14 +164,27 @@ module ModelInput {
164
164
class TypeModel extends Unit {
165
165
/**
166
166
* Gets a data-flow node that is a source of the type `package;type`.
167
+ *
168
+ * This must not depend on API graphs, but ensures that an API node is generated for
169
+ * the source.
167
170
*/
168
171
DataFlow:: Node getASource ( string package , string type ) { none ( ) }
169
172
170
173
/**
171
- * Gets a data flow node that is a sink of the type `package;type`,
174
+ * Gets a data- flow node that is a sink of the type `package;type`,
172
175
* usually because it is an argument passed to a parameter of that type.
176
+ *
177
+ * This must not depend on API graphs, but ensures that an API node is generated for
178
+ * the sink.
173
179
*/
174
180
DataFlow:: Node getASink ( string package , string type ) { none ( ) }
181
+
182
+ /**
183
+ * Gets an API node that is a source or sink of the type `package;type`.
184
+ *
185
+ * Unlike `getASource` and `getASink`, this may depend on API graphs.
186
+ */
187
+ API:: Node getAnApiNode ( string package , string type ) { none ( ) }
175
188
}
176
189
177
190
/**
@@ -434,6 +447,8 @@ private API::Node getNodeFromType(string package, string type) {
434
447
or
435
448
result = any ( TypeModelDefEntry e ) .getNodeForType ( package , type )
436
449
or
450
+ result = any ( TypeModel t ) .getAnApiNode ( package , type )
451
+ or
437
452
result = Specific:: getExtraNodeFromType ( package , type )
438
453
}
439
454
Original file line number Diff line number Diff line change @@ -164,14 +164,27 @@ module ModelInput {
164
164
class TypeModel extends Unit {
165
165
/**
166
166
* Gets a data-flow node that is a source of the type `package;type`.
167
+ *
168
+ * This must not depend on API graphs, but ensures that an API node is generated for
169
+ * the source.
167
170
*/
168
171
DataFlow:: Node getASource ( string package , string type ) { none ( ) }
169
172
170
173
/**
171
- * Gets a data flow node that is a sink of the type `package;type`,
174
+ * Gets a data- flow node that is a sink of the type `package;type`,
172
175
* usually because it is an argument passed to a parameter of that type.
176
+ *
177
+ * This must not depend on API graphs, but ensures that an API node is generated for
178
+ * the sink.
173
179
*/
174
180
DataFlow:: Node getASink ( string package , string type ) { none ( ) }
181
+
182
+ /**
183
+ * Gets an API node that is a source or sink of the type `package;type`.
184
+ *
185
+ * Unlike `getASource` and `getASink`, this may depend on API graphs.
186
+ */
187
+ API:: Node getAnApiNode ( string package , string type ) { none ( ) }
175
188
}
176
189
177
190
/**
@@ -434,6 +447,8 @@ private API::Node getNodeFromType(string package, string type) {
434
447
or
435
448
result = any ( TypeModelDefEntry e ) .getNodeForType ( package , type )
436
449
or
450
+ result = any ( TypeModel t ) .getAnApiNode ( package , type )
451
+ or
437
452
result = Specific:: getExtraNodeFromType ( package , type )
438
453
}
439
454
You can’t perform that action at this time.
0 commit comments