Skip to content

Commit ac85741

Browse files
committed
C#: Add meta query for reporting calls to unsupported library methods
1 parent df2b586 commit ac85741

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @name Usage of unsupported external library API
3+
* @description A call to an unsuppported external library API.
4+
* @kind problem
5+
* @problem.severity recommendation
6+
* @tags meta
7+
* @id csharp/meta/unsupported-external-api
8+
* @precision very-low
9+
*/
10+
11+
private import csharp
12+
private import semmle.code.csharp.dispatch.Dispatch
13+
private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
14+
private import semmle.code.csharp.dataflow.internal.NegativeSummary
15+
private import Telemetry.ExternalApi
16+
17+
from DispatchCall c, ExternalApi api
18+
where
19+
c = api.getACall() and
20+
not api.isUninteresting() and
21+
not api.isSupported() and
22+
not api instanceof FlowSummaryImpl::Public::NegativeSummarizedCallable
23+
select c, "Call to unsupported external API $@.", api, api.toString()

0 commit comments

Comments
 (0)