Clear SonarCloud + Codacy static-analysis backlog#431
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | -4 |
| Duplication | 0 |
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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)
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.command_schema"Native UI"×67 + placeholders,".approvals"across executor/handlers, flow_editor submodule paths).if(http_cassette), flatten nested ternaries (assertions, color_match), drop redundantFileNotFoundErroralready covered byOSError(notifier), prune expired leases after iterating instead of alist()copy — also fixed a latent mutate-during-iteration (credential_broker), extract_signal_partsto cut cognitive complexity 18→<15 (element_scoring), unused locals →_(form_fields), valid# NOSONARsyntax (stats), keep thetimeoutparam sinceasyncio.timeout()needs 3.11+ and the project supports 3.10 (webrtc_transport).Image→pil_image,dict()→literal, comprehension→list(), dropped gratuitousis not None, reworded code-like comments (S125), documented the empty timer block (S108),definstead of an always-true identity-check lambda (S5727), boto3Bucket/Prefix/KeyAPI names justified (S117).self→globalThis(sw.js, S7764),aria-labelon file/select/token inputs (InputWithoutLabelCheck), valid// NOSONARon the non-module top-level-await line (S7785).Codacy (3 → 0)
QApplicationcreate instead of a bareorexpression (test_remote_desktop_cursor).# nosemgrepon the WebSocketSec-WebSocket-Accepthandshake (SHA-1 is mandated by RFC 6455; alreadyusedforsecurity=False).# nosemgrepon the local-CLIsubprocess.rundiagnostics test.Verifications:
ruffclean on all changedje_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.