[hermes] atlasbot: python:S1871 #130
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/elif chain at lines 167-170 has two branches with identical bodies: both
if snippet and snippet != last_note:andelif now - last_sent >= max(60.0, self._settings.thinking_interval_sec * 2):just setshould_send = True. Sonar flags this duplication; the two conditions should be merged into one boolean expression withor.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— Replace theshould_send = Falseflag and the if/elif chain (lines 166-170) with a single boolean assignment. Because if/elif evaluates the second condition only when the first is false, combining the conditions with short-circuitoris exactly equivalent: a heartbeat is still sent when the snippet changed, or when the resend interval has elapsed. Thebool()wrapper keepsshould_senda bool even whensnippetis an empty string, and the subsequentif should_send:block is unchanged.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_3f4f1186a08d48a486c2fa4c219cc71b). Hermes has no write access to this repository; no files or infrastructure were changed.