refactor: reduce cognitive complexity of bandwidthChecker.emitWindowMetric - #181
Conversation
…etric SonarCloud flagged emitWindowMetric at a cognitive complexity of 19 against a limit of 15 (from #180, merged before this fix landed). Extracts the threshold evaluation and label-building into their own functions - no behavior change.
|
Claude finished @joshiste's task in 1m 14s —— View job Claude's ReviewTasks:
SummaryThis is a clean, mechanical refactor that extracts two pure helper functions —
No concurrency issues — both extracted functions operate purely on values already copied out from under No bugs, security, or performance issues found in the diff. Nothing outstanding to flag. Note: I was unable to run |
|



Summary
SonarCloud flagged
emitWindowMetric's cognitive complexity at 19 against the 15 allowed (surfaced on #180, which merged before this fix could land). Extracts the threshold evaluation (isWithinThreshold) and label-building (windowMetricLabels) into their own functions - no behavior change, same tests pass unmodified.Test plan
go test ./exthttpcheck/...(including-race) passesgo build,go vet,gofmt -lclean