You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve outstanding Sonar and Codacy findings
Address the open issues reported by SonarCloud and Codacy on the
current branch so the quality gates pass on the next scan.
Library:
- Drop redundant isinstance(env_info, dict) checks in SMTP/IMAP
credential resolution (S2589); get_mail_thunder_os_environ always
returns a dict.
- Replace list()/dict() constructor calls with literals in
imap_wrapper for hot-path readability (S7498).
- Remove json.JSONDecodeError from the except tuple in json_file
since it is already a ValueError subclass (S5713).
- Iterate execute_action results via .values() in the socket server
handler (S7512).
- Extract the "/mail_thunder_content.json" literal into a module
constant in mail_thunder_content_save (S1192).
- Widen execute_action type hint to Union[list, dict] so dict
payloads with auto_control are correctly typed (S5655).
Tests:
- Generate fake credentials with secrets.token_hex instead of
hardcoded literals (S2068, B105).
- Drop unused result assignment, unused threading/tempfile/shutil
imports (S1481, F401).
- Replace try/except/pass with logged OSError handling in the
socket server teardown (B110).
- Mark CLI subprocess test calls with nosec since arguments are
test-controlled constants (B404, B603).
Tooling:
- Add .bandit and [tool.bandit] in pyproject.toml so Bandit skips
the test directory and B101, which is the standard pytest assert
pattern, eliminating ~85 noise findings.
0 commit comments