Fix SonarQube S1192 and S3776 issues in pkg/github/notifications.go - #150
eashansinha wants to merge 1 commit into
Conversation
Co-Authored-By: Eashan Sinha <eashan.sinha@cognition.ai>
Original prompt from Eashan
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|



Closes: N/A (SonarQube remediation)
Summary
Fixes high-severity SonarQube issues in
pkg/github/notifications.go:S1192 — duplicated string literals replaced with package-level constants:
paramOwner,paramRepo,paramAction,paramNotificationIDfor repeated parameter nameserrFailedToReadBodyFmtfor the 4x-repeated"failed to read response body: %w"format stringerrInvalidActionMessage,descRepositoryOwner,descRepositoryNameS3776 — cognitive complexity of the
ListNotificationshandler reduced by extracting:parseListNotificationsParams(request)— extracts/validates the six optional params into alistNotificationsParamsstructbuildNotificationListOptions(params)— buildsgithub.NotificationListOptionsincluding RFC3339 parsing ofsince/beforeNo behavior changes; error messages and tool schemas are identical.
Verification
go build ./...,go vet ./...,gofmtcleango test ./pkg/github/passesLink to Devin session: https://app.devin.ai/sessions/1db4c7c8dff14301acfe40dde84da912
Requested by: @eashansinha
Devin Review
fe58c75