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,12 +10,28 @@ private import csharp
1010private import semmle.code.csharp.dispatch.Dispatch
1111private import ExternalApi
1212
13- from int usages , string info
14- where
13+ private predicate getRelevantUsages ( string info , int usages ) {
1514 usages =
1615 strictcount ( DispatchCall c , ExternalApi api |
1716 c = api .getACall ( ) and
1817 api .getInfoPrefix ( ) = info and
1918 not api .isUninteresting ( )
2019 )
20+ }
21+
22+ private int getOrder ( string info ) {
23+ info =
24+ rank [ result ] ( string i , int usages |
25+ exists ( ExternalApi api | i = api .getInfoPrefix ( ) ) and
26+ getRelevantUsages ( i , usages )
27+ |
28+ i order by usages desc , i
29+ )
30+ }
31+
32+ from ExternalApi api , string info , int usages
33+ where
34+ info = api .getInfoPrefix ( ) and
35+ getRelevantUsages ( info , usages ) and
36+ getOrder ( info ) <= resultLimit ( )
2137select info , usages order by usages desc
You can’t perform that action at this time.
0 commit comments