@@ -16,16 +16,12 @@ import semmle.go.concepts.GeneratedFile
16
16
* Extend this class to refine existing API models. If you want to model new APIs,
17
17
* extend `SystemCommandExecution::Range` instead.
18
18
*/
19
- class SystemCommandExecution extends DataFlow:: Node {
20
- SystemCommandExecution:: Range self ;
21
-
22
- SystemCommandExecution ( ) { this = self }
23
-
19
+ class SystemCommandExecution extends DataFlow:: Node instanceof SystemCommandExecution:: Range {
24
20
/** Gets the argument that specifies the command to be executed. */
25
- DataFlow:: Node getCommandName ( ) { result = self .getCommandName ( ) }
21
+ DataFlow:: Node getCommandName ( ) { result = super .getCommandName ( ) }
26
22
27
23
/** Holds if this node is sanitized whenever it follows `--` in an argument list. */
28
- predicate doubleDashIsSanitizing ( ) { self .doubleDashIsSanitizing ( ) }
24
+ predicate doubleDashIsSanitizing ( ) { super .doubleDashIsSanitizing ( ) }
29
25
}
30
26
31
27
/** Provides a class for modeling new system-command execution APIs. */
@@ -52,22 +48,18 @@ module SystemCommandExecution {
52
48
* Extend this class to refine existing API models. If you want to model new APIs,
53
49
* extend `TemplateInstantiation::Range` instead.
54
50
*/
55
- class TemplateInstantiation extends DataFlow:: Node {
56
- TemplateInstantiation:: Range self ;
57
-
58
- TemplateInstantiation ( ) { this = self }
59
-
51
+ class TemplateInstantiation extends DataFlow:: Node instanceof TemplateInstantiation:: Range {
60
52
/**
61
53
* Gets the argument to this template instantiation that is the template being
62
54
* instantiated.
63
55
*/
64
- DataFlow:: Node getTemplateArgument ( ) { result = self .getTemplateArgument ( ) }
56
+ DataFlow:: Node getTemplateArgument ( ) { result = super .getTemplateArgument ( ) }
65
57
66
58
/**
67
59
* Gets an argument to this template instantiation that is data being inserted
68
60
* into the template.
69
61
*/
70
- DataFlow:: Node getADataArgument ( ) { result = self .getADataArgument ( ) }
62
+ DataFlow:: Node getADataArgument ( ) { result = super .getADataArgument ( ) }
71
63
}
72
64
73
65
/** Provides a class for modeling new template-instantiation APIs. */
@@ -100,13 +92,9 @@ module TemplateInstantiation {
100
92
* Extend this class to refine existing API models. If you want to model new APIs,
101
93
* extend `FileSystemAccess::Range` instead.
102
94
*/
103
- class FileSystemAccess extends DataFlow:: Node {
104
- FileSystemAccess:: Range self ;
105
-
106
- FileSystemAccess ( ) { this = self }
107
-
95
+ class FileSystemAccess extends DataFlow:: Node instanceof FileSystemAccess:: Range {
108
96
/** Gets an argument to this file system access that is interpreted as a path. */
109
- DataFlow:: Node getAPathArgument ( ) { result = self .getAPathArgument ( ) }
97
+ DataFlow:: Node getAPathArgument ( ) { result = super .getAPathArgument ( ) }
110
98
}
111
99
112
100
/** Provides a class for modeling new file-system access APIs. */
@@ -125,17 +113,13 @@ module FileSystemAccess {
125
113
}
126
114
127
115
/** A function that escapes meta-characters to prevent injection attacks. */
128
- class EscapeFunction extends Function {
129
- EscapeFunction:: Range self ;
130
-
131
- EscapeFunction ( ) { this = self }
132
-
116
+ class EscapeFunction extends Function instanceof EscapeFunction:: Range {
133
117
/**
134
118
* The context that this function escapes for.
135
119
*
136
120
* Currently, this can be "js", "html", or "url".
137
121
*/
138
- string kind ( ) { result = self .kind ( ) }
122
+ string kind ( ) { result = super .kind ( ) }
139
123
}
140
124
141
125
/** Provides a class for modeling new escape-function APIs. */
@@ -161,7 +145,7 @@ module EscapeFunction {
161
145
* JavaScript string literal.
162
146
*/
163
147
class JsEscapeFunction extends EscapeFunction {
164
- JsEscapeFunction ( ) { self .kind ( ) = "js" }
148
+ JsEscapeFunction ( ) { super .kind ( ) = "js" }
165
149
}
166
150
167
151
/**
@@ -170,15 +154,15 @@ class JsEscapeFunction extends EscapeFunction {
170
154
* `<p>{}</p>`.
171
155
*/
172
156
class HtmlEscapeFunction extends EscapeFunction {
173
- HtmlEscapeFunction ( ) { self .kind ( ) = "html" }
157
+ HtmlEscapeFunction ( ) { super .kind ( ) = "html" }
174
158
}
175
159
176
160
/**
177
161
* A function that escapes a string so it can be safely included as part
178
162
* of a URL.
179
163
*/
180
164
class UrlEscapeFunction extends EscapeFunction {
181
- UrlEscapeFunction ( ) { self .kind ( ) = "url" }
165
+ UrlEscapeFunction ( ) { super .kind ( ) = "url" }
182
166
}
183
167
184
168
/**
@@ -187,27 +171,23 @@ class UrlEscapeFunction extends EscapeFunction {
187
171
* Extend this class to refine existing API models. If you want to model new APIs,
188
172
* extend `RegexpPattern::Range` instead.
189
173
*/
190
- class RegexpPattern extends DataFlow:: Node {
191
- RegexpPattern:: Range self ;
192
-
193
- RegexpPattern ( ) { this = self }
194
-
174
+ class RegexpPattern extends DataFlow:: Node instanceof RegexpPattern:: Range {
195
175
/**
196
176
* Gets the node where this pattern is parsed as a part of a regular
197
177
* expression.
198
178
*/
199
- DataFlow:: Node getAParse ( ) { result = self .getAParse ( ) }
179
+ DataFlow:: Node getAParse ( ) { result = super .getAParse ( ) }
200
180
201
181
/**
202
182
* Gets this regexp pattern as a string.
203
183
*/
204
- string getPattern ( ) { result = self .getPattern ( ) }
184
+ string getPattern ( ) { result = super .getPattern ( ) }
205
185
206
186
/**
207
187
* Gets a use of this pattern, either as itself in an argument to a function or as a compiled
208
188
* regexp object.
209
189
*/
210
- DataFlow:: Node getAUse ( ) { result = self .getAUse ( ) }
190
+ DataFlow:: Node getAUse ( ) { result = super .getAUse ( ) }
211
191
}
212
192
213
193
/** Provides a class for modeling new regular-expression APIs. */
@@ -244,15 +224,11 @@ module RegexpPattern {
244
224
* Extend this class to refine existing API models. If you want to model new APIs,
245
225
* extend `RegexpMatchFunction::Range` instead.
246
226
*/
247
- class RegexpMatchFunction extends Function {
248
- RegexpMatchFunction:: Range self ;
249
-
250
- RegexpMatchFunction ( ) { this = self }
251
-
227
+ class RegexpMatchFunction extends Function instanceof RegexpMatchFunction:: Range {
252
228
/**
253
229
* Gets the function input that is the regexp being matched.
254
230
*/
255
- FunctionInput getRegexpArg ( ) { result = self .getRegexpArg ( ) }
231
+ FunctionInput getRegexpArg ( ) { result = super .getRegexpArg ( ) }
256
232
257
233
/**
258
234
* Gets the regexp pattern that is used in the call to this function `call`.
@@ -264,12 +240,12 @@ class RegexpMatchFunction extends Function {
264
240
/**
265
241
* Gets the function input that is the string being matched against.
266
242
*/
267
- FunctionInput getValue ( ) { result = self .getValue ( ) }
243
+ FunctionInput getValue ( ) { result = super .getValue ( ) }
268
244
269
245
/**
270
246
* Gets the function output that is the Boolean result of the match function.
271
247
*/
272
- FunctionOutput getResult ( ) { result = self .getResult ( ) }
248
+ FunctionOutput getResult ( ) { result = super .getResult ( ) }
273
249
}
274
250
275
251
/** Provides a class for modeling new regular-expression matcher APIs. */
@@ -304,15 +280,11 @@ module RegexpMatchFunction {
304
280
* Extend this class to refine existing API models. If you want to model new APIs,
305
281
* extend `RegexpReplaceFunction::Range` instead.
306
282
*/
307
- class RegexpReplaceFunction extends Function {
308
- RegexpReplaceFunction:: Range self ;
309
-
310
- RegexpReplaceFunction ( ) { this = self }
311
-
283
+ class RegexpReplaceFunction extends Function instanceof RegexpReplaceFunction:: Range {
312
284
/**
313
285
* Gets the function input that is the regexp that matches text to replace.
314
286
*/
315
- FunctionInput getRegexpArg ( ) { result = self .getRegexpArg ( ) }
287
+ FunctionInput getRegexpArg ( ) { result = super .getRegexpArg ( ) }
316
288
317
289
/**
318
290
* Gets the regexp pattern that is used to match patterns to replace in the call to this function
@@ -326,13 +298,13 @@ class RegexpReplaceFunction extends Function {
326
298
* Gets the function input corresponding to the source value, that is, the value that is having
327
299
* its contents replaced.
328
300
*/
329
- FunctionInput getSource ( ) { result = self .getSource ( ) }
301
+ FunctionInput getSource ( ) { result = super .getSource ( ) }
330
302
331
303
/**
332
304
* Gets the function output corresponding to the result, that is, the value after replacement has
333
305
* occurred.
334
306
*/
335
- FunctionOutput getResult ( ) { result = self .getResult ( ) }
307
+ FunctionOutput getResult ( ) { result = super .getResult ( ) }
336
308
}
337
309
338
310
/** Provides a class for modeling new regular-expression replacer APIs. */
@@ -369,13 +341,9 @@ module RegexpReplaceFunction {
369
341
* Extend this class to refine existing API models. If you want to model new APIs,
370
342
* extend `LoggerCall::Range` instead.
371
343
*/
372
- class LoggerCall extends DataFlow:: Node {
373
- LoggerCall:: Range self ;
374
-
375
- LoggerCall ( ) { this = self }
376
-
344
+ class LoggerCall extends DataFlow:: Node instanceof LoggerCall:: Range {
377
345
/** Gets a node that is a part of the logged message. */
378
- DataFlow:: Node getAMessageComponent ( ) { result = self .getAMessageComponent ( ) }
346
+ DataFlow:: Node getAMessageComponent ( ) { result = super .getAMessageComponent ( ) }
379
347
}
380
348
381
349
/** Provides a class for modeling new logging APIs. */
@@ -398,19 +366,15 @@ module LoggerCall {
398
366
* Extend this class to refine existing API models. If you want to model new APIs,
399
367
* extend `MarshalingFunction::Range` instead.
400
368
*/
401
- class MarshalingFunction extends Function {
402
- MarshalingFunction:: Range self ;
403
-
404
- MarshalingFunction ( ) { this = self }
405
-
369
+ class MarshalingFunction extends Function instanceof MarshalingFunction:: Range {
406
370
/** Gets an input that is encoded by this function. */
407
- FunctionInput getAnInput ( ) { result = self .getAnInput ( ) }
371
+ FunctionInput getAnInput ( ) { result = super .getAnInput ( ) }
408
372
409
373
/** Gets the output that contains the encoded data produced by this function. */
410
- FunctionOutput getOutput ( ) { result = self .getOutput ( ) }
374
+ FunctionOutput getOutput ( ) { result = super .getOutput ( ) }
411
375
412
376
/** Gets an identifier for the format this function encodes into, such as "JSON". */
413
- string getFormat ( ) { result = self .getFormat ( ) }
377
+ string getFormat ( ) { result = super .getFormat ( ) }
414
378
}
415
379
416
380
/** Provides a class for modeling new marshaling APIs. */
@@ -439,19 +403,15 @@ module MarshalingFunction {
439
403
* Extend this class to refine existing API models. If you want to model new APIs,
440
404
* extend `UnmarshalingFunction::Range` instead.
441
405
*/
442
- class UnmarshalingFunction extends Function {
443
- UnmarshalingFunction:: Range self ;
444
-
445
- UnmarshalingFunction ( ) { this = self }
446
-
406
+ class UnmarshalingFunction extends Function instanceof UnmarshalingFunction:: Range {
447
407
/** Gets an input that is decoded by this function. */
448
- FunctionInput getAnInput ( ) { result = self .getAnInput ( ) }
408
+ FunctionInput getAnInput ( ) { result = super .getAnInput ( ) }
449
409
450
410
/** Gets the output that contains the decoded data produced by this function. */
451
- FunctionOutput getOutput ( ) { result = self .getOutput ( ) }
411
+ FunctionOutput getOutput ( ) { result = super .getOutput ( ) }
452
412
453
413
/** Gets an identifier for the format this function decodes from, such as "JSON". */
454
- string getFormat ( ) { result = self .getFormat ( ) }
414
+ string getFormat ( ) { result = super .getFormat ( ) }
455
415
}
456
416
457
417
/** Provides a class for modeling new unmarshaling APIs. */
0 commit comments