Files
codeql/java/ql/src/Telemetry/SupportedExternalSources.ql
2021-09-07 14:28:58 +02:00

23 lines
616 B
Plaintext

/**
* @name Supported sources in external libraries
* @description A list of 3rd party APIs detected as sources. Excludes test and generated code.
* @id java/telemetry/supported-external-api-sources
* @kind metric
* @metricType callable
*/
import java
import ExternalAPI
import semmle.code.java.GeneratedFiles
from ExternalAPI api, int usages
where
not api.isUninteresting() and
api.isSource() and
usages =
strictcount(Call c |
c.getCallee().getSourceDeclaration() = api and
not c.getFile() instanceof GeneratedFile
)
select api.getApiName() as apiname, usages order by usages desc