Skip to content

Commit f1ebaf1

Browse files
Jami CogswellJami Cogswell
authored andcommitted
add csharp query
1 parent 94c5d53 commit f1ebaf1

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* @name Usage of supported APIs coming from external libraries
3+
* @description A list of supported 3rd party APIs used in the codebase. Excludes APIs exposed by test libraries.
4+
* @kind metric
5+
* @tags summary telemetry
6+
* @id csharp/telemetry/supported-external-api
7+
*/
8+
9+
private import csharp
10+
private import semmle.code.csharp.dispatch.Dispatch
11+
private import semmle.code.csharp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
12+
private import ExternalApi
13+
14+
private predicate relevant(ExternalApi api) {
15+
not api.isUninteresting() and
16+
(
17+
api.isSupported() or
18+
api instanceof FlowSummaryImpl::Public::NegativeSummarizedCallable
19+
)
20+
}
21+
22+
from string info, int usages
23+
where Results<relevant/1>::restrict(info, usages)
24+
select info, usages order by usages desc

0 commit comments

Comments
 (0)