Skip to content

test: fix the four open InspectCode alerts in test code - #584

Open
Chris-Wolfgang wants to merge 1 commit into
mainfrom
fix/inspectcode-s6608-error-handling-tests
Open

Chris-Wolfgang wants to merge 1 commit into
mainfrom
fix/inspectcode-s6608-error-handling-tests

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Fixes the four InspectCode code-scanning alerts open on main (all in test code).

Addresses #573, #574, #575 and #577. This PR is stacked on #583, so it does not auto-link them; they need closing by hand once this reaches main.

Test-code change - please review. No production code is touched.

Alert Rule Change
1526, 1527 S6608 FixedWidthItemErrorHandlingTests: read reports[reports.Count - 1] once instead of reports.Last() twice (works on every TFM, including net462)
1529 RedundantExplicitTupleComponentName SourceLinkPdbTests: (Name: entry.Name, ...) -> (entry.Name, ...)
1525 ParameterOnlyUsedForPreconditionCheck.Local ConcurrencyStressTests.RunFanoutAsync: the Assert.All lambda now does one Assert.Equal on (Exception, Status) against (null, RanToCompletion). Same checks, and the failure message still shows each failing iteration's exception and status

Stack: #583 (mcp override) <- this PR (top of the security series).

Verified locally (Windows, .NET 10 SDK)

  • jb inspectcode "ETL Fixed Width.slnx" --include=<the 3 files> --severity=WARNING --format=Sarif: 0 results (all three files were inspected).
  • dotnet build tests/Wolfgang.Etl.FixedWidth.Tests.Unit -c Release (all 13 TFMs): 0 warnings, 0 errors.
  • dotnet test net10.0: FixedWidthItemErrorHandlingTests 9/9, Tests.Concurrency 5/5, Tests.SourceLink 3/3 passed.

Not verified

  • The full coverage gate was not run. No lines or branches are added that a passing run skips: the new lambda runs once per task.
  • The other TFMs' test runs, and CI (GitHub Actions is billing-locked).
  • Whether CI's InspectCode settings match the local probe exactly.

🤖 Generated with Claude Code

Base automatically changed from deps/semgrep-mcp-1.30.0 to main November 2, 2026 18:24
- FixedWidthItemErrorHandlingTests: index the last progress report
  instead of Enumerable.Last() on a List (S6608, alerts 1526/1527).
- SourceLinkPdbTests: drop the inferable tuple name `Name:`
  (RedundantExplicitTupleComponentName, alert 1529).
- ConcurrencyStressTests: compare (Exception, Status) as one tuple in
  Assert.All so the lambda parameter is not only used by assertion
  preconditions (ParameterOnlyUsedForPreconditionCheck.Local, alert 1525).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Chris-Wolfgang
Chris-Wolfgang force-pushed the fix/inspectcode-s6608-error-handling-tests branch from da32639 to 3f91802 Compare November 7, 2026 07:53

This branch has not been deployed

No deployments
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