|
23 | 23 | * 7. The `input` column specifies how data enters the element selected by the |
24 | 24 | * first 6 columns, and the `output` column specifies how data leaves the |
25 | 25 | * element selected by the first 6 columns. An `input` can be either "", |
26 | | - * "Argument[n]", "Argument[n1..n2]", "ReturnValue", "ReturnValue[n]", |
27 | | - * "ReturnValue[n1..n2]": |
| 26 | + * "Argument[n]", or "Argument[n1..n2]": |
28 | 27 | * - "": Selects a write to the selected element in case this is a field. |
29 | 28 | * - "Argument[n]": Selects an argument in a call to the selected element. |
30 | 29 | * The arguments are zero-indexed, and `-1` specifies the qualifier. |
31 | 30 | * - "Argument[n1..n2]": Similar to "Argument[n]" but selects any argument |
32 | 31 | * in the given range. The range is inclusive at both ends. |
33 | | - * - "ReturnValue": Selects the first value being returned by the selected |
34 | | - * element. This requires that the selected element is a method with a |
35 | | - * body. |
36 | | - * - "ReturnValue[n]": Similar to "ReturnValue" but selects the specified |
37 | | - * return value. The return values are zero-indexed |
38 | | - * - "ReturnValue[n1..n2]": Similar to "ReturnValue[n]" but selects any |
39 | | - * return value in the given range. The range is inclusive at both ends. |
40 | 32 | * |
41 | 33 | * An `output` can be either "", "Argument[n]", "Argument[n1..n2]", "Parameter", |
42 | | - * "Parameter[n]", "Parameter[n1..n2]", or "ReturnValue": |
| 34 | + * "Parameter[n]", "Parameter[n1..n2]", , "ReturnValue", "ReturnValue[n]", or |
| 35 | + * "ReturnValue[n1..n2]": |
43 | 36 | * - "": Selects a read of a selected field, or a selected parameter. |
44 | 37 | * - "Argument[n]": Selects the post-update value of an argument in a call to the |
45 | 38 | * selected element. That is, the value of the argument after the call returns. |
|
53 | 46 | * numbered parameter (zero-indexed, and `-1` specifies the value of `this`). |
54 | 47 | * - "Parameter[n1..n2]": Similar to "Parameter[n]" but selects any parameter |
55 | 48 | * in the given range. The range is inclusive at both ends. |
56 | | - * - "ReturnValue": Selects the return value of a call to the selected element. |
| 49 | + * - "ReturnValue": Selects the first value being returned by the selected |
| 50 | + * element. This requires that the selected element is a method with a |
| 51 | + * body. |
| 52 | + * - "ReturnValue[n]": Similar to "ReturnValue" but selects the specified |
| 53 | + * return value. The return values are zero-indexed |
| 54 | + * - "ReturnValue[n1..n2]": Similar to "ReturnValue[n]" but selects any |
| 55 | + * return value in the given range. The range is inclusive at both ends. |
57 | 56 | * 8. The `kind` column is a tag that can be referenced from QL to determine to |
58 | 57 | * which classes the interpreted elements should be added. For example, for |
59 | 58 | * sources "remote" indicates a default remote flow source, and for summaries |
@@ -190,30 +189,45 @@ predicate summaryModel( |
190 | 189 | row.splitAt(";", 8) = kind |
191 | 190 | } |
192 | 191 |
|
| 192 | +/** Holds if `package` have CSV framework coverage. */ |
193 | 193 | private predicate relevantPackage(string package) { |
194 | 194 | sourceModel(package, _, _, _, _, _, _, _) or |
195 | 195 | sinkModel(package, _, _, _, _, _, _, _) or |
196 | 196 | summaryModel(package, _, _, _, _, _, _, _, _) |
197 | 197 | } |
198 | 198 |
|
| 199 | +/** |
| 200 | + * Holds if `shortpkg` and `longpkg` have CSV framework coverage and `shortpkg` |
| 201 | + * is a subpackage of `longpkg`. |
| 202 | + */ |
199 | 203 | private predicate packageLink(string shortpkg, string longpkg) { |
200 | 204 | relevantPackage(shortpkg) and |
201 | 205 | relevantPackage(longpkg) and |
202 | 206 | longpkg.prefix(longpkg.indexOf(".")) = shortpkg |
203 | 207 | } |
204 | 208 |
|
| 209 | +/** |
| 210 | + * Holds if `package` has CSV framework coverage and it is not a subpackage of |
| 211 | + * any other package with CSV framework coverage. |
| 212 | + */ |
205 | 213 | private predicate canonicalPackage(string package) { |
206 | 214 | relevantPackage(package) and not packageLink(_, package) |
207 | 215 | } |
208 | 216 |
|
| 217 | +/** |
| 218 | + * Holds if `package` and `subpkg` have CSV framework coverage, `subpkg` is a |
| 219 | + * subpackage of `package` (or they are the same), and `package` is not a |
| 220 | + * subpackage of any other package with CSV framework coverage. |
| 221 | + */ |
209 | 222 | private predicate canonicalPkgLink(string package, string subpkg) { |
210 | 223 | canonicalPackage(package) and |
211 | 224 | (subpkg = package or packageLink(package, subpkg)) |
212 | 225 | } |
213 | 226 |
|
214 | 227 | /** |
215 | 228 | * Holds if CSV framework coverage of `package` is `n` api endpoints of the |
216 | | - * kind `(kind, part)`. |
| 229 | + * kind `(kind, part)`, and `pkgs` is the number of subpackages of `package` |
| 230 | + * which have CSV framework coverage (including `package` itself). |
217 | 231 | */ |
218 | 232 | predicate modelCoverage(string package, int pkgs, string kind, string part, int n) { |
219 | 233 | pkgs = strictcount(string subpkg | canonicalPkgLink(package, subpkg)) and |
@@ -389,7 +403,7 @@ class SyntheticField extends string { |
389 | 403 | SyntheticField() { parseSynthField(_, this) } |
390 | 404 |
|
391 | 405 | /** |
392 | | - * Gets the type of this field. The default type is `Object`, but this can be |
| 406 | + * Gets the type of this field. The default type is `interface{}`, but this can be |
393 | 407 | * overridden. |
394 | 408 | */ |
395 | 409 | Type getType() { result instanceof EmptyInterfaceType } |
|
0 commit comments