Drives the SonarQube tests/ open-issue count from 24 → 0. Non-breaking. Single commit.
Group
Count
Fix
NUnit2046
15
Extend the prior regex sweep to catch Is.GreaterThan(n) / Is.GreaterThanOrEqualTo(n) variants on .Count and .Length — the previous pass only handled Is.EqualTo
CS8604
8
merged[someKey] inside Assert.Multiple lambdas where someKey is string? from FirstOrDefault. The Assert.That(someKey, Is.Not.Null) immediately above does not propagate null-narrowing into the lambda scope, so the dictionary access gets !
NUnit2045
1
Wrap a four-assert block in JsonTokenReaderTests.cs:65-68 in Assert.Multiple, matching the surrounding two Assert.Multiple groups in that test
Re-query /api/issues/search?componentKeys=sql-utilities&resolved=false&facets=rules — open issue count should drop from 24 → 0
## Summary
Drives the SonarQube `tests/` open-issue count from **24 → 0**. Non-breaking. Single commit.
| Group | Count | Fix |
|---|--:|---|
| `NUnit2046` | 15 | Extend the prior regex sweep to catch `Is.GreaterThan(n)` / `Is.GreaterThanOrEqualTo(n)` variants on `.Count` and `.Length` — the previous pass only handled `Is.EqualTo` |
| `CS8604` | 8 | `merged[someKey]` inside `Assert.Multiple` lambdas where `someKey` is `string?` from `FirstOrDefault`. The `Assert.That(someKey, Is.Not.Null)` immediately above does not propagate null-narrowing into the lambda scope, so the dictionary access gets `!` |
| `NUnit2045` | 1 | Wrap a four-assert block in `JsonTokenReaderTests.cs:65-68` in `Assert.Multiple`, matching the surrounding two `Assert.Multiple` groups in that test |
All 1180 tests stay green. Build clean (0 errors, pre-existing warnings unchanged).
## Test plan
- [x] `dotnet build Strata.SqlTools.QueryBreakdown.sln -c Release` — 0 errors
- [x] `dotnet test ... -c Release --no-build` — 1180 passed, 0 failed
- [ ] Gitea Actions `sonarqube.yml` runs on this PR
- [ ] Re-query `/api/issues/search?componentKeys=sql-utilities&resolved=false&facets=rules` — open issue count should drop from 24 → 0
- **NUnit2046 (15)**: extend the prior regex sweep to also catch the
`Is.GreaterThan(n)` / `Is.GreaterThanOrEqualTo(n)` variants on
`.Count` and `.Length` — the previous pass only handled `Is.EqualTo`.
Affects PG/Snowflake `QueryBreakdownTests`, PG `StatementReaderTests`,
`LinqToSql` `QueryComparatorTests` / `QueryValidatorTests`,
`Markdown.Tests` `ExpressionGeneratorTests` /
`QueryBreakdownGeneratorTests`, and `JsonTokenReaderTests`.
- **CS8604 (8)**: `merged[someKey]` access inside `Assert.Multiple(() =>
{ ... })` lambdas where `someKey` is `string?` from `FirstOrDefault`.
The preceding `Assert.That(someKey, Is.Not.Null)` does not propagate
null-narrowing into the lambda scope, so add `!` to the dictionary
index. (Tests fail loud with a meaningful message if the key really
is null, so this is safe.)
- **NUnit2045 (1)**: wrap a four-assert block in
`JsonTokenReaderTests.cs:65-68` in `Assert.Multiple`. Mirrors the
surrounding two `Assert.Multiple` groups in that method.
All 1180 tests stay green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Drives the SonarQube
tests/open-issue count from 24 → 0. Non-breaking. Single commit.NUnit2046Is.GreaterThan(n)/Is.GreaterThanOrEqualTo(n)variants on.Countand.Length— the previous pass only handledIs.EqualToCS8604merged[someKey]insideAssert.Multiplelambdas wheresomeKeyisstring?fromFirstOrDefault. TheAssert.That(someKey, Is.Not.Null)immediately above does not propagate null-narrowing into the lambda scope, so the dictionary access gets!NUnit2045JsonTokenReaderTests.cs:65-68inAssert.Multiple, matching the surrounding twoAssert.Multiplegroups in that testAll 1180 tests stay green. Build clean (0 errors, pre-existing warnings unchanged).
Test plan
dotnet build Strata.SqlTools.QueryBreakdown.sln -c Release— 0 errorsdotnet test ... -c Release --no-build— 1180 passed, 0 failedsonarqube.ymlruns on this PR/api/issues/search?componentKeys=sql-utilities&resolved=false&facets=rules— open issue count should drop from 24 → 0- **NUnit2046 (15)**: extend the prior regex sweep to also catch the `Is.GreaterThan(n)` / `Is.GreaterThanOrEqualTo(n)` variants on `.Count` and `.Length` — the previous pass only handled `Is.EqualTo`. Affects PG/Snowflake `QueryBreakdownTests`, PG `StatementReaderTests`, `LinqToSql` `QueryComparatorTests` / `QueryValidatorTests`, `Markdown.Tests` `ExpressionGeneratorTests` / `QueryBreakdownGeneratorTests`, and `JsonTokenReaderTests`. - **CS8604 (8)**: `merged[someKey]` access inside `Assert.Multiple(() => { ... })` lambdas where `someKey` is `string?` from `FirstOrDefault`. The preceding `Assert.That(someKey, Is.Not.Null)` does not propagate null-narrowing into the lambda scope, so add `!` to the dictionary index. (Tests fail loud with a meaningful message if the key really is null, so this is safe.) - **NUnit2045 (1)**: wrap a four-assert block in `JsonTokenReaderTests.cs:65-68` in `Assert.Multiple`. Mirrors the surrounding two `Assert.Multiple` groups in that method. All 1180 tests stay green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>