File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class ExternalAPI extends Callable {
21
21
api .getDeclaringType ( ) .getPackage ( ) + ";?;" + api .getDeclaringType ( ) .getSourceDeclaration ( ) +
22
22
";" + api .getName ( ) + ";" + paramsString ( api )
23
23
}
24
+
25
+ predicate isSupported ( ) { not supportKind ( this ) = "?" }
24
26
}
25
27
26
28
private class TestLibrary extends RefType {
Original file line number Diff line number Diff line change 2
2
* @name Usage of APIs coming from external libraries
3
3
* @description A list of 3rd party APIs used in the codebase. Excludes test and generated code.
4
4
* @id java/telemetry/external-api
5
- * @kind diagnostic
5
+ * @kind metric
6
+ * @metricType callable
6
7
*/
7
8
8
9
import java
9
10
import APIUsage
10
11
import ExternalAPI
11
12
import semmle.code.java.GeneratedFiles
12
13
13
- // TODO [bm]: decide whether to drop the order by or
14
- // turn Usage into string for diagnostic kind
15
- // https://github.slack.com/archives/C01JJP3EF8E/p1627910071013000
16
14
from ExternalAPI api
17
15
where
18
16
not api .isTestLibrary ( ) and
17
+ not api .isSupported ( ) and
19
18
api .isInteresting ( )
20
19
select api .asCSV ( api ) as csv ,
21
20
count ( Call c |
22
21
c .getCallee ( ) = api and
23
22
not c .getFile ( ) instanceof GeneratedFile
24
- ) as Usages , supportKind ( api ) as Kind order by Usages desc
23
+ ) as Usages order by Usages desc
You can’t perform that action at this time.
0 commit comments