Preparing report...

Report for github.com/Supme/gonder

A+    Excellent!    Found 33 issues across 49 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


golint53%

Golint is a linter for Go source code.

    • gonder/models/config.go
    • Line 32: warning: exported var Db should have comment or be unexported (golint)
    • Line 205: warning: exported function WorkDir should have comment or be unexported (golint)
    • gonder/campaign/sender.go
    • Line 12: warning: exported type SendType should have comment or be unexported (golint)
    • Line 15: warning: exported const SendTypeStream should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function GetResultFunc should have comment or be unexported (golint)
    • Line 46: warning: exported var Sending should have comment or be unexported (golint)
    • gonder/models/group.go
    • Line 10: warning: exported type Group should have comment or be unexported (golint)
    • Line 12: warning: exported method Group.IntID should have comment or be unexported (golint)
    • Line 16: warning: exported method Group.StringID should have comment or be unexported (golint)
    • Line 20: warning: exported type GroupCampaign should have comment or be unexported (golint)
    • Line 28: warning: exported method Group.Campaigns should have comment or be unexported (golint)
    • Line 32: warning: exported type GroupUnsubscribed should have comment or be unexported (golint)
    • Line 40: warning: exported method GroupUnsubscribed.Validate should have comment or be unexported (golint)
    • Line 48: warning: exported method Group.Unsubscribed should have comment or be unexported (golint)
    • gonder/models/json.go
    • Line 8: warning: exported type JSONResponse should have comment or be unexported (golint)
    • Line 13: warning: exported method JSONResponse.OkWriter should have comment or be unexported (golint)
    • Line 18: warning: exported method JSONResponse.ErrorWriter should have comment or be unexported (golint)
    • gonder/models/user.go
    • Line 11: warning: exported var ErrUserInvalidPassword should have comment or be unexported (golint)
    • Line 15: warning: exported type User should have comment or be unexported (golint)
    • Line 24: warning: exported function UserGetByID should have comment or be unexported (golint)
    • Line 41: warning: exported function UserGetByName should have comment or be unexported (golint)
    • Line 58: warning: exported function UserGetByNameAndPassword should have comment or be unexported (golint)
    • Line 100: warning: exported method User.IsAdmin should have comment or be unexported (golint)
    • Line 105: warning: exported method User.Add should have comment or be unexported (golint)
    • Line 141: warning: exported method User.Update should have comment or be unexported (golint)
    • gonder/panel/embeded.go
    • Line 7: warning: comment on exported var Assets should be of the form "Assets ..." (golint)
    • Line 10: warning: comment on exported var Index should be of the form "Index ..." (golint)
    • gonder/models/campaign.go
    • Line 14: warning: exported type Campaign should have comment or be unexported (golint)
    • Line 16: warning: exported method Campaign.IntID should have comment or be unexported (golint)
    • Line 20: warning: exported method Campaign.StringID should have comment or be unexported (golint)
    • Line 24: warning: exported function CampaignGetByID should have comment or be unexported (golint)
    • Line 28: warning: exported function CampaignGetByStringID should have comment or be unexported (golint)
    • Line 45: warning: exported method Campaign.HasNotSent should have comment or be unexported (golint)
    • Line 49: warning: exported method Campaign.CountNotSent should have comment or be unexported (golint)
    • Line 62: warning: exported method Campaign.CountResend should have comment or be unexported (golint)
    • Line 66: warning: exported method Campaign.HasResend should have comment or be unexported (golint)
    • Line 70: warning: exported type CampaignReportRecipients should have comment or be unexported (golint)
    • Line 82: warning: exported method CampaignReportRecipients.Validate should have comment or be unexported (golint)
    • Line 95: warning: exported method Campaign.ReportRecipients should have comment or be unexported (golint)
    • Line 109: warning: exported type CampaignReportUnsubscribed should have comment or be unexported (golint)
    • Line 116: warning: exported method CampaignReportUnsubscribed.Validate should have comment or be unexported (golint)
    • Line 124: warning: exported method Campaign.ReportUnsubscribed should have comment or be unexported (golint)
    • Line 134: warning: exported type CampaignReportQuestion should have comment or be unexported (golint)
    • Line 142: warning: exported method CampaignReportQuestion.Validate should have comment or be unexported (golint)
    • Line 150: warning: exported method Campaign.ReportQuestion should have comment or be unexported (golint)
    • Line 162: warning: exported type CampaignReportClicks should have comment or be unexported (golint)
    • Line 169: warning: exported method CampaignReportClicks.Validate should have comment or be unexported (golint)
    • Line 171: warning: exported method Campaign.ReportClicks should have comment or be unexported (golint)
    • Line 185: warning: exported type UserAgent should have comment or be unexported (golint)
    • Line 197: warning: exported method UserAgent.Parse should have comment or be unexported (golint)
    • Line 246: warning: exported type CampaignReportUserAgent should have comment or be unexported (golint)
    • Line 256: warning: exported method CampaignReportUserAgent.Validate should have comment or be unexported (golint)
    • Line 267: warning: exported method Campaign.ReportUserAgent should have comment or be unexported (golint)
    • gonder/models/database.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 12: warning: exported function ConnectDb should have comment or be unexported (golint)
    • Line 27: warning: exported function CheckDb should have comment or be unexported (golint)
    • gonder/models/message.go
    • Line 13: warning: exported type Message should have comment or be unexported (golint)
    • Line 21: warning: exported method Message.New should have comment or be unexported (golint)
    • Line 54: warning: exported method Message.Form should have comment or be unexported (golint)
    • gonder/api/auth.go
    • Line 12: warning: exported type Auth should have comment or be unexported (golint)
    • Line 16: warning: exported function AuthHandler should have comment or be unexported (golint)
    • Line 46: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 51: warning: exported method Auth.GroupRight should have comment or be unexported (golint)
    • Line 69: warning: exported method Auth.CampaignRight should have comment or be unexported (golint)
    • Line 87: warning: exported method Auth.Right should have comment or be unexported (golint)
    • Line 103: warning: exported method Auth.IsAdmin should have comment or be unexported (golint)
    • Line 107: warning: comment on exported function Logout should be of the form "Logout ..." (golint)
    • gonder/campaign/recipient.go
    • Line 10: warning: exported type Recipient should have comment or be unexported (golint)
    • Line 19: warning: exported function GetRecipient should have comment or be unexported (golint)
    • Line 71: warning: exported method Recipient.WebHTML should have comment or be unexported (golint)
    • gonder/models/const.go
    • Line 4: warning: exported var AppVersion should have comment or be unexported (golint)
    • Line 10: warning: exported const OpenTrace should have comment (or a comment on this block) or be unexported (golint)
    • gonder/models/helpers.go
    • Line 21: warning: exported function GetIP should have comment or be unexported (golint)
    • Line 48: warning: exported function NewCSVWriter should have comment or be unexported (golint)
    • Line 68: warning: exported function Conv1st2nd should have comment or be unexported (golint)
    • Line 96: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 106: warning: exported function NewLogfile should have comment or be unexported (golint)
    • Line 146: warning: comment on exported function Bad_GetDomainFromEmail should be of the form "Bad_GetDomainFromEmail ..." (golint)
    • Line 147: warning: don't use underscores in Go names; func Bad_GetDomainFromEmail should be BadGetDomainFromEmail (golint)
    • Line 154: warning: exported function GetStatusCodeFromSendResult should have comment or be unexported (golint)
    • Line 166: warning: exported function IsEmptyString should have comment or be unexported (golint)
    • gonder/models/prometheus.go
    • Line 5: warning: exported var Prometheus should have comment or be unexported (golint)
    • Line 19: warning: exported function InitPrometheus should have comment or be unexported (golint)
    • gonder/models/recipient.go
    • Line 8: warning: exported type Recipient should have comment or be unexported (golint)
    • Line 10: warning: exported method Recipient.IntID should have comment or be unexported (golint)
    • Line 14: warning: exported method Recipient.StringID should have comment or be unexported (golint)
    • Line 18: warning: exported function RecipientGetByID should have comment or be unexported (golint)
    • Line 22: warning: exported function RecipientGetByStringID should have comment or be unexported (golint)
    • Line 30: warning: exported method Recipient.UpdateRecipientStatus should have comment or be unexported (golint)
    • Line 35: warning: exported type RecipientRemovedStatus should have comment or be unexported (golint)
    • Line 38: warning: exported const RecipientRemovedStatusActive should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported method RecipientRemovedStatus.IntID should have comment or be unexported (golint)
    • Line 47: warning: exported method RecipientRemovedStatus.StringID should have comment or be unexported (golint)
    • gonder/utm/utm.go
    • Line 127: 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 168: 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)

gocyclo71%

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.

    • gonder/api/recipients.go
    • Line 165: warning: cyclomatic complexity 36 of function recipientsReq() is high (> 15) (gocyclo)
    • Line 22: warning: cyclomatic complexity 23 of function RecipientUploadHandlerFunc() is high (> 15) (gocyclo)
    • Line 578: warning: cyclomatic complexity 21 of function recipientCsv() is high (> 15) (gocyclo)
    • Line 688: warning: cyclomatic complexity 20 of function recipientXlsx() is high (> 15) (gocyclo)
    • gonder/api/units.go
    • Line 139: warning: cyclomatic complexity 27 of function updateUnitRights() is high (> 15) (gocyclo)
    • Line 12: warning: cyclomatic complexity 23 of function units() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words