Preparing report...

Report for github.com/synapse-garden/sg-proto

A+    Excellent!    Found 43 issues across 124 files

Tweet

gofmt97%

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!


gocyclo93%

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.

    • sg-proto/rest/stream.go
    • Line 118: warning: cyclomatic complexity 22 of function (Stream).Connect() is high (> 15) (gocyclo)
    • Line 347: warning: cyclomatic complexity 19 of function (Stream).Put() is high (> 15) (gocyclo)
    • sg-proto/rest/convo.go
    • Line 90: warning: cyclomatic complexity 36 of function (Convo).Connect() is high (> 15) (gocyclo)
    • Line 448: warning: cyclomatic complexity 26 of function (Convo).Put() is high (> 15) (gocyclo)
    • Line 693: warning: cyclomatic complexity 17 of function (Convo).Delete() is high (> 15) (gocyclo)

golint72%

Golint is a linter for Go source code.

    • sg-proto/incept/incept.go
    • Line 15: warning: exported var TicketBucket should have comment or be unexported (golint)
    • Line 17: warning: exported type ErrTicketMissing should have comment or be unexported (golint)
    • Line 23: warning: exported type Ticket should have comment or be unexported (golint)
    • Line 25: warning: exported method Ticket.Bytes should have comment or be unexported (golint)
    • Line 28: warning: exported method Ticket.UnmarshalJSON should have comment or be unexported (golint)
    • Line 42: warning: exported method Ticket.MarshalJSON should have comment or be unexported (golint)
    • Line 46: warning: exported function NewTickets should have comment or be unexported (golint)
    • Line 57: warning: exported function NewTicket should have comment or be unexported (golint)
    • Line 61: warning: exported function CheckTicketExist should have comment or be unexported (golint)
    • Line 71: warning: exported function DeleteTickets should have comment or be unexported (golint)
    • Line 83: warning: exported function PunchTicket should have comment or be unexported (golint)
    • sg-proto/admin/admin.go
    • Line 15: warning: exported var AdminBucket should have comment or be unexported (golint)
    • Line 17: warning: exported type ErrNotFound should have comment or be unexported (golint)
    • Line 23: warning: exported function IsNotFound should have comment or be unexported (golint)
    • Line 31: warning: exported function NewToken should have comment or be unexported (golint)
    • Line 41: warning: exported function CheckExists should have comment or be unexported (golint)
    • Line 49: warning: exported function CheckToken should have comment or be unexported (golint)
    • sg-proto/store/store.go
    • Line 10: warning: exported type Version should have comment or be unexported (golint)
    • Line 13: warning: exported const Ver001 should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported var VersionBucket should have comment or be unexported (golint)
    • Line 38: warning: exported function Prep should have comment or be unexported (golint)
    • Line 45: warning: exported function SetupBuckets should have comment or be unexported (golint)
    • Line 58: warning: exported function Migrate should have comment or be unexported (golint)
    • Line 74: warning: exported function MigrateFrom should have comment or be unexported (golint)
    • Line 89: warning: exported function PutV should have comment or be unexported (golint)
    • Line 99: warning: exported function Wrap should have comment or be unexported (golint)
    • sg-proto/rest/middleware/auth.go
    • Line 19: warning: exported type Header should have comment or be unexported (golint)
    • Line 22: warning: exported const AuthHeader should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported function GetToken should have comment or be unexported (golint)
    • Line 73: warning: exported function AuthUser should have comment or be unexported (golint)
    • Line 243: warning: exported function AuthWSUser should have comment or be unexported (golint)
    • Line 414: warning: exported function AuthAdmin should have comment or be unexported (golint)
    • sg-proto/rest/middleware/contexter.go
    • Line 11: warning: exported type Contexter should have comment or be unexported (golint)
    • Line 13: warning: exported function ByFields should have comment or be unexported (golint)
    • Line 23: warning: exported function CtxSetUserID should have comment or be unexported (golint)
    • Line 29: warning: exported function CtxSetToken should have comment or be unexported (golint)
    • Line 35: warning: exported function CtxSetRefreshToken should have comment or be unexported (golint)
    • Line 41: warning: exported function CtxGetUserID should have comment or be unexported (golint)
    • Line 45: warning: exported function CtxGetToken should have comment or be unexported (golint)
    • Line 49: warning: exported function CtxGetRefreshToken should have comment or be unexported (golint)
    • sg-proto/auth/errors.go
    • Line 5: warning: exported function IsDisabled should have comment or be unexported (golint)
    • Line 13: warning: exported type ErrDisabled should have comment or be unexported (golint)
    • Line 17: warning: exported function IsExists should have comment or be unexported (golint)
    • Line 25: warning: exported type ErrExists should have comment or be unexported (golint)
    • Line 29: warning: exported type ErrMissing should have comment or be unexported (golint)
    • Line 33: warning: exported type ErrInvalid should have comment or be unexported (golint)
    • Line 37: warning: exported type ErrInvalidTokenType should have comment or be unexported (golint)
    • Line 43: warning: exported function IsInvalidTokenType should have comment or be unexported (golint)
    • Line 51: warning: exported type ErrMissingSession should have comment or be unexported (golint)
    • Line 57: warning: exported function IsMissingSession should have comment or be unexported (golint)
    • Line 65: warning: exported type ErrTokenExpired should have comment or be unexported (golint)
    • Line 71: warning: exported function IsTokenExpired should have comment or be unexported (golint)
    • sg-proto/store/funcs.go
    • Line 10: warning: exported function Put should have comment or be unexported (golint)
    • Line 16: warning: exported function Get should have comment or be unexported (golint)
    • Line 32: warning: exported function Error should have comment or be unexported (golint)
    • Line 36: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 42: warning: exported function Delete should have comment or be unexported (golint)
    • Line 48: warning: exported function Marshal should have comment or be unexported (golint)
    • Line 58: warning: exported function Unmarshal should have comment or be unexported (golint)
    • Line 70: warning: exported function CheckExists should have comment or be unexported (golint)
    • Line 82: warning: exported function CheckNotExist should have comment or be unexported (golint)
    • Line 121: warning: exported function ForEach should have comment or be unexported (golint)
    • sg-proto/store/loadstorer.go
    • Line 16: warning: exported type Loaders should have comment or be unexported (golint)
    • Line 25: warning: exported type Storers should have comment or be unexported (golint)
    • Line 27: warning: exported type Deleter should have comment or be unexported (golint)
    • Line 31: warning: exported type Deleters should have comment or be unexported (golint)
    • Line 39: warning: exported type LoadStoreDeleter should have comment or be unexported (golint)
    • Line 91: warning: exported method Deleters.DeleteAll should have comment or be unexported (golint)
    • sg-proto/testing/rest.go
    • Line 54: warning: exported var OKHeader should have comment or be unexported (golint)
    • Line 58: warning: exported var FailHeader should have comment or be unexported (golint)
    • sg-proto/store/errors.go
    • Line 9: warning: exported type ErrMissingBucket should have comment or be unexported (golint)
    • Line 15: warning: exported function IsMissingBucket should have comment or be unexported (golint)
    • Line 23: warning: exported method Mutation.OrMissing should have comment or be unexported (golint)
    • Line 41: warning: exported type KeyError should have comment or be unexported (golint)
    • Line 45: warning: exported type ExistsError should have comment or be unexported (golint)
    • Line 51: warning: exported function IsExists should have comment or be unexported (golint)
    • Line 59: warning: exported type MissingError should have comment or be unexported (golint)
    • Line 65: warning: exported function IsMissing should have comment or be unexported (golint)
    • sg-proto/testing/db.go
    • Line 32: warning: exported function CleanupDB should have comment or be unexported (golint)
    • Line 43: warning: exported function FindForKeys should have comment or be unexported (golint)
    • sg-proto/task/json.go
    • Line 9: warning: exported method ID.MarshalJSON should have comment or be unexported (golint)
    • Line 13: warning: exported method ID.UnmarshalJSON should have comment or be unexported (golint)
    • sg-proto/auth/auth.go
    • Line 27: warning: exported function CheckLoginNotExist should have comment or be unexported (golint)
    • Line 37: warning: exported function ValidateNew should have comment or be unexported (golint)
    • Line 49: warning: exported function Check should have comment or be unexported (golint)
    • Line 69: warning: exported function Create should have comment or be unexported (golint)
    • Line 144: warning: exported function Disable should have comment or be unexported (golint)
    • sg-proto/stream/errors.go
    • Line 23: warning: exported function IsMissing should have comment or be unexported (golint)
    • Line 31: warning: exported function IsExists should have comment or be unexported (golint)
    • Line 39: warning: exported function IsUnauthorized should have comment or be unexported (golint)
    • sg-proto/rest/task.go
    • Line 25: warning: exported const TaskNotifs should have comment or be unexported (golint)
    • Line 27: warning: exported type Task should have comment or be unexported (golint)
    • Line 35: warning: exported method Task.Bind should have comment or be unexported (golint)
    • Line 81: warning: exported method Task.GetAll should have comment or be unexported (golint)
    • Line 150: warning: exported method Task.Create should have comment or be unexported (golint)
    • Line 237: warning: exported method Task.Get should have comment or be unexported (golint)
    • Line 267: warning: exported method Task.Delete should have comment or be unexported (golint)
    • Line 316: warning: exported method Task.Put should have comment or be unexported (golint)
    • sg-proto/rest/token.go
    • Line 31: warning: exported method Token.Create should have comment or be unexported (golint)
    • Line 81: warning: exported method Token.Delete should have comment or be unexported (golint)
    • sg-proto/users/users.go
    • Line 13: warning: exported var UserBucket should have comment or be unexported (golint)
    • Line 15: warning: exported type User should have comment or be unexported (golint)
    • Line 20: warning: exported type ErrExists should have comment or be unexported (golint)
    • Line 24: warning: exported type ErrMissing should have comment or be unexported (golint)
    • Line 28: warning: exported function IsExists should have comment or be unexported (golint)
    • Line 36: warning: exported function IsMissing should have comment or be unexported (golint)
    • Line 60: warning: exported function CheckNotExist should have comment or be unexported (golint)
    • Line 78: warning: exported function Delete should have comment or be unexported (golint)
    • Line 114: warning: exported type Users should have comment or be unexported (golint)
    • Line 116: warning: exported method Users.GetAll should have comment or be unexported (golint)
    • sg-proto/convo/errors.go
    • Line 23: warning: exported function IsMissing should have comment or be unexported (golint)
    • Line 31: warning: exported function IsExists should have comment or be unexported (golint)
    • Line 39: warning: exported function IsUnauthorized should have comment or be unexported (golint)
    • sg-proto/auth/context.go
    • Line 13: warning: exported const CtxToken should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type CtxField should have comment or be unexported (golint)
    • Line 21: warning: exported var ContextBucket should have comment or be unexported (golint)
    • Line 24: warning: exported type ErrContextMissing should have comment or be unexported (golint)
    • Line 49: warning: exported method Context.ByField should have comment or be unexported (golint)
    • Line 57: warning: exported type Found should have comment or be unexported (golint)
    • Line 82: warning: exported function SaveContext should have comment or be unexported (golint)
    • Line 86: warning: exported function GetContext should have comment or be unexported (golint)
    • Line 96: warning: exported function DeleteContext should have comment or be unexported (golint)
    • sg-proto/auth/session.go
    • Line 14: warning: exported type TokenType should have comment or be unexported (golint)
    • Line 17: warning: exported const BearerType should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported function ValidType should have comment or be unexported (golint)
    • Line 33: warning: exported var SessionBucket should have comment or be unexported (golint)
    • Line 49: warning: exported type Token should have comment or be unexported (golint)
    • Line 64: warning: exported function DecodeToken should have comment or be unexported (golint)
    • Line 72: warning: exported function NewToken should have comment or be unexported (golint)
    • Line 83: warning: exported function RefreshIfValid should have comment or be unexported (golint)
    • Line 103: warning: exported function Refresh should have comment or be unexported (golint)
    • Line 127: warning: exported function CheckRefresh should have comment or be unexported (golint)
    • Line 207: warning: exported function DeleteToken should have comment or be unexported (golint)
    • Line 218: warning: exported function DeleteSession should have comment or be unexported (golint)
    • sg-proto/rest/ws/ws.go
    • Line 24: warning: exported type Binder should have comment or be unexported (golint)
    • Line 28: warning: exported type Sender should have comment or be unexported (golint)
    • Line 32: warning: exported type Recver should have comment or be unexported (golint)
    • Line 36: warning: exported type SendRecver should have comment or be unexported (golint)
    • Line 41: warning: exported type RecvCloser should have comment or be unexported (golint)
    • sg-proto/stream/river/errors.go
    • Line 40: warning: exported function IsStreamMissing should have comment or be unexported (golint)
    • Line 48: warning: exported function IsStreamExists should have comment or be unexported (golint)
    • sg-proto/task/filter.go
    • Line 9: warning: exported type Filter should have comment or be unexported (golint)
    • Line 13: warning: exported type Completion should have comment or be unexported (golint)
    • Line 16: warning: exported const Incomplete should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported method Completion.Member should have comment or be unexported (golint)
    • Line 31: warning: exported type Overdue should have comment or be unexported (golint)
    • Line 33: warning: exported method Overdue.Member should have comment or be unexported (golint)
    • Line 39: warning: exported type NotYetDue should have comment or be unexported (golint)
    • Line 41: warning: exported method NotYetDue.Member should have comment or be unexported (golint)
    • Line 50: warning: exported type DueWithin should have comment or be unexported (golint)
    • Line 55: warning: exported method DueWithin.Member should have comment or be unexported (golint)
    • Line 64: warning: exported type Not should have comment or be unexported (golint)
    • Line 66: warning: exported method Not.Member should have comment or be unexported (golint)
    • Line 68: warning: exported type ByOwner should have comment or be unexported (golint)
    • Line 70: warning: exported method ByOwner.Member should have comment or be unexported (golint)
    • sg-proto/store/types.go
    • Line 5: warning: exported type View should have comment or be unexported (golint)
    • Line 7: warning: exported type Mutation should have comment or be unexported (golint)
    • sg-proto/rest/admin.go
    • Line 29: warning: exported var AdminNotifs should have comment or be unexported (golint)
    • Line 87: warning: exported method Admin.Verify should have comment or be unexported (golint)
    • Line 93: warning: exported method Admin.NewTicket should have comment or be unexported (golint)
    • Line 150: warning: exported method Admin.GetAllProfiles should have comment or be unexported (golint)
    • Line 235: warning: exported method Admin.DeleteTicket should have comment or be unexported (golint)
    • Line 255: warning: exported method Admin.DeleteUser should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!