Skip to content

Merge dev into main#123

Merged
JE-Chen merged 3 commits intomainfrom
dev
Apr 24, 2026
Merged

Merge dev into main#123
JE-Chen merged 3 commits intomainfrom
dev

Conversation

@JE-Chen
Copy link
Copy Markdown
Member

@JE-Chen JE-Chen commented Apr 24, 2026

Summary

Promote SonarCloud + Codacy cleanup from PR #122 to the stable branch.

Dev-only commits being merged:

Test plan

JE-Chen added 3 commits April 24, 2026 23:25
Addresses all 25 open SonarCloud code issues and the corresponding
Codacy findings:

- Reduce cognitive complexity (S3776) by extracting helpers in
  diagram_mermaid_parser, diagram_scene, build_plugin_menu,
  ssh_command_widget, ssh_file_viewer_widget, and both pull_text methods.
- Extract duplicate literals (S1192) in i18n dicts.
- Bound regex quantifiers in the mermaid parser to prevent ReDoS (S5852).
- Remove unused variable nw (S1481), redundant list() calls (S7504),
  commented code (S125), always-True identity check (S5727).
- Rename KeyType -> key_cls (S117); list() -> [] (S7498);
  dict comprehension -> dict.fromkeys (S7519).
- Log rejected SSH key types instead of silent continue (Bandit B112).
- Bind free-port probe socket to 127.0.0.1 (Semgrep bind-all-interfaces).
- Remove unused pytest/sys/Path imports.
- Add [tool.bandit] in pyproject.toml to skip B101/B404 and exclude tests.
- Annotate intentional subprocess callsites with # nosec and rationale.
- Annotate scheme-detection http literal and SSRF-validated urlopen.
Addresses PR #122 follow-up findings:

- Sonar S7519: use dict.fromkeys in _assign_layers.
- Codacy duplication gate (new-code 4.8% > 3%): extract load_private_key
  to ssh_key_loader.py (used by both ssh_command_widget and
  ssh_file_viewer_widget) and pump_message_queue to queue_pump.py (used
  by both python_task_process_manager and test_pioneer_process_manager).
- Add # nosemgrep alongside # nosec on every intentional subprocess
  callsite so Semgrep's dangerous-subprocess/spawn-process/non-literal
  rules stop firing.
…dacy-issues

Fix SonarCloud and Codacy findings
@JE-Chen JE-Chen merged commit 9abea11 into main Apr 24, 2026
6 of 7 checks passed
@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.

@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