[hermes] atlasbot: python:S1871 #161
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
SonarQube reports python:S1871 in
atlasbot/matrix/bot.py. The build is green; this is a standing finding, not a failure.What is wrong
In the heartbeat coroutine inside MatrixBot._answer_with_heartbeat, both the if branch (line 168) and the elif branch (line 170) execute the identical statement should_send = True. Sonar's S1871 flags the duplicated branch bodies; the two conditions should be merged into a single boolean expression.
Ariadne opened no pull request for it: no automated patch was possible for this finding.
Facts
atlasbot/matrix/bot.py:170)Suggested fix (not applied)
Hermes could not open a pull request for this, so the change below was not written, validated, or pushed anywhere. It is a starting point for whoever picks this up, not a reviewed patch.
atlasbot/matrix/bot.py— The if/elif at lines 167-170 has identical bodies (should_send = True), which is what python:S1871 objects to. Combining the two conditions with 'or' into a single assignment removes the duplicate branches while preserving the exact short-circuit evaluation order and truth conditions: send when the snippet changed, or when the periodic resend interval has elapsed. bool() is applied to the first operand so should_send stays a plain boolean rather than an empty string when snippet is falsy, matching the original False default.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_547553e65c054f0085121956dea34fc8). Hermes has no write access to this repository; no files or infrastructure were changed.