fix: scope CodeQL to real source and remove redundant cast - #61
Merged
Conversation
CI run 32755201459's "Display CodeQL Quality Report" step reported 745 cs/useless-cast-to-self findings. Filtering that report showed 744 of 745 were in obj/**/generated/** files (System.Text.Json source-generator output for AstSerializerContext/QueryResultSerializerContext), which are build outputs, not hand-written source, and are already excluded from lint/review per this repo's scope-discipline rules. CodeQL's default scan was not excluding obj/, so every generated file's redundant self-casts (an artifact of the source generator's own template, not something this repo controls) were reported repeatedly. Adds "**/obj/**" and "**/bin/**" to codeql-config.yml's paths-ignore, alongside the existing ANTLR4-generated-parser exclusion, so CodeQL only analyzes real source going forward. The one remaining genuine finding - a redundant (IReadOnlyList<LayoutNode>) cast on the empty-array literal in InterconnectionViewLayoutStrategy.MakePartBox - is fixed directly: removed the explicit cast since the ternary's other branch (TranslateNodes(...)) already returns IReadOnlyList<LayoutNode>, so the compiler infers the same type for the empty-array branch without it. Verified: build succeeds (0 errors) with the cast removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
CI run 32755201459's "Display CodeQL Quality Report" step reported 745 cs/useless-cast-to-self findings. Filtering that report showed 744 of 745 were in obj//generated/ files (System.Text.Json source-generator output for AstSerializerContext/QueryResultSerializerContext), which are build outputs, not hand-written source, and are already excluded from lint/review per this repo's scope-discipline rules. CodeQL's default scan was not excluding obj/, so every generated file's redundant self-casts (an artifact of the source generator's own template, not something this repo controls) were reported repeatedly.
Adds "/obj/" and "/bin/" to codeql-config.yml's paths-ignore, alongside the existing ANTLR4-generated-parser exclusion, so CodeQL only analyzes real source going forward.
The one remaining genuine finding - a redundant
(IReadOnlyList) cast on the empty-array literal in InterconnectionViewLayoutStrategy.MakePartBox - is fixed directly: removed the explicit cast since the ternary's other branch (TranslateNodes(...)) already returns IReadOnlyList, so the compiler infers the same type for the empty-array branch without it.
Verified: build succeeds (0 errors) with the cast removed.