Skip to content

sonar: fix mechanical and new-code issues (batch 1) - #396

Merged
MPCoreDeveloper merged 1 commit into
masterfrom
sonar/mechanical-cleanup
Sep 4, 2026
Merged

sonar: fix mechanical and new-code issues (batch 1)#396
MPCoreDeveloper merged 1 commit into
masterfrom
sonar/mechanical-cleanup

Conversation

@MPCoreDeveloper

Copy link
Copy Markdown
Owner

First batch against the SonarCloud new-code issues on master (73 total):

  • BUG S1751 OverflowArena.TryReuseFreeBlock: loop could never iterate more than once -> single-attempt if (runtime-identical).
  • S1172/S8969 legacy delete-purge helpers (new code from the reopen data-integrity fix): drop unused pkCol parameter and redundant null-forgiving operators.
  • S3267 transactional delete-buffer loop -> Where.
  • S2325 Database.CanonicalDeleteStatementsParsed is static (tests updated).
  • S2701 FixedWidthRecordLayoutTests uses Assert.False.

Validated: SharpCoreDB.Tests 1777/0, CQRS 64/0.

Remaining (mostly S3776 cognitive-complexity on pre-existing large methods, 16-107) and mechanical items in benchmark/tests are tracked for follow-up batches.

- OverflowArena.TryReuseFreeBlock: the while loop could only ever run once (S1751 BUG); replaced with an equivalent single-attempt if
- Table.CRUD legacy delete purge helpers: remove unused pkCol parameter (S1172) and the redundant null-forgiving operator (S8969); transactional delete buffer loop uses Where (S3267); remove null-forgiving in relocation guard (S8969)
- Database.Core: CanonicalDeleteStatementsParsed is static (S2325); tests updated to static access
- FixedWidthRecordLayoutTests: Assert.False instead of Assert.Equal(false, ...) (S2701)
@MPCoreDeveloper
MPCoreDeveloper merged commit 38e095a into masterSep 4, 2026
1 check passed
@MPCoreDeveloper
MPCoreDeveloper deleted the sonar/mechanical-cleanup branch September 4, 2026 18:51
@sonarqubecloud

Copy link
Copy Markdown

Sign up for freeto 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

@MPCoreDeveloper