Skip to content

chore(quality): the local SonarQube findings of 2026-11-16, no behaviour change - #123

Merged
acn-ericlaw merged 1 commit into
mainfrom
chore/sonar-round-2026-11-16
Nov 16, 2026
Merged

acn-ericlaw merged 1 commit into
mainfrom
chore/sonar-round-2026-11-16

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Contributor

What

The code-quality findings of a local SonarQube round, fixed with no behaviour change, in lockstep with the Python pack's
round. Package: optional chains in otel/config.ts, otel/index.ts and otel/span.ts where a value was tested for
undefined first; the protobuf writer's buffer is readonly; the span mapper's display writes a type tag, never
[object Object] by accident, for a structure JSON cannot serialize, and handles numbers, bigints and symbols by their
own toString; the bus awaits the handler inside its traced callback (two async callbacks that had no await) and reads
a failure's status without a nested ternary. The fixture MCP server marks the two promises its close handler drops with
void. The LLM helper's duration pattern uses \d, its done-stop list is a Set, present is a function instead of a
nested ternary, and bedrockBackend(client, name, api) takes its defaulted parameters last (its one caller,
backendFor, follows). The MCP binding's server parser is split by transport (stdioServer, httpServer), describe
spells a tool's state without a nested ternary, and the server file's name is read as a string. Every .sort() in both
extensions takes an explicit comparator, byCodeUnit: the order Python's sorted() gives, so the canonical JSON behind
the shared digests, and every message the twin repeats, is byte for byte what it was - localeCompare, which the rule
suggests, would not have been. CHANGELOG Unreleased Changed 6. npm test: 469 tests, 405 passed, 0 failed, 64 skipped.

Why

A local SonarQube scan of the three repositories before the next AI SDLC sprint, triaged with Eric: the fixes above are
real and low-risk. Left by design: every await inside a loop (the OTLP retry backoff, the sequential health checks, the
bus worker loop, the binding's ordered boot and the paced streaming demo are sequential on purpose), the helper's nested
functions (closures over the factory's state), the protobuf parser's cognitive complexity (a flat wire-format walk under
full vector coverage), and the helper's JSON round trip of a content block, which is its deliberate normalization rather
than a deep copy.

🤖 Generated with Claude Code
Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

…our change

Optional chains where a value was tested for undefined first; the protobuf writer's buffer
readonly; the span mapper writes a type tag, never '[object Object]' by accident, for a
structure JSON cannot serialize; the bus awaits a handler inside its traced callback and
reads a failure's status without a nested ternary; the fixture MCP server marks the promises
it drops. The LLM helper's duration pattern uses \d, its done-stop set is a Set,
bedrockBackend(client, name, api) takes its defaulted parameters last; the MCP binding's
server parser is split by transport, its describe spells a tool's state without a nested
ternary and it reads the server file's name as a string. Every sort in both extensions takes
an explicit comparator that keeps the code-unit order Python's sorted() gives, so the
canonical JSON behind the shared digests is unchanged. npm test: 469 tests, 405 passed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit b7b9aae into main Nov 16, 2026
5 checks passed
@acn-ericlaw
acn-ericlaw deleted the chore/sonar-round-2026-11-16 branch November 16, 2026 07:57
acn-ericlaw added a commit that referenced this pull request Nov 16, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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