mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Introduce query to capture external libraries
This commit is contained in:
16
java/ql/src/Telemetry/ExternalLibraryUsage.ql
Normal file
16
java/ql/src/Telemetry/ExternalLibraryUsage.ql
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @name External libraries
|
||||
* @description A list of external libraries used in the code
|
||||
* @id java/telemetry/external-libs
|
||||
*/
|
||||
|
||||
import java
|
||||
import ExternalAPI
|
||||
|
||||
from ExternalAPI api
|
||||
where not api.getDeclaringType() instanceof TestLibrary
|
||||
// TODO [bm]: the count is not aggregated and we have the same jar with multiple usages, e.g.
|
||||
// 1 protobuf-java-3.17.3.jar 373
|
||||
// 2 protobuf-java-3.17.3.jar 48
|
||||
select api.jarName() as jarname, count(Call c | c.getCallee() = api) as Usages
|
||||
order by Usages desc
|
||||
Reference in New Issue
Block a user