test: clear the two CodeQL quality alerts in the test projects - #92
Merged
Merged
Conversation
Alert #59 (cs/local-not-disposed): the StreamReader over the response body was created inline and never disposed. Bind it to a `using` local instead. Nothing reads Response.Body after this point, so letting the reader close the stream is fine. Alert #60 (cs/linq/missed-where): the theory-data loop filtered with an `if` inside the body. Move the predicate to `.Where(...)` on the source sequence. The case list is still built here rather than filtered inside the test, so the doc comment above it still holds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.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.
Clears the only two open code scanning alerts on
main. Both are CodeQL quality rules firing on test code, not vulnerabilities.cs/local-not-disposedApiExceptionHandlerTests.cs:175cs/linq/missed-whereAcknowledgementTests.cs:122#59 — the
StreamReaderover the response body was constructed inline and never disposed. Bound to ausinglocal. Nothing readsResponse.Bodyafter that point, so letting the reader close the stream is harmless.#60 — the theory-data loop filtered with an
ifinside the body. Predicate moved to.Where(...)on the source sequence. The case list is still built in this method rather than filtered inside the test, so the doc comment above it still describes what the code does.Behaviour-preserving. Local run: Infrastructure.Tests 250 passed, Api.Integration.Tests 160 passed, 0 failures.
🤖 Generated with Claude Code