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,7 +10,7 @@ private import semmle.code.java.dataflow.ExternalFlow
1010class ExternalAPI extends Callable {
1111 ExternalAPI ( ) { not this .fromSource ( ) }
1212
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 */
1414 predicate isTestLibrary ( ) { getDeclaringType ( ) instanceof TestLibrary }
1515
1616 /**
@@ -22,7 +22,7 @@ class ExternalAPI extends Callable {
2222 ";" + api .getName ( ) + ";" + paramsString ( api )
2323 }
2424
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 */
2626 predicate isSupported ( ) { not supportKind ( this ) = "?" }
2727
2828 /**
Original file line number Diff line number Diff line change @@ -11,12 +11,13 @@ import APIUsage
1111import ExternalAPI
1212import semmle.code.java.GeneratedFiles
1313
14- from ExternalAPI api
14+ from ExternalAPI api , int usages
1515where
1616 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 1717 supportKind ( api ) = "source" and
1818 usages =
1919 strictcount ( Call c |
20- c .getCallee ( ) = api and
20+ c .getCallee ( ) . getSourceDeclaration ( ) = api and
2121 not c .getFile ( ) instanceof GeneratedFile
2222 )
2323select 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
1111import ExternalAPI
1212import semmle.code.java.GeneratedFiles
1313
14- from ExternalAPI api
14+ from ExternalAPI api , int usages
1515where
1616 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
1111import ExternalAPI
1212import semmle.code.java.GeneratedFiles
1313
14- from ExternalAPI api
14+ from ExternalAPI api , int usages
1515where
1616 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