mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
add query for SupportedExternalApis
This commit is contained in:
24
java/ql/src/Telemetry/SupportedExternalApis.ql
Normal file
24
java/ql/src/Telemetry/SupportedExternalApis.ql
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* @name Usage of supported APIs coming from external libraries
|
||||
* @description A list of supported 3rd party APIs used in the codebase. Excludes test and generated code.
|
||||
* @kind metric
|
||||
* @tags summary telemetry
|
||||
* @id java/telemetry/supported-external-api
|
||||
*/
|
||||
|
||||
import java
|
||||
import semmle.code.java.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
|
||||
import semmle.code.java.dataflow.internal.NegativeSummary
|
||||
import ExternalApi
|
||||
|
||||
private predicate relevant(ExternalApi api) {
|
||||
not api.isUninteresting() and
|
||||
(
|
||||
api.isSupported() or
|
||||
api = any(FlowSummaryImpl::Public::NegativeSummarizedCallable nsc).asCallable()
|
||||
)
|
||||
}
|
||||
|
||||
from string apiName, int usages
|
||||
where Results<relevant/1>::restrict(apiName, usages)
|
||||
select apiName, usages order by usages desc
|
||||
Reference in New Issue
Block a user