Fix branch-clone, rounding, cast, and remaining long-tail findings
- bugprone-branch-clone (12): fold genuinely identical switch arms
(typing status map, PM1 power levels, wake-cause names, glyph
fallback), merge the duplicated small-panel atlas ladder, rebuild
scaleFor as per-panel constexpr scale tables (lookup-table idiom),
restructure the modal confirm poll around explicit hold/press
predicates (also clears the DeMorgan finding), and NOLINT the one
per-SoC gated ADC calibration switch with rationale.
- bugprone-casting-through-void (13): use direct reinterpret_cast (the
documented pro-type-reinterpret-cast deviation) for byte/sockaddr
views; keep the SPI slot two-step through void* with rationale (it
exists to satisfy -Werror=cast-align next to the static_asserts).
- bugprone-incorrect-roundings (9): std::lroundf instead of +0.5 casts.
- cert-dcl50-cpp (5): rationale NOLINTs on the printf-style formatters
(a parameter pack cannot produce the va_list vsnprintf needs).
- cppcoreguidelines-pro-type-const-cast: const-correct the WordReader
ctx (API + trampoline + tests, const_cast deleted); NOLINT the two
std <cstring>-convention mutable overloads.
- Long tail: explicit void* casts + sizeof(T) rationale in rtos_queue,
range-for loop conversions, 0x80-mask instead of int8_t reinterpret
for the AXP2101 gauge, uint8_t slot subscript, parenthesized -1 pin
macros, extended the __wrap_log_printf ABI suppression to the
reserved-identifier aliases, integer-center tween targets.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
Fix branch-clone, rounding, cast, and remaining long-tail findings
- bugprone-branch-clone (12): fold genuinely identical switch arms
(typing status map, PM1 power levels, wake-cause names, glyph
fallback), merge the duplicated small-panel atlas ladder, rebuild
scaleFor as per-panel constexpr scale tables (lookup-table idiom),
restructure the modal confirm poll around explicit hold/press
predicates (also clears the DeMorgan finding), and NOLINT the one
per-SoC gated ADC calibration switch with rationale.
- bugprone-casting-through-void (13): use direct reinterpret_cast (the
documented pro-type-reinterpret-cast deviation) for byte/sockaddr
views; keep the SPI slot two-step through void* with rationale (it
exists to satisfy -Werror=cast-align next to the static_asserts).
- bugprone-incorrect-roundings (9): std::lroundf instead of +0.5 casts.
- cert-dcl50-cpp (5): rationale NOLINTs on the printf-style formatters
(a parameter pack cannot produce the va_list vsnprintf needs).
- cppcoreguidelines-pro-type-const-cast: const-correct the WordReader
ctx (API + trampoline + tests, const_cast deleted); NOLINT the two
std <cstring>-convention mutable overloads.
- Long tail: explicit void* casts + sizeof(T) rationale in rtos_queue,
range-for loop conversions, 0x80-mask instead of int8_t reinterpret
for the AXP2101 gauge, uint8_t slot subscript, parenthesized -1 pin
macros, extended the __wrap_log_printf ABI suppression to the
reserved-identifier aliases, integer-center tween targets.
Claude-Session: https://claude.ai/code/session_01SV58JXhfxhhc9DC6vdjBo4
Fix-first the reopened SonarCloud acceptances; document intrinsic exclusions
Remove the 28 hidden SonarCloud UI acceptances (reopened via API) in favor of the
project's fix-first + reviewable-in-repo-exclusion policy. Fix 5 with real,
behavior-preserving code changes:
- S924: merge the two nested breaks in the popup tickModal loop into one exit.
- S107: replace confirm()'s 9 params with a popup::ConfirmOptions struct (migrated
11 call sites: main + home/cred-detail/ble/settings/bond controllers).
- S3776: split OnboardingStateHandler::update() into per-phase update* helpers
(dispatch only), dropping its cognitive complexity under the limit.
- S3519: split the brand_registry copy guard so the length bound reaches the memcpy.
- S6177: apply "using enum i18n::StringId" to the moved settings label switches.
Document the remaining 23 as intrinsic exclusions in sonar-project.properties
(e32-e49), each with an embedded reason: variadic printf-family forwarders (S923 x5),
a macro consumed in #if (S5028), kernel-offset-advancing reads declared non-const
(S5817 x3), the strchr-style mutable-overload const_cast (S995/S859), the 5x7 font
glyph dispatch table (S1479), per-variant if-constexpr host selection (S3923), a
trivially-copyable move FP (S5500), the InplaceFunction implicit-conversion ctors
(S1709), the log-forward stub format (S5281), and the cohesive hardware panel-driver /
BLE facade+HID classes (S1448 x4, split tracked separately).
Verified: native 1168/1168, pio check clean, guards, full fleet -Werror (9 variants +
debug), and on-device smoke on Stick S3 (fresh onboarding provisioning + a
ConfirmOptions delete-confirm dialog).
Claude-Session: https://claude.ai/code/session_01Y7Cy1HetRp6TZAUAeekN8X