Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d9285e7

Browse files
author
Benjamin Muskalla
committed
Add query to collect external API calls
1 parent 07303cc commit d9285e7

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @name Usage of APIs coming from external libraries
3+
* @description A list of 3rd party APIs used in the codebase. Excludes test and generated code.
4+
* @id java/telemetry/external-libs
5+
*/
6+
7+
import java
8+
import ExternalAPI
9+
import semmle.code.java.GeneratedFiles
10+
11+
from ExternalAPI api
12+
where
13+
not api.getDeclaringType() instanceof TestLibrary and
14+
isInterestingAPI(api)
15+
select api.simpleName() as API,
16+
count(Call c |
17+
c.getCallee() = api and
18+
not c.getFile() instanceof GeneratedFile and
19+
not loggingRelated(c)
20+
) as Usages, supportKind(api) as Kind, api.getReturnType() as ReturnType,
21+
api.getDeclaringType().getPackage() as Package order by Usages desc

0 commit comments

Comments
 (0)