[hermes] atlasbot: python:S1871 #121
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's should_send logic, the if/elif at lines 167-170 has two branches with identical bodies (both just execute
should_send = True), which is exactly what S1871 flags as duplicate branch logic that should be merged into one condition.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— Theif snippet and snippet != last_note:andelif now - last_sent >= max(60.0, ...):branches both do nothing but setshould_send = True, so Sonar treats them as one branch mistakenly duplicated. Combining the two conditions withorinto a singleifeliminates the duplicate branch while leavingshould_send's resulting value identical for every possible input.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_9d944971f9014877924b26e26079074b). Hermes has no write access to this repository; no files or infrastructure were changed.