File tree Expand file tree Collapse file tree 5 files changed +27
-24
lines changed Expand file tree Collapse file tree 5 files changed +27
-24
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ private import semmle.code.java.dataflow.ExternalFlow
10
10
class ExternalAPI extends Callable {
11
11
ExternalAPI ( ) { not this .fromSource ( ) }
12
12
13
- /** Holds true if this API is part of a common testing library or framework */
13
+ /** Holds if this API is part of a common testing library or framework */
14
14
predicate isTestLibrary ( ) { getDeclaringType ( ) instanceof TestLibrary }
15
15
16
16
/**
@@ -22,7 +22,7 @@ class ExternalAPI extends Callable {
22
22
";" + api .getName ( ) + ";" + paramsString ( api )
23
23
}
24
24
25
- /** Holds true if this API is not yet supported by existing CodeQL libraries */
25
+ /** Holds if this API is not yet supported by existing CodeQL libraries */
26
26
predicate isSupported ( ) { not supportKind ( this ) = "?" }
27
27
28
28
/**
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import APIUsage
11
11
import ExternalAPI
12
12
import semmle.code.java.GeneratedFiles
13
13
14
- from ExternalAPI api
14
+ from ExternalAPI api , int usages
15
15
where
16
16
not api .isTestLibrary ( ) and
17
- supportKind ( api ) = "sink"
18
- select api .asCsv ( api ) as csv ,
19
- strictcount ( Call c |
20
- c .getCallee ( ) = api and
21
- not c .getFile ( ) instanceof GeneratedFile
22
- ) as Usages order by Usages desc
17
+ supportKind ( api ) = "sink" and
18
+ usages =
19
+ strictcount ( Call c |
20
+ c .getCallee ( ) .getSourceDeclaration ( ) = api and
21
+ not c .getFile ( ) instanceof GeneratedFile
22
+ )
23
+ select api .asCsv ( api ) as csv , usages order by usages desc
Original file line number Diff line number Diff line change 17
17
supportKind ( api ) = "source" and
18
18
usages =
19
19
strictcount ( Call c |
20
- c .getCallee ( ) = api and
20
+ c .getCallee ( ) . getSourceDeclaration ( ) = api and
21
21
not c .getFile ( ) instanceof GeneratedFile
22
22
)
23
23
select api .asCsv ( api ) as csv , usages order by usages desc
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import APIUsage
11
11
import ExternalAPI
12
12
import semmle.code.java.GeneratedFiles
13
13
14
- from ExternalAPI api
14
+ from ExternalAPI api , int usages
15
15
where
16
16
not api .isTestLibrary ( ) and
17
- supportKind ( api ) = [ "summary" , "taint-preserving" ]
18
- select api .asCsv ( api ) as csv ,
19
- strictcount ( Call c |
20
- c .getCallee ( ) = api and
21
- not c .getFile ( ) instanceof GeneratedFile
22
- ) as Usages order by Usages desc
17
+ supportKind ( api ) = [ "summary" , "taint-preserving" ] and
18
+ usages =
19
+ strictcount ( Call c |
20
+ c .getCallee ( ) .getSourceDeclaration ( ) = api and
21
+ not c .getFile ( ) instanceof GeneratedFile
22
+ )
23
+ select api .asCsv ( api ) as csv , usages order by usages desc
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import APIUsage
11
11
import ExternalAPI
12
12
import semmle.code.java.GeneratedFiles
13
13
14
- from ExternalAPI api
14
+ from ExternalAPI api , int usages
15
15
where
16
16
not api .isTestLibrary ( ) and
17
- not api .isSupported ( )
18
- select api .asCsv ( api ) as csv ,
19
- strictcount ( Call c |
20
- c .getCallee ( ) = api and
21
- not c .getFile ( ) instanceof GeneratedFile
22
- ) as Usages order by Usages desc
17
+ not api .isSupported ( ) and
18
+ usages =
19
+ strictcount ( Call c |
20
+ c .getCallee ( ) .getSourceDeclaration ( ) = api and
21
+ not c .getFile ( ) instanceof GeneratedFile
22
+ )
23
+ select api .asCsv ( api ) as csv , usages order by usages desc
You can’t perform that action at this time.
0 commit comments