Fix/sonarqube critical major debt #11

Merged
bermudalamb merged 10 commits from fix/sonarqube-critical-major-debt into main 2026-05-26 10:36:29 -05:00
Owner
No description provided.
bermudalamb added 10 commits 2026-05-26 10:35:59 -05:00
- LinqQueryBreakdown.cs:211 - drop unused `expr` pattern binding (type test remains)
- LinqQueryBreakdown.cs:279 - drop unused `firstEntity` (empty check already above)
- LinqExpressionVisitor.cs:315 - drop unused `param` pattern binding

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- WithClause.RecursiveQuery and WithClause.ColumnList had get/set bodies that
  only forwarded to private backing fields. Convert both to auto-properties
  and remove the now-orphaned _recursiveQuery / _columnList fields.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SqlServer/Breakdowns/QueryBreakdown.cs:26 — _clausesCacheDirty was both
initialized inline (= true) and re-assigned in the constructor at line 56.
Drop the inline initializer; the ctor remains authoritative.

The four nearby S3604 false-positives on clause backing fields stay
suppressed via #pragma — they are write-through targets of cache-invalidating
property setters.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Rules/Rule/Groups/With.GetExpressions only called base.GetExpressions(). The
comment 'do some ordering here??' indicates the override is a TODO stub.
Drop the override and preserve the intent as an inline TODO on the class.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
LinqExpressionVisitor._tableName was only assigned and read inside
VisitConstant immediately before assigning FromClause. Drop the field
entirely and assign FromClause directly from entityType.Name.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Snowflake/Breakdowns/ProcedureBreakdown.ParseCallParameters — replace the
foreach over a MatchCollection with a .Cast<Match>().Select(m => m.Groups)
projection. The loop now iterates GroupCollection values directly, indexing
groups[1] and groups[2] for name/value without rebinding the Match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
S2342 requires [Flags] enums to use plural names. Both enums have zero
references anywhere in the repo today.

- ConstraintType -> ConstraintTypes
- TriggerType    -> TriggerTypes

BREAKING CHANGE: external NuGet consumers (if any) referencing these
singular-named types will need to update to the plural names. Internal
codebase has no references.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codifies (A) how to query the bermudalamb SonarQube 9.9 server's web API
from PowerShell — Basic auth with token-as-username, the
SONARQUBE_URL trailing-slash gotcha, the useful endpoints for triage and
Won't Fix transitions; and (B) the per-rule-group cleanup loop (query →
pick → edit → build → test → commit → scan → verify).

References memory sonarqube-wontfix-rules rather than duplicating the
catalog. Frontmatter follows superpowers:writing-skills (description is
triggering conditions only, no workflow summary).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CS8601 is reported via external_roslyn on the SonarQube server, which does
not expose transitions for external-analyzer issues — so a server-side
Won't Fix is not available. Silence locally with a narrow pragma so the
issue stops appearing in subsequent scans.

Justification: Parameters is Dictionary<string, object> (non-nullable
value annotation), but a SQL parameter value can legitimately be null.
The proper fix is to widen the public dictionary value type to object?,
which ripples through every consumer of QueryBreakdown.Parameters —
deferred to a separate change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chore: gitignore SonarScanner local artifacts
SonarQube Analysis / sonarqube (pull_request) Successful in 3m7s
b3020a0a20
Add .sonarqube/ (created by dotnet sonarscanner begin) and scan.log
(from local scan-sonar.ps1 diagnostics) so they don't accidentally
get committed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bermudalamb merged commit 3010019dc5 into main 2026-05-26 10:36:29 -05:00
bermudalamb deleted branch fix/sonarqube-critical-major-debt 2026-05-26 10:36:31 -05:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Lambda-Associates/sql-utilities#11