|
1 | 1 | /**
|
2 |
| - * @name Framework coverage |
3 |
| - * @description The number of API endpoints covered by CSV models sorted by |
4 |
| - * package and source-, sink-, and summary-kind. |
| 2 | + * @name Diagnostics for framework coverage |
| 3 | + * @description Expose diagnostics for the number of API endpoints covered by CSV models. |
5 | 4 | * @kind diagnostic
|
6 | 5 | * @id java/diagnostics/framework-coverage
|
7 | 6 | */
|
8 | 7 |
|
9 | 8 | import java
|
10 | 9 | import semmle.code.java.dataflow.ExternalFlow
|
11 | 10 |
|
12 |
| -string supportedPackageAndType() { |
| 11 | +from string packageAndType, int rows |
| 12 | +where |
13 | 13 | exists(string package, string type |
|
14 |
| - modelCoverage(package, _, _, type, _) and result = package + ";" + type |
| 14 | + modelCoverage(package, _, _, type, _) and |
| 15 | + packageAndType = package + ";" + type and |
| 16 | + rows = sum(int n | modelCoverage(package, _, _, type, n) | n) |
15 | 17 | )
|
16 |
| -} |
17 |
| - |
18 |
| -bindingset[packageAndType] |
19 |
| -int rowsForPackageAndType(string packageAndType) { |
20 |
| - result = |
21 |
| - sum(int n, string package, string type | |
22 |
| - package = packageAndType.substring(0, packageAndType.indexOf(";")) and |
23 |
| - type = packageAndType.substring(packageAndType.indexOf(";") + 1, packageAndType.length()) and |
24 |
| - modelCoverage(package, _, _, type, n) |
25 |
| - | |
26 |
| - n |
27 |
| - ) |
28 |
| -} |
29 |
| - |
30 |
| -from string packageAndType, int rows |
31 |
| -where packageAndType = supportedPackageAndType() and rows = rowsForPackageAndType(packageAndType) |
32 |
| -select packageAndType, rows order by rows desc |
| 18 | +select packageAndType, rows |
0 commit comments