File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -10,12 +10,28 @@ private import csharp
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
11
private import ExternalApi
12
12
13
- from int usages , string info
14
- where
13
+ private predicate getRelevantUsages ( string info , int usages ) {
15
14
usages =
16
15
strictcount ( DispatchCall c , ExternalApi api |
17
16
c = api .getACall ( ) and
18
17
api .getInfoPrefix ( ) = info and
19
18
not api .isUninteresting ( )
20
19
)
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 ( )
21
37
select info , usages order by usages desc
You can’t perform that action at this time.
0 commit comments