File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ class ExternalAPI extends Callable {
2121 api .getDeclaringType ( ) .getPackage ( ) + ";?;" + api .getDeclaringType ( ) .getSourceDeclaration ( ) +
2222 ";" + api .getName ( ) + ";" + paramsString ( api )
2323 }
24+
25+ predicate isSupported ( ) { not supportKind ( this ) = "?" }
2426}
2527
2628private class TestLibrary extends RefType {
Original file line number Diff line number Diff line change 22 * @name Usage of APIs coming from external libraries
33 * @description A list of 3rd party APIs used in the codebase. Excludes test and generated code.
44 * @id java/telemetry/external-api
5- * @kind diagnostic
5+ * @kind metric
6+ * @metricType callable
67 */
78
89import java
910import APIUsage
1011import ExternalAPI
1112import semmle.code.java.GeneratedFiles
1213
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
1614from ExternalAPI api
1715where
1816 not api .isTestLibrary ( ) and
17+ not api .isSupported ( ) and
1918 api .isInteresting ( )
2019select api .asCSV ( api ) as csv ,
2120 count ( Call c |
2221 c .getCallee ( ) = api and
2322 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