File tree Expand file tree Collapse file tree
rust/ql/src/queries/summary Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,6 +104,17 @@ int getTaintEdgesCount() {
104104 */
105105int getQuerySinksCount ( ) { result = count ( QuerySink s ) }
106106
107+ /**
108+ * Holds if there are at least 10 data flow nodes in the same location
109+ * as `n`.
110+ */
111+ private predicate isColocated10 ( DataFlow:: Node n ) {
112+ exists ( Location l |
113+ l = n .getLocation ( ) and
114+ strictcount ( DataFlow:: Node other | other .getLocation ( ) = l ) >= 10
115+ )
116+ }
117+
107118class CrateElement extends Element {
108119 CrateElement ( ) {
109120 this instanceof Crate or
@@ -131,7 +142,9 @@ predicate extractionStats(string key, int value) {
131142 key = "Extraction warnings" and
132143 value = count ( ExtractionWarning w | not exists ( w .getLocation ( ) ) or w .getLocation ( ) .fromSource ( ) )
133144 or
134- key = "Files extracted - total" and value = count ( ExtractedFile f | exists ( f .getRelativePath ( ) ) )
145+ key = "Files extracted - total" and value = count ( File f )
146+ or
147+ key = "Files extracted - total user" and value = count ( ExtractedFile f | exists ( f .getRelativePath ( ) ) )
135148 or
136149 key = "Files extracted - with errors" and
137150 value =
@@ -201,6 +214,8 @@ predicate taintStats(string key, int value) {
201214 or
202215 key = "Taint reach - per million nodes" and value = getTaintReach ( ) .floor ( )
203216 or
217+ key = "Taint nodes - highly colocated nodes" and value = count ( DataFlow:: Node n | isColocated10 ( n ) )
218+ or
204219 key = "Taint sinks - query sinks" and value = getQuerySinksCount ( )
205220 or
206221 key = "Taint sinks - cryptographic operations" and
You can’t perform that action at this time.
0 commit comments