Skip to content

Sonar quality remediation — bulk smells & architecture tangles tracker #38

@sirdeggen

Description

@sirdeggen

Context

SonarCloud analysis of bsv-blockchain_ts-stack (org bsv) reports 2,663 unresolved issues as of analysis revision 3c4826e0 (2026-05-06).

Repo is currently 3 commits ahead of origin/main; recent local commits (notably 643bc750 sonar pass 1, a2ab5d20 sonar pass 1) have already addressed the high-priority items:

  • 2 BLOCKERs (typescript:S3516 — function always returns same value) → fixed locally in MockServices.ts and createAction.ts. Will auto-resolve on next analysis.
  • 1 BUG (typescript:S1763 — unreachable code) in WhatsOnChain.ts:544 → fixed locally. Will auto-resolve.
  • 1 VULNERABILITY (docker:S8543 — unlocked dependency versions) in packages/network/ts-p2p/Dockerfile → fixed in c4db5226. Will auto-resolve.

Once main is pushed and CI re-runs Sonar analysis, those 4 are off the board.

Project metrics

Metric Value
Lines of code 161,853
Open issues 2,663
Cyclomatic complexity 22,546
Cognitive complexity 20,781
Duplicated lines 9,792 (4.8%)
Duplicated blocks 439
Duplicated files 139

Issue breakdown by impact severity

Severity Count
BLOCKER 2 (already fixed locally)
HIGH 437
MEDIUM 658
LOW 1,594
INFO 63

Issue breakdown by type

Type Count
CODE_SMELL 2,661
BUG 1 (already fixed)
VULNERABILITY 1 (already fixed)

Architecture cycles (madge analysis)

Package Cycles
packages/sdk/src 32
packages/wallet/wallet-toolbox/src 174
packages/wallet/ts-wallet-relay/src 6
packages/helpers/simple/src 2
Total 214

See linked sub-issues per package.

Linked sub-issues

This issue tracks the follow-up effort. Sub-issues group remaining smells by rule (auto-fixable in batch) and architecture tangles per package.

Sub-issues

Architecture tangles

Bulk smells

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions