Skip to content

sonar(tests): long tail, 3 single findings - #300

Merged
Zafnok merged 2 commits into
mainfrom
sonar/tests-tail-182
Sep 29, 2026
Merged

Zafnok merged 2 commits into
mainfrom
sonar/tests-tail-182

Conversation

@Zafnok

@Zafnok Zafnok commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Clears the three one-off Sonar findings under tests/. All three still reproduced on HEAD (641e318); line numbers had drifted for two of them.

Finding Fix
TypeMapperTests.cs xUnit1045 (TheoryData<string, IrValue>) [MemberData(nameof(Defaults), DisableDiscoveryEnumeration = true)], the same fix ConfigEqualityTests and ApiEquivalenceLoweringTests already use
LoweringOracleGen.cs S3218 (Call.Method shadows the outer Method property) renamed the positional property to Callee
PairGen.cs CS9236 (nested lambdas in Pairs bound 100+ times) moved the innermost per-site lambda into a named Mutants(op, rendered) method

Acceptance criteria

  1. Each finding fixed or accepted: all three are fixed (table above), and none were accepted into policy.jsonc.
  2. Severities pinned: .editorconfig [tests/**.cs] now sets dotnet_diagnostic.xUnit1045.severity = error and dotnet_diagnostic.CS9236.severity = error. With both at error, CI's build is what proves no other test file trips either rule.
  3. ./build.ps1 -Integration green: see CI on this PR.
  4. No pragma, coverage exclusion or lowered gate: none added. Only test code changed, so src/ coverage is unaffected.

Closes #182

🤖 Generated with Claude Code

Zafnok and others added 2 commits September 29, 2026 18:29
- TypeMapperTests: IrValue theory data uses DisableDiscoveryEnumeration (xUnit1045),
  matching ConfigEqualityTests and ApiEquivalenceLoweringTests.
- LoweringOracleGen: Call.Method renamed Callee so it no longer shadows
  the outer Method property (S3218).
- PairGen: the per-site mutant lambda moves to a named Mutants method so
  the nested lambdas in Pairs bind once (CS9236).

Pins dotnet_diagnostic.xUnit1045 and CS9236 severity = error for tests/.

Ticket: GH-182

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…method (CS9236)

The pinned CS9236 found a second site: the nested Sum lambdas in Count.

Ticket: GH-182

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@Zafnok
Zafnok merged commit 524fd64 into main Sep 29, 2026
18 checks passed
@Zafnok
Zafnok deleted the sonar/tests-tail-182 branch September 29, 2026 23:30
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.

sonar(tests): long tail, 3 single findings

1 participant