chore(quality): resolve SonarQube code smells across website #88
Reference in New Issue
Block a user
No description provided.
Delete Branch "chore/sonar-code-smells"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Clears all 124
CODE_SMELLfindings from the SonarQube scan of the website repo (server, client, and bot). Every change is a behaviour-preserving refactor — no route, protocol, schema, or config changes — so no Swagger regen ordocs/update is required.Verification
node --test, DB stubbed)shardEventsandregionBucketssuites that cover the two most substantial rewrites, plusapiClientcovering theclient.jschangesBy rule
update, block validation, notification-stream mapping (→ dispatch table), SSO mobile login, shard-ingest deps, uo-link socketbackfill/connect, the two bot slash-command dispatchers + discord manager, and theShard/UserDetail/HeroEditor/CharacterStatscomponentswithQs()helper;shardEvents.describe()rewritten as a formatter tableif/elsevars, lookup maps, small components, or guarded JSX expressions[0-9]→\d// { qr, otpauthUrl }) that parsed as code — not dead codeuseMemoon the Auth/Site context values (+SiteContext.brand)returnPATH_WEIGHTStuples resolves bothuseImageUpload()(s|m|h|d)→[smhd]; dropped redundantA-Zunder/i; town-name alternation → prefix listNotes / intentional exceptions
These remain and should be marked Won't Fix in Sonar (not code-fixed here):
trustProxy.jsparseTrustProxy/applyTrustProxyreturnnumber \| false \| string \| arrayby design (that's exactly what Express'strust proxysetting accepts).HeroEditorline/item editor lists keep index keys: they're edited by index and a content-derived key would remount the inputs and drop focus mid-edit. A proper fix needs synthetic ids in the persisted layout schema, which is out of scope for a lint pass.AI disclosure
AI-assisted (Claude). Commits carry the
Co-Authored-By: Claudetrailer per org policy.🤖 Generated with Claude Code