Preparing report...

Report for github.com/nyaruka/courier

A+    Excellent!    Found 56 issues across 163 files

Tweet

gofmt93%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo89%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • courier/handlers/whatsapp/whatsapp.go
    • Line 430: warning: cyclomatic complexity 36 of function (*handler).SendMsg() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 29 of function (*handler).receiveEvent() is high (> 15) (gocyclo)
    • Line 713: warning: cyclomatic complexity 20 of function sendWhatsAppMsg() is high (> 15) (gocyclo)
    • courier/handlers/viber/viber.go
    • Line 94: warning: cyclomatic complexity 30 of function (*handler).receiveEvent() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 23 of function (*handler).SendMsg() is high (> 15) (gocyclo)
    • courier/handlers/test.go
    • Line 210: warning: cyclomatic complexity 35 of function RunChannelSendTestCases() is high (> 15) (gocyclo)
    • Line 355: warning: cyclomatic complexity 26 of function RunChannelTestCases() is high (> 15) (gocyclo)

golint90%

Golint is a linter for Go source code.

    • courier/handlers/vk/vk.go
    • Line 73: warning: comment on exported var URLPhotoUploadServer should be of the form "URLPhotoUploadServer ..." (golint)
    • Line 488: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 529: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 564: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 595: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • courier/backends/rapidpro/msg.go
    • Line 494: warning: don't use underscores in Go names; struct field OrgID_ should be OrgID (golint)
    • Line 495: warning: don't use underscores in Go names; struct field ID_ should be ID (golint)
    • Line 497: warning: don't use underscores in Go names; struct field Direction_ should be Direction (golint)
    • Line 498: warning: don't use underscores in Go names; struct field Status_ should be Status (golint)
    • Line 499: warning: don't use underscores in Go names; struct field Visibility_ should be Visibility (golint)
    • Line 500: warning: don't use underscores in Go names; struct field HighPriority_ should be HighPriority (golint)
    • Line 501: warning: don't use underscores in Go names; struct field URN_ should be URN (golint)
    • Line 502: warning: don't use underscores in Go names; struct field URNAuth_ should be URNAuth (golint)
    • Line 503: warning: don't use underscores in Go names; struct field Text_ should be Text (golint)
    • Line 504: warning: don't use underscores in Go names; struct field Attachments_ should be Attachments (golint)
    • Line 505: warning: don't use underscores in Go names; struct field ExternalID_ should be ExternalID (golint)
    • Line 506: warning: don't use underscores in Go names; struct field ResponseToID_ should be ResponseToID (golint)
    • Line 507: warning: don't use underscores in Go names; struct field ResponseToExternalID_ should be ResponseToExternalID (golint)
    • Line 508: warning: don't use underscores in Go names; struct field IsResend_ should be IsResend (golint)
    • Line 509: warning: don't use underscores in Go names; struct field Metadata_ should be Metadata (golint)
    • Line 511: warning: don't use underscores in Go names; struct field ChannelID_ should be ChannelID (golint)
    • Line 512: warning: don't use underscores in Go names; struct field ContactID_ should be ContactID (golint)
    • Line 513: warning: don't use underscores in Go names; struct field ContactURNID_ should be ContactURNID (golint)
    • Line 515: warning: don't use underscores in Go names; struct field MessageCount_ should be MessageCount (golint)
    • Line 516: warning: don't use underscores in Go names; struct field ErrorCount_ should be ErrorCount (golint)
    • Line 518: warning: don't use underscores in Go names; struct field ChannelUUID_ should be ChannelUUID (golint)
    • Line 519: warning: don't use underscores in Go names; struct field ContactName_ should be ContactName (golint)
    • Line 521: warning: don't use underscores in Go names; struct field NextAttempt_ should be NextAttempt (golint)
    • Line 522: warning: don't use underscores in Go names; struct field CreatedOn_ should be CreatedOn (golint)
    • Line 523: warning: don't use underscores in Go names; struct field ModifiedOn_ should be ModifiedOn (golint)
    • Line 524: warning: don't use underscores in Go names; struct field QueuedOn_ should be QueuedOn (golint)
    • Line 525: warning: don't use underscores in Go names; struct field SentOn_ should be SentOn (golint)
    • Line 528: warning: don't use underscores in Go names; struct field SessionID_ should be SessionID (golint)
    • Line 529: warning: don't use underscores in Go names; struct field SessionTimeout_ should be SessionTimeout (golint)
    • Line 530: warning: don't use underscores in Go names; struct field SessionWaitStartedOn_ should be SessionWaitStartedOn (golint)
    • Line 531: warning: don't use underscores in Go names; struct field SessionStatus_ should be SessionStatus (golint)
    • Line 539: warning: exported method DBMsg.ID should have comment or be unexported (golint)
    • Line 540: warning: exported method DBMsg.EventID should have comment or be unexported (golint)
    • Line 541: warning: exported method DBMsg.UUID should have comment or be unexported (golint)
    • Line 542: warning: exported method DBMsg.Text should have comment or be unexported (golint)
    • Line 543: warning: exported method DBMsg.Attachments should have comment or be unexported (golint)
    • Line 544: warning: exported method DBMsg.ExternalID should have comment or be unexported (golint)
    • Line 545: warning: exported method DBMsg.URN should have comment or be unexported (golint)
    • Line 546: warning: exported method DBMsg.URNAuth should have comment or be unexported (golint)
    • Line 547: warning: exported method DBMsg.ContactName should have comment or be unexported (golint)
    • Line 548: warning: exported method DBMsg.HighPriority should have comment or be unexported (golint)
    • Line 549: warning: exported method DBMsg.ReceivedOn should have comment or be unexported (golint)
    • Line 550: warning: exported method DBMsg.SentOn should have comment or be unexported (golint)
    • Line 551: warning: exported method DBMsg.ResponseToID should have comment or be unexported (golint)
    • Line 552: warning: exported method DBMsg.ResponseToExternalID should have comment or be unexported (golint)
    • Line 553: warning: exported method DBMsg.IsResend should have comment or be unexported (golint)
    • Line 555: warning: exported method DBMsg.Channel should have comment or be unexported (golint)
    • Line 556: warning: exported method DBMsg.SessionStatus should have comment or be unexported (golint)
    • Line 558: warning: exported method DBMsg.QuickReplies should have comment or be unexported (golint)
    • Line 577: warning: exported method DBMsg.Topic should have comment or be unexported (golint)
    • courier/handlers/whatsapp/whatsapp.go
    • Line 352: warning: exported type LocalizableParam should have comment or be unexported (golint)
    • Line 356: warning: exported type Param should have comment or be unexported (golint)
    • Line 361: warning: exported type Component should have comment or be unexported (golint)
    • Line 847: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 881: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 924: warning: exported type TemplateMetadata should have comment or be unexported (golint)
    • Line 928: warning: exported type MsgTemplating should have comment or be unexported (golint)
    • courier/backends/rapidpro/contact.go
    • Line 222: warning: don't use underscores in Go names; struct field OrgID_ should be OrgID (golint)
    • Line 223: warning: don't use underscores in Go names; struct field ID_ should be ID (golint)
    • Line 225: warning: don't use underscores in Go names; struct field Name_ should be Name (golint)
    • Line 229: warning: don't use underscores in Go names; struct field CreatedOn_ should be CreatedOn (golint)
    • Line 230: warning: don't use underscores in Go names; struct field ModifiedOn_ should be ModifiedOn (golint)
    • Line 232: warning: don't use underscores in Go names; struct field CreatedBy_ should be CreatedBy (golint)
    • Line 233: warning: don't use underscores in Go names; struct field ModifiedBy_ should be ModifiedBy (golint)
    • Line 235: warning: don't use underscores in Go names; struct field IsNew_ should be IsNew (golint)
    • courier/backends/rapidpro/status.go
    • Line 301: warning: don't use underscores in Go names; struct field ChannelUUID_ should be ChannelUUID (golint)
    • Line 302: warning: don't use underscores in Go names; struct field ChannelID_ should be ChannelID (golint)
    • Line 303: warning: don't use underscores in Go names; struct field ID_ should be ID (golint)
    • Line 304: warning: don't use underscores in Go names; struct field OldURN_ should be OldURN (golint)
    • Line 305: warning: don't use underscores in Go names; struct field NewURN_ should be NewURN (golint)
    • Line 306: warning: don't use underscores in Go names; struct field ExternalID_ should be ExternalID (golint)
    • Line 307: warning: don't use underscores in Go names; struct field Status_ should be Status (golint)
    • Line 308: warning: don't use underscores in Go names; struct field ModifiedOn_ should be ModifiedOn (golint)
    • Line 313: warning: exported method DBMsgStatus.EventID should have comment or be unexported (golint)
    • Line 315: warning: exported method DBMsgStatus.ChannelUUID should have comment or be unexported (golint)
    • Line 316: warning: exported method DBMsgStatus.ID should have comment or be unexported (golint)
    • Line 318: warning: exported method DBMsgStatus.RowID should have comment or be unexported (golint)
    • Line 327: warning: exported method DBMsgStatus.SetUpdatedURN should have comment or be unexported (golint)
    • Line 344: warning: exported method DBMsgStatus.UpdatedURN should have comment or be unexported (golint)
    • Line 347: warning: exported method DBMsgStatus.HasUpdatedURN should have comment or be unexported (golint)
    • Line 354: warning: exported method DBMsgStatus.ExternalID should have comment or be unexported (golint)
    • Line 355: warning: exported method DBMsgStatus.SetExternalID should have comment or be unexported (golint)
    • Line 357: warning: exported method DBMsgStatus.Logs should have comment or be unexported (golint)
    • Line 358: warning: exported method DBMsgStatus.AddLog should have comment or be unexported (golint)
    • Line 360: warning: exported method DBMsgStatus.Status should have comment or be unexported (golint)
    • Line 361: warning: exported method DBMsgStatus.SetStatus should have comment or be unexported (golint)
    • courier/test.go
    • Line 161: warning: exported method MockBackend.ClearMsgSent should have comment or be unexported (golint)
    • Line 299: warning: comment on exported method MockBackend.RemoveURNfromContact should be of the form "RemoveURNfromContact ..." (golint)
    • courier/handlers/freshchat/freshchat.go
    • Line 243: warning: exported type Messages should have comment or be unexported (golint)
    • Line 249: warning: exported type Users should have comment or be unexported (golint)
    • Line 258: warning: exported type Actor should have comment or be unexported (golint)
    • Line 262: warning: exported type Text should have comment or be unexported (golint)
    • Line 265: warning: exported type MessageParts should have comment or be unexported (golint)
    • Line 269: warning: exported type Message should have comment or be unexported (golint)
    • Line 280: warning: exported type Data should have comment or be unexported (golint)
    • Line 283: warning: exported type Image should have comment or be unexported (golint)
    • courier/backends/rapidpro/channel.go
    • Line 277: warning: don't use underscores in Go names; struct field OrgID_ should be OrgID (golint)
    • Line 278: warning: don't use underscores in Go names; struct field ID_ should be ID (golint)
    • Line 279: warning: don't use underscores in Go names; struct field ChannelType_ should be ChannelType (golint)
    • Line 280: warning: don't use underscores in Go names; struct field Schemes_ should be Schemes (golint)
    • Line 282: warning: don't use underscores in Go names; struct field Name_ should be Name (golint)
    • Line 283: warning: don't use underscores in Go names; struct field Address_ should be Address (golint)
    • Line 284: warning: don't use underscores in Go names; struct field Country_ should be Country (golint)
    • Line 285: warning: don't use underscores in Go names; struct field Config_ should be Config (golint)
    • Line 286: warning: don't use underscores in Go names; struct field Role_ should be Role (golint)
    • Line 288: warning: don't use underscores in Go names; struct field OrgConfig_ should be OrgConfig (golint)
    • Line 289: warning: don't use underscores in Go names; struct field OrgIsAnon_ should be OrgIsAnon (golint)
    • courier/backends/rapidpro/channel_event.go
    • Line 24: warning: exported const NilChannelEventID should have comment or be unexported (golint)
    • Line 186: warning: don't use underscores in Go names; struct field ID_ should be ID (golint)
    • Line 187: warning: don't use underscores in Go names; struct field OrgID_ should be OrgID (golint)
    • Line 188: warning: don't use underscores in Go names; struct field ChannelUUID_ should be ChannelUUID (golint)
    • Line 189: warning: don't use underscores in Go names; struct field ChannelID_ should be ChannelID (golint)
    • Line 190: warning: don't use underscores in Go names; struct field URN_ should be URN (golint)
    • Line 191: warning: don't use underscores in Go names; struct field EventType_ should be EventType (golint)
    • Line 192: warning: don't use underscores in Go names; struct field Extra_ should be Extra (golint)
    • Line 193: warning: don't use underscores in Go names; struct field OccurredOn_ should be OccurredOn (golint)
    • Line 194: warning: don't use underscores in Go names; struct field CreatedOn_ should be CreatedOn (golint)
    • Line 196: warning: don't use underscores in Go names; struct field ContactName_ should be ContactName (golint)
    • Line 197: warning: don't use underscores in Go names; struct field ContactID_ should be ContactID (golint)
    • Line 198: warning: don't use underscores in Go names; struct field ContactURNID_ should be ContactURNID (golint)
    • Line 204: warning: exported method DBChannelEvent.EventID should have comment or be unexported (golint)
    • Line 205: warning: exported method DBChannelEvent.ChannelID should have comment or be unexported (golint)
    • Line 206: warning: exported method DBChannelEvent.ChannelUUID should have comment or be unexported (golint)
    • Line 207: warning: exported method DBChannelEvent.ContactName should have comment or be unexported (golint)
    • Line 208: warning: exported method DBChannelEvent.URN should have comment or be unexported (golint)
    • Line 209: warning: exported method DBChannelEvent.Extra should have comment or be unexported (golint)
    • Line 215: warning: exported method DBChannelEvent.EventType should have comment or be unexported (golint)
    • Line 216: warning: exported method DBChannelEvent.OccurredOn should have comment or be unexported (golint)
    • Line 217: warning: exported method DBChannelEvent.CreatedOn should have comment or be unexported (golint)
    • Line 218: warning: exported method DBChannelEvent.Channel should have comment or be unexported (golint)
    • Line 220: warning: exported method DBChannelEvent.WithContactName should have comment or be unexported (golint)
    • Line 224: warning: exported method DBChannelEvent.WithExtra should have comment or be unexported (golint)
    • Line 230: warning: exported method DBChannelEvent.WithOccurredOn should have comment or be unexported (golint)
    • Line 235: warning: exported method DBChannelEvent.Logs should have comment or be unexported (golint)
    • Line 236: warning: exported method DBChannelEvent.AddLog should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign89%

IneffAssign detects ineffectual assignments in Go code.


misspell93%

Misspell Finds commonly misspelled English words