@@ -28,7 +28,7 @@ private import codeql.rust.security.WeakSensitiveDataHashingExtensions
28
28
/**
29
29
* Gets a count of the total number of lines of code in the database.
30
30
*/
31
- int getLinesOfCode ( ) { result = sum ( File f | | f .getNumberOfLinesOfCode ( ) ) }
31
+ int getLinesOfCode ( ) { result = sum ( File f | f . fromSource ( ) | f .getNumberOfLinesOfCode ( ) ) }
32
32
33
33
/**
34
34
* Gets a count of the total number of lines of code from the source code directory in the database.
@@ -109,9 +109,11 @@ predicate elementStats(string key, int value) {
109
109
* Gets summary statistics about extraction.
110
110
*/
111
111
predicate extractionStats ( string key , int value ) {
112
- key = "Extraction errors" and value = count ( ExtractionError e )
112
+ key = "Extraction errors" and
113
+ value = count ( ExtractionError e | not exists ( e .getLocation ( ) ) or e .getLocation ( ) .fromSource ( ) )
113
114
or
114
- key = "Extraction warnings" and value = count ( ExtractionWarning w )
115
+ key = "Extraction warnings" and
116
+ value = count ( ExtractionWarning w | not exists ( w .getLocation ( ) ) or w .getLocation ( ) .fromSource ( ) )
115
117
or
116
118
key = "Files extracted - total" and value = count ( ExtractedFile f | exists ( f .getRelativePath ( ) ) )
117
119
or
@@ -133,11 +135,13 @@ predicate extractionStats(string key, int value) {
133
135
or
134
136
key = "Lines of user code extracted" and value = getLinesOfUserCode ( )
135
137
or
136
- key = "Macro calls - total" and value = count ( MacroCall mc )
138
+ key = "Macro calls - total" and value = count ( MacroCall mc | mc . fromSource ( ) )
137
139
or
138
- key = "Macro calls - resolved" and value = count ( MacroCall mc | mc .hasMacroCallExpansion ( ) )
140
+ key = "Macro calls - resolved" and
141
+ value = count ( MacroCall mc | mc .fromSource ( ) and mc .hasMacroCallExpansion ( ) )
139
142
or
140
- key = "Macro calls - unresolved" and value = count ( MacroCall mc | not mc .hasMacroCallExpansion ( ) )
143
+ key = "Macro calls - unresolved" and
144
+ value = count ( MacroCall mc | mc .fromSource ( ) and not mc .hasMacroCallExpansion ( ) )
141
145
}
142
146
143
147
/**
0 commit comments