@@ -16,13 +16,9 @@ private import codeql.ruby.dataflow.RemoteFlowSources
16
16
* Extend this class to refine existing API models. If you want to model new APIs,
17
17
* extend `SqlExecution::Range` instead.
18
18
*/
19
- class SqlExecution extends DataFlow:: Node {
20
- SqlExecution:: Range range ;
21
-
22
- SqlExecution ( ) { this = range }
23
-
19
+ class SqlExecution extends DataFlow:: Node instanceof SqlExecution:: Range {
24
20
/** Gets the argument that specifies the SQL statements to be executed. */
25
- DataFlow:: Node getSql ( ) { result = range .getSql ( ) }
21
+ DataFlow:: Node getSql ( ) { result = super .getSql ( ) }
26
22
}
27
23
28
24
/** Provides a class for modeling new SQL execution APIs. */
@@ -46,26 +42,23 @@ module SqlExecution {
46
42
* Extend this class to refine existing API models. If you want to model new APIs,
47
43
* extend `Escaping::Range` instead.
48
44
*/
49
- class Escaping extends DataFlow:: Node {
50
- Escaping:: Range range ;
51
-
45
+ class Escaping extends DataFlow:: Node instanceof Escaping:: Range {
52
46
Escaping ( ) {
53
- this = range and
54
47
// escapes that don't have _both_ input/output defined are not valid
55
- exists ( range .getAnInput ( ) ) and
56
- exists ( range .getOutput ( ) )
48
+ exists ( super .getAnInput ( ) ) and
49
+ exists ( super .getOutput ( ) )
57
50
}
58
51
59
52
/** Gets an input that will be escaped. */
60
- DataFlow:: Node getAnInput ( ) { result = range .getAnInput ( ) }
53
+ DataFlow:: Node getAnInput ( ) { result = super .getAnInput ( ) }
61
54
62
55
/** Gets the output that contains the escaped data. */
63
- DataFlow:: Node getOutput ( ) { result = range .getOutput ( ) }
56
+ DataFlow:: Node getOutput ( ) { result = super .getOutput ( ) }
64
57
65
58
/**
66
59
* Gets the context that this function escapes for, such as `html`, or `url`.
67
60
*/
68
- string getKind ( ) { result = range .getKind ( ) }
61
+ string getKind ( ) { result = super .getKind ( ) }
69
62
}
70
63
71
64
/** Provides a class for modeling new escaping APIs. */
@@ -103,7 +96,7 @@ module Escaping {
103
96
* `<p>{}</p>`.
104
97
*/
105
98
class HtmlEscaping extends Escaping {
106
- HtmlEscaping ( ) { range .getKind ( ) = Escaping:: getHtmlKind ( ) }
99
+ HtmlEscaping ( ) { super .getKind ( ) = Escaping:: getHtmlKind ( ) }
107
100
}
108
101
109
102
/** Provides classes for modeling HTTP-related APIs. */
@@ -116,29 +109,25 @@ module HTTP {
116
109
* Extend this class to refine existing API models. If you want to model new APIs,
117
110
* extend `RouteSetup::Range` instead.
118
111
*/
119
- class RouteSetup extends DataFlow:: Node {
120
- RouteSetup:: Range range ;
121
-
122
- RouteSetup ( ) { this = range }
123
-
112
+ class RouteSetup extends DataFlow:: Node instanceof RouteSetup:: Range {
124
113
/** Gets the URL pattern for this route, if it can be statically determined. */
125
- string getUrlPattern ( ) { result = range .getUrlPattern ( ) }
114
+ string getUrlPattern ( ) { result = super .getUrlPattern ( ) }
126
115
127
116
/**
128
117
* Gets a function that will handle incoming requests for this route, if any.
129
118
*
130
119
* NOTE: This will be modified in the near future to have a `RequestHandler` result, instead of a `Method`.
131
120
*/
132
- Method getARequestHandler ( ) { result = range .getARequestHandler ( ) }
121
+ Method getARequestHandler ( ) { result = super .getARequestHandler ( ) }
133
122
134
123
/**
135
124
* Gets a parameter that will receive parts of the url when handling incoming
136
125
* requests for this route, if any. These automatically become a `RemoteFlowSource`.
137
126
*/
138
- Parameter getARoutedParameter ( ) { result = range .getARoutedParameter ( ) }
127
+ Parameter getARoutedParameter ( ) { result = super .getARoutedParameter ( ) }
139
128
140
129
/** Gets a string that identifies the framework used for this route setup. */
141
- string getFramework ( ) { result = range .getFramework ( ) }
130
+ string getFramework ( ) { result = super .getFramework ( ) }
142
131
}
143
132
144
133
/** Provides a class for modeling new HTTP routing APIs. */
@@ -185,19 +174,15 @@ module HTTP {
185
174
* Extend this class to refine existing API models. If you want to model new APIs,
186
175
* extend `RequestHandler::Range` instead.
187
176
*/
188
- class RequestHandler extends Method {
189
- RequestHandler:: Range range ;
190
-
191
- RequestHandler ( ) { this = range }
192
-
177
+ class RequestHandler extends Method instanceof RequestHandler:: Range {
193
178
/**
194
179
* Gets a parameter that could receive parts of the url when handling incoming
195
180
* requests, if any. These automatically become a `RemoteFlowSource`.
196
181
*/
197
- Parameter getARoutedParameter ( ) { result = range .getARoutedParameter ( ) }
182
+ Parameter getARoutedParameter ( ) { result = super .getARoutedParameter ( ) }
198
183
199
184
/** Gets a string that identifies the framework used for this route setup. */
200
- string getFramework ( ) { result = range .getFramework ( ) }
185
+ string getFramework ( ) { result = super .getFramework ( ) }
201
186
}
202
187
203
188
/** Provides a class for modeling new HTTP request handlers. */
@@ -253,16 +238,12 @@ module HTTP {
253
238
* Extend this class to refine existing API models. If you want to model new APIs,
254
239
* extend `HttpResponse::Range` instead.
255
240
*/
256
- class HttpResponse extends DataFlow:: Node {
257
- HttpResponse:: Range range ;
258
-
259
- HttpResponse ( ) { this = range }
260
-
241
+ class HttpResponse extends DataFlow:: Node instanceof HttpResponse:: Range {
261
242
/** Gets the data-flow node that specifies the body of this HTTP response. */
262
- DataFlow:: Node getBody ( ) { result = range .getBody ( ) }
243
+ DataFlow:: Node getBody ( ) { result = super .getBody ( ) }
263
244
264
245
/** Gets the mimetype of this HTTP response, if it can be statically determined. */
265
- string getMimetype ( ) { result = range .getMimetype ( ) }
246
+ string getMimetype ( ) { result = super .getMimetype ( ) }
266
247
}
267
248
268
249
/** Provides a class for modeling new HTTP response APIs. */
@@ -308,13 +289,9 @@ module HTTP {
308
289
* Extend this class to refine existing API models. If you want to model new APIs,
309
290
* extend `HttpRedirectResponse::Range` instead.
310
291
*/
311
- class HttpRedirectResponse extends HttpResponse {
312
- override HttpRedirectResponse:: Range range ;
313
-
314
- HttpRedirectResponse ( ) { this = range }
315
-
292
+ class HttpRedirectResponse extends HttpResponse instanceof HttpRedirectResponse:: Range {
316
293
/** Gets the data-flow node that specifies the location of this HTTP redirect response. */
317
- DataFlow:: Node getRedirectLocation ( ) { result = range .getRedirectLocation ( ) }
294
+ DataFlow:: Node getRedirectLocation ( ) { result = super .getRedirectLocation ( ) }
318
295
}
319
296
320
297
/** Provides a class for modeling new HTTP redirect response APIs. */
0 commit comments