[hermes] pegasus: go:S3776 #36
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 go:S3776 in
backend/uploads.go. The build is green; this is a standing finding, not a failure.What is wrong
sanitizeDescriptor exceeds the cognitive-complexity threshold largely because it combines character classification with normalization and truncation control flow. Extracting the character-validity predicate preserves the exact sanitization behavior while reducing the method's complexity.
Ariadne opened no pull request for it: no automated patch was possible for this finding.
Facts
backend/uploads.go:21)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.
backend/uploads.go— Move the allowed-character check into a small helper. sanitizeDescriptor retains the same substitutions, underscore collapsing, and 64-rune limit, but no longer contains the compound classification expression that contributes to its cognitive complexity.Links
/api/admin/audit/events, event typeshermes_autotriage_incidentandhermes_autotriage_diagnosis.Filed automatically by Ariadne from a Hermes Agent diagnosis (run run_e6eb8a43eb654737ba586cb2a82bb8e4). Hermes has no write access to this repository; no files or infrastructure were changed.