[Backend] S1172 unused-parameter family (74, incl. 28 unused CancellationTokens): rubric batch after the #632 baseline lands #641

Closed
opened 2026-07-17 05:41:12 +00:00 by spikerj · 1 comment
Owner

From the SonarQube triage loop (2026-07-17). 74 S1172 findings, 28 of them unused CancellationToken parameters — the classically dangerous subtype. Sampled with care:

  • SpaceZone command processors (bulk of the token subset): tokens are accepted for uniform dispatch-signature conformance; the methods do in-memory game-tick mutations with no awaits. Removing the parameters (the rule's fix) would break the uniform processor shape. FP-lean as a family.
  • ResidentArtPipeStageExecutor.MidJobDeathAsync: looked like a real shutdown-hang candidate (process-exit wait without the token) — but WaitForExitQuietlyAsync internally bounds the wait with a ShutdownGrace CTS, so it is benign; the parameter is aspirational.

Rubric for the batch: (a) uniform dispatch signature + no cancellable work → keep the parameter, FP with comment (or discard-name it); (b) cancellable work downstream that is NOT otherwise bounded → propagate the token (real fix); (c) genuinely dead non-token parameters → remove, checking for reflection/serializer call shapes first. Work it after the fresh #632 baseline so lines/counts are true. Related family style: #639 (S6667/S2139 telemetry fidelity).

From the SonarQube triage loop (2026-07-17). 74 S1172 findings, 28 of them unused CancellationToken parameters — the classically dangerous subtype. Sampled with care: - **SpaceZone command processors** (bulk of the token subset): tokens are accepted for uniform dispatch-signature conformance; the methods do in-memory game-tick mutations with no awaits. Removing the parameters (the rule's fix) would break the uniform processor shape. FP-lean as a family. - **ResidentArtPipeStageExecutor.MidJobDeathAsync**: looked like a real shutdown-hang candidate (process-exit wait without the token) — but WaitForExitQuietlyAsync internally bounds the wait with a ShutdownGrace CTS, so it is benign; the parameter is aspirational. **Rubric for the batch:** (a) uniform dispatch signature + no cancellable work → keep the parameter, FP with comment (or discard-name it); (b) cancellable work downstream that is NOT otherwise bounded → propagate the token (real fix); (c) genuinely dead non-token parameters → remove, checking for reflection/serializer call shapes first. Work it after the fresh #632 baseline so lines/counts are true. Related family style: #639 (S6667/S2139 telemetry fidelity).
Author
Owner

Family fully dispositioned; the fix component is merged. Final ledger for all 74 S1172 findings: 47 FP'd with per-site reasons (uniform dispatch shapes, documented stubs, keep-alive/conformance patterns, impossible-to-propagate tokens — StackExchange.Redis and Twilio SDK have no CT support); 3 token propagations FIXED in PR #350 (merged, 8/8 green); 12 dead parameters removed via #647/PR #352 (in CI); 9 held open in SonarQube as trackers for the three real defects the family exposed — #644 (cross-org chat authz gap), #645 (projectile tunneling + kill attribution), #646 (hierarchical A* never worked); 2 stub FPs; 1 feature question (notification bookId) left open deliberately. Closing this rubric ticket — the remaining work lives in its own tickets.

Family fully dispositioned; the fix component is merged. Final ledger for all 74 S1172 findings: 47 FP'd with per-site reasons (uniform dispatch shapes, documented stubs, keep-alive/conformance patterns, impossible-to-propagate tokens — StackExchange.Redis and Twilio SDK have no CT support); 3 token propagations FIXED in PR #350 (merged, 8/8 green); 12 dead parameters removed via #647/PR #352 (in CI); 9 held open in SonarQube as trackers for the three real defects the family exposed — #644 (cross-org chat authz gap), #645 (projectile tunneling + kill attribution), #646 (hierarchical A* never worked); 2 stub FPs; 1 feature question (notification bookId) left open deliberately. Closing this rubric ticket — the remaining work lives in its own tickets.
Sign in to join this conversation.