Skip to content

Clear SonarCloud + Codacy static-analysis backlog#431

Merged
JE-Chen merged 1 commit into
devfrom
chore/static-analysis-backlog
Jun 25, 2026
Merged

Clear SonarCloud + Codacy static-analysis backlog#431
JE-Chen merged 1 commit into
devfrom
chore/static-analysis-backlog

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 25, 2026

Copy link
Copy Markdown
Member

Resolves the open SonarCloud (193) and Codacy (3) findings surfaced via the issue APIs. Full headless suite green (3803 passed); no behavioral changes.

SonarCloud (193 → 0 targeted)

  • S1172 (141) — the accessibility backend ABC (backends/base.py) default methods now pass their arguments through to _unsupported(*context), so the explicit signatures required for fake-backend overrides (pylint W0221) are preserved without "unused parameter" findings.
  • S1192 (13) — extracted duplicated literals to module constants (command_schema "Native UI" ×67 + placeholders, ".approvals" across executor/handlers, flow_editor submodule paths).
  • Code smells — merge nested if (http_cassette), flatten nested ternaries (assertions, color_match), drop redundant FileNotFoundError already covered by OSError (notifier), prune expired leases after iterating instead of a list() copy — also fixed a latent mutate-during-iteration (credential_broker), extract _signal_parts to cut cognitive complexity 18→<15 (element_scoring), unused locals → _ (form_fields), valid # NOSONAR syntax (stats), keep the timeout param since asyncio.timeout() needs 3.11+ and the project supports 3.10 (webrtc_transport).
  • Security S8707 (4) — the flagged paths are operator-supplied CLI arguments or a hardcoded constant (config_bundle import, turn_config, host_service, stubs generator), not a remote trust boundary; suppressed with justification.
  • TestsImagepil_image, dict()→literal, comprehension→list(), dropped gratuitous is not None, reworded code-like comments (S125), documented the empty timer block (S108), def instead of an always-true identity-check lambda (S5727), boto3 Bucket/Prefix/Key API names justified (S117).
  • FrontendselfglobalThis (sw.js, S7764), aria-label on file/select/token inputs (InputWithoutLabelCheck), valid // NOSONAR on the non-module top-level-await line (S7785).

Codacy (3 → 0)

  • W0106 — guard the QApplication create instead of a bare or expression (test_remote_desktop_cursor).
  • SHA-1# nosemgrep on the WebSocket Sec-WebSocket-Accept handshake (SHA-1 is mandated by RFC 6455; already usedforsecurity=False).
  • subprocess# nosemgrep on the local-CLI subprocess.run diagnostics test.

Verifications: ruff clean on all changed je_auto_control/ files; targeted pylint clean (remaining items are pre-existing cv2 false positives / ≤7-arg functions the project allows); 135 accessibility tests + full headless suite (3803) green. Real fixes preferred over suppression; suppressions used only where the finding is a false positive or a protocol/CLI requirement, each with an inline justification.

Resolve the open SonarCloud (193) and Codacy (3) findings:

- S1172 (141): accessibility backend ABC default methods now pass their
  args through to _unsupported(*context), so the explicit signatures
  required for fake-backend overrides (W0221) are kept without unused
  parameters.
- S1192 (13): extract duplicated literals to module constants
  (command_schema "Native UI" x67, placeholders, ".approvals", flow_editor
  submodule paths).
- Code smells: merge nested if (http_cassette), flatten nested ternaries
  (assertions, color_match), drop redundant FileNotFoundError (notifier),
  prune expired leases after iteration instead of list() copy
  (credential_broker), extract _signal_parts to cut cognitive complexity
  (element_scoring), unused locals -> _ (form_fields), valid NOSONAR
  syntax (stats), keep timeout param for 3.10 (webrtc_transport).
- Security S8707 (4): justify the CLI/operator-supplied paths
  (config_bundle, turn_config, host_service, stubs) — not a remote
  trust boundary.
- Tests: rename Image->pil_image, dict()->literal, comprehension->list(),
  drop gratuitous truthiness, reword code-like comments, guard the empty
  block, def instead of identity-check lambda, boto3 API names justified.
- Frontend: self->globalThis (sw.js), aria-labels on inputs, valid
  NOSONAR on the non-module top-level-await line.
- Codacy: guard QApplication create (W0106), nosemgrep on the protocol
  SHA-1 handshake and the local-CLI subprocess test.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics -4 complexity · 0 duplication

Metric Results
Complexity -4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit 40b7e3d into dev Jun 25, 2026
16 checks passed
@JE-Chen JE-Chen deleted the chore/static-analysis-backlog branch June 25, 2026 03:39
@sonarqubecloud

Copy link
Copy Markdown

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