Files
codeql/java/ql/src/Telemetry/ExternalLibraryUsage.ql
2021-08-11 15:31:33 +02:00

23 lines
542 B
Plaintext

/**
* @name External libraries
* @description A list of external libraries used in the code
* @kind metric
* @metricType callable
* @id java/telemetry/external-libs
*/
import java
import ExternalAPI
from int Usages, string jarname
where
jarname = any(ExternalAPI api).jarContainer() and
Usages =
strictcount(Call c, ExternalAPI a |
c.getCallee() = a and
not c.getFile() instanceof GeneratedFile and
a.jarContainer() = jarname and
not a.isTestLibrary()
)
select jarname, Usages order by Usages desc