Rust: restrict line and file counts to include only extracted source files

This commit is contained in:
Arthur Baars
2025-05-28 19:55:13 +02:00
parent 5df50c0b14
commit 62d0cf7e0d
2 changed files with 2 additions and 2 deletions

View File

@@ -10,7 +10,7 @@
import codeql.files.FileSystem
select count(File f |
select count(ExtractedFile f |
exists(f.getRelativePath()) and
not f instanceof SuccessfullyExtractedFile
)

View File

@@ -35,7 +35,7 @@ int getLinesOfCode() { result = sum(File f | f.fromSource() | f.getNumberOfLines
* Gets a count of the total number of lines of code from the source code directory in the database.
*/
int getLinesOfUserCode() {
result = sum(File f | exists(f.getRelativePath()) | f.getNumberOfLinesOfCode())
result = sum(File f | f.fromSource() and exists(f.getRelativePath()) | f.getNumberOfLinesOfCode())
}
/**