webui: replace duplicated route and header literals with constants #66

Closed
opened 2026-10-19 15:26:42 +02:00 by pti · 0 comments
Owner

Sonar go:S1192 flags internal/webui/webui.go for the string /rules repeated 28 times, /requests 12 times, Content-Type 4 times, text/html charset utf-8 4 times, and invalid rule index 5 times. Hoist each into a package-level constant and use it at every site. Mechanical, one PR, no behaviour change, existing webui tests must stay green. Part of the SonarQube cleanup tracking issue.

Sonar go:S1192 flags internal/webui/webui.go for the string /rules repeated 28 times, /requests 12 times, Content-Type 4 times, text/html charset utf-8 4 times, and invalid rule index 5 times. Hoist each into a package-level constant and use it at every site. Mechanical, one PR, no behaviour change, existing webui tests must stay green. Part of the SonarQube cleanup tracking issue.
pti closed this issue 2026-10-19 15:49:33 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool#66
No description provided.