[hermes] atlasbot: python:S1871 #141
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, the if branch on line 168 and the elif branch on line 170 both do the same thing (set should_send = True). SonarQube rule python:S1871 flags identical branch bodies because they usually indicate either a copy-paste mistake or conditions that should be merged; here the two conditions are intentionally alternatives, so the branches 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 arms both assign should_send = True, differing only in their conditions. Combining the two conditions withorinto a single boolean assignment removes the duplicated branch body while preserving the exact short-circuit semantics: the second condition is only evaluated when the first is falsy, same as the original elif.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_df7dab83e6f043d6aba768a053e23f0b). Hermes has no write access to this repository; no files or infrastructure were changed.