mirror of
https://github.com/github/codeql.git
synced 2026-01-04 10:10:20 +01:00
26 lines
741 B
Plaintext
26 lines
741 B
Plaintext
/**
|
|
* @name Supported sources in external libraries
|
|
* @description A list of 3rd party APIs detected as sources. Excludes test and generated code.
|
|
* @kind metric
|
|
* @tags summary telemetry
|
|
* @id java/telemetry/supported-external-api-sources
|
|
*/
|
|
|
|
import java
|
|
import ExternalApi
|
|
import semmle.code.java.GeneratedFiles
|
|
|
|
private predicate getRelevantUsages(ExternalApi api, int usages) {
|
|
not api.isUninteresting() and
|
|
api.isSource() and
|
|
usages =
|
|
strictcount(Call c |
|
|
c.getCallee().getSourceDeclaration() = api and
|
|
not c.getFile() instanceof GeneratedFile
|
|
)
|
|
}
|
|
|
|
from ExternalApi api, int usages
|
|
where Results<getRelevantUsages/2>::restrict(api, usages)
|
|
select api.getApiName() as apiname, usages order by usages desc
|