Skip to content

test: clear the two CodeQL quality alerts in the test projects - #92

Merged
bgard68 merged 1 commit into
mainfrom
fix/codeql-test-quality-alerts
Sep 11, 2026
Merged

bgard68 merged 1 commit into
mainfrom
fix/codeql-test-quality-alerts

Conversation

@bgard68

@bgard68 bgard68 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Clears the only two open code scanning alerts on main. Both are CodeQL quality rules firing on test code, not vulnerabilities.

Alert Rule File
#59 (warning) cs/local-not-disposed ApiExceptionHandlerTests.cs:175
#60 (note) cs/linq/missed-where AcknowledgementTests.cs:122

#59 — the StreamReader over the response body was constructed inline and never disposed. Bound to a using local. Nothing reads Response.Body after that point, so letting the reader close the stream is harmless.

#60 — the theory-data loop filtered with an if inside 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

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>
@bgard68
bgard68 merged commit 36ec64b into main Sep 11, 2026
10 checks passed
@bgard68
bgard68 deleted the fix/codeql-test-quality-alerts branch September 11, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant