File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ import java
1010import ExternalApi
1111import semmle.code.java.GeneratedFiles
1212
13- from ExternalApi api , int usages
14- where
13+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
1514 not api .isUninteresting ( ) and
1615 api .isSink ( ) and
1716 usages =
1817 strictcount ( Call c |
1918 c .getCallee ( ) .getSourceDeclaration ( ) = api and
2019 not c .getFile ( ) instanceof GeneratedFile
2120 )
21+ }
22+
23+ from ExternalApi api , int usages
24+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
2225select api .getApiName ( ) as apiname , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ import java
1010import ExternalApi
1111import semmle.code.java.GeneratedFiles
1212
13- from ExternalApi api , int usages
14- where
13+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
1514 not api .isUninteresting ( ) and
1615 api .isSource ( ) and
1716 usages =
1817 strictcount ( Call c |
1918 c .getCallee ( ) .getSourceDeclaration ( ) = api and
2019 not c .getFile ( ) instanceof GeneratedFile
2120 )
21+ }
22+
23+ from ExternalApi api , int usages
24+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
2225select api .getApiName ( ) as apiname , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ import java
1010import ExternalApi
1111import semmle.code.java.GeneratedFiles
1212
13- from ExternalApi api , int usages
14- where
13+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
1514 not api .isUninteresting ( ) and
1615 api .hasSummary ( ) and
1716 usages =
1817 strictcount ( Call c |
1918 c .getCallee ( ) .getSourceDeclaration ( ) = api and
2019 not c .getFile ( ) instanceof GeneratedFile
2120 )
21+ }
22+
23+ from ExternalApi api , int usages
24+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
2225select api .getApiName ( ) as apiname , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,13 +10,16 @@ import java
1010import ExternalApi
1111import semmle.code.java.GeneratedFiles
1212
13- from ExternalApi api , int usages
14- where
13+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
1514 not api .isUninteresting ( ) and
1615 not api .isSupported ( ) and
1716 usages =
1817 strictcount ( Call c |
1918 c .getCallee ( ) .getSourceDeclaration ( ) = api and
2019 not c .getFile ( ) instanceof GeneratedFile
2120 )
21+ }
22+
23+ from ExternalApi api , int usages
24+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
2225select api .getApiName ( ) as apiname , usages order by usages desc
You can’t perform that action at this time.
0 commit comments