mirror of
https://github.com/github/codeql.git
synced 2026-01-21 10:24:47 +01:00
Merge pull request #10606 from hvitved/csharp/unsupported-api-meta-query
C#: Add meta query for reporting calls to unsupported library methods
This commit is contained in:
23
csharp/ql/src/meta/frameworks/UnsupportedExternalAPIs.ql
Normal file
23
csharp/ql/src/meta/frameworks/UnsupportedExternalAPIs.ql
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @name Usage of unsupported external library API
|
||||
* @description A call to an unsuppported external library API.
|
||||
* @kind problem
|
||||
* @problem.severity recommendation
|
||||
* @tags meta
|
||||
* @id csharp/meta/unsupported-external-api
|
||||
* @precision very-low
|
||||
*/
|
||||
|
||||
private import csharp
|
||||
private import semmle.code.csharp.dispatch.Dispatch
|
||||
private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
|
||||
private import semmle.code.csharp.dataflow.internal.NegativeSummary
|
||||
private import Telemetry.ExternalApi
|
||||
|
||||
from DispatchCall c, ExternalApi api
|
||||
where
|
||||
c = api.getACall() and
|
||||
not api.isUninteresting() and
|
||||
not api.isSupported() and
|
||||
not api instanceof FlowSummaryImpl::Public::NegativeSummarizedCallable
|
||||
select c, "Call to unsupported external API $@.", api, api.toString()
|
||||
Reference in New Issue
Block a user