File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ private import csharp
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
11
private import ExternalApi
12
12
13
- from ExternalApi api , int usages
14
- where
13
+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
15
14
not api .isUninteresting ( ) and
16
15
api .isSink ( ) and
17
16
usages = strictcount ( DispatchCall c | c = api .getACall ( ) )
17
+ }
18
+
19
+ from ExternalApi api , int usages
20
+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
18
21
select api .getInfo ( ) as info , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ private import csharp
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
11
private import ExternalApi
12
12
13
- from ExternalApi api , int usages
14
- where
13
+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
15
14
not api .isUninteresting ( ) and
16
15
api .isSource ( ) and
17
16
usages = strictcount ( DispatchCall c | c = api .getACall ( ) )
17
+ }
18
+
19
+ from ExternalApi api , int usages
20
+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
18
21
select api .getInfo ( ) as info , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ private import csharp
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
11
private import ExternalApi
12
12
13
- from ExternalApi api , int usages
14
- where
13
+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
15
14
not api .isUninteresting ( ) and
16
15
api .hasSummary ( ) and
17
16
usages = strictcount ( DispatchCall c | c = api .getACall ( ) )
17
+ }
18
+
19
+ from ExternalApi api , int usages
20
+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
18
21
select api .getInfo ( ) as info , usages order by usages desc
Original file line number Diff line number Diff line change @@ -10,9 +10,12 @@ private import csharp
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
11
private import ExternalApi
12
12
13
- from ExternalApi api , int usages
14
- where
13
+ private predicate getRelevantUsages ( ExternalApi api , int usages ) {
15
14
not api .isUninteresting ( ) and
16
15
not api .isSupported ( ) and
17
16
usages = strictcount ( DispatchCall c | c = api .getACall ( ) )
17
+ }
18
+
19
+ from ExternalApi api , int usages
20
+ where Results< getRelevantUsages / 2 > :: restrict ( api , usages )
18
21
select api .getInfo ( ) as info , usages order by usages desc
You can’t perform that action at this time.
0 commit comments