Rust: Exclude skipped files in rust/diagnostic/database-quality#20712
Merged
geoffw0 merged 5 commits intogithub:mainfrom Oct 31, 2025
Merged
Rust: Exclude skipped files in rust/diagnostic/database-quality#20712geoffw0 merged 5 commits intogithub:mainfrom
geoffw0 merged 5 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refines database quality statistics by filtering out files that were skipped during compilation, ensuring metrics only reflect actively compiled code.
- Introduces a
RelevantFileclass to exclude compilation-skipped files from statistics - Updates all telemetry statistics modules to only count elements from relevant files
- Clarifies the
fromSource()documentation to distinguish source files from dependencies
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rust/ql/src/queries/telemetry/DatabaseQuality.qll | Adds RelevantFile filter and applies it to all statistic counts in CallTargetStats, MacroCallTargetStats, and ExprTypeStats modules |
| rust/ql/lib/codeql/files/FileSystem.qll | Improves documentation for fromSource() predicate to clarify it identifies target project files vs dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
hvitved
reviewed
Oct 29, 2025
hvitved
approved these changes
Oct 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Exclude skipped files in
rust/diagnostic/database-quality(i.e. the query that powers the tool status page). Skipped files are files skipped by conditional compilation, so they should not affect metrics, and we should not necessarily expect that calls, macros etc in them are actually resolvable anyway.Unfortunately the overall effect of this change is quite limited, at least on the MRVA-1000 - only one project in that set that had a tool status page warning before does not have one now (previously 132 projects, now 131). Others have slightly better numbers but have not crossed a threshold. There's more to be done on narrowing down the causes of this issue.