Skip to content

Fix SonarCloud reliability issues across monorepo#206

Open
sirdeggen wants to merge 1 commit into
mainfrom
worktree-sonar-reliability
Open

Fix SonarCloud reliability issues across monorepo#206
sirdeggen wants to merge 1 commit into
mainfrom
worktree-sonar-reliability

Conversation

@sirdeggen

Copy link
Copy Markdown
Contributor

Summary

  • Resolves 166 SonarCloud reliability findings driving the project's reliability rating
  • Mix of mechanical lint fixes and genuine logic corrections; behavior preserved throughout
  • Patch-bumps the 4 published packages whose shipped source changed

Changes

  • Cosmetic (behavior-preserving): NaNNumber.NaN, parseInt/isNaNNumber.*, charCodeAtcodePointAt, Array(n)new Array(n), global .replace.replaceAll, x | 0Math.trunc(x), shell [ ][[ ]]
  • Logic fixes: Hash.ts loop-counter reassignment (S2310); message-box-server mutable let export → const container (S6861, no external consumers); ts-p2p async-in-constructor → startupPromise + ready() (S7059, auto-start preserved); sort comparators (S2871); unreachable code (S1763); identical branches (S3923); empty-Map test (S4158); ARIA attrs in SearchBox.tsx
  • Skipped (with reason): Hash.ts surrogate-pair charCodeAt, benchmark | 0 32-bit RNG coercion, generated asyncapi HTML, minified vendor CSS, live/manual test stubs
  • Version bumps: @bsv/sdk 2.1.6, @bsv/teranode-listener 1.0.5, @bsv/uhrp-lite 0.1.4, @bsv/uhrp-storage-server 0.2.5 (own version field only; lockfile untouched)

Test plan

  • @bsv/sdk suite green (1142 passed locally incl. Hash/DRBG)
  • @bsv/wallet-toolbox suite green (manual/live tests compile-only)
  • message-box-server Docker image builds + runs (mutable-export refactor)
  • SonarCloud reliability rating improves on this branch

Fix 166 reliability findings: Number.NaN/Number.parseInt, codePointAt,
new Array(), replaceAll, Math.trunc, [[ ]] shell tests, plus genuine
logic fixes (Hash.ts loop counter, message-box-server mutable export,
ts-p2p async constructor, sort comparators, unreachable code). Patch-bump
@bsv/sdk, @bsv/teranode-listener, @bsv/uhrp-lite, @bsv/uhrp-storage-server.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.3% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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