Preparing report...

Report for github.com/microservices-demo/user

A    Great!    Found 11 issues across 19 files

Tweet

gofmt89%

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!


gocyclo100%

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.

No problems detected. Good job!


golint47%

Golint is a linter for Go source code.

    • user/main.go
    • Line 32: warning: exported var HTTPLatency should have comment or be unexported (golint)
    • Line 40: warning: exported const ServiceName should have comment (or a comment on this block) or be unexported (golint)
    • user/db/mongodb/mongodb.go
    • Line 400: warning: comment on exported method Mongo.Delete should be of the form "Delete ..." (golint)
    • Line 461: warning: exported method Mongo.Ping should have comment or be unexported (golint)
    • user/db/db.go
    • Line 100: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 112: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 115: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 138: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 157: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • user/users/users.go
    • Line 13: warning: exported var ErrNoCustomerInResponse should have comment or be unexported (golint)
    • Line 17: warning: exported type User should have comment or be unexported (golint)
    • Line 30: warning: exported function New should have comment or be unexported (golint)
    • Line 36: warning: exported method User.Validate should have comment or be unexported (golint)
    • Line 52: warning: exported method User.MaskCCs should have comment or be unexported (golint)
    • Line 59: warning: exported method User.AddLinks should have comment or be unexported (golint)
    • Line 63: warning: exported method User.NewSalt should have comment or be unexported (golint)
    • user/api/endpoints.go
    • Line 160: warning: comment on exported function MakeCardGetEndpoint should be of the form "MakeCardGetEndpoint ..." (golint)
    • Line 194: warning: comment on exported function MakeDeleteEndpoint should be of the form "MakeDeleteEndpoint ..." (golint)
    • Line 222: warning: exported type GetRequest should have comment or be unexported (golint)
    • Line 287: warning: exported type EmbedStruct should have comment or be unexported (golint)
    • user/api/service.go
    • Line 18: warning: exported var ErrUnauthorized should have comment or be unexported (golint)
    • Line 42: warning: exported type Health should have comment or be unexported (golint)
    • user/users/addresses.go
    • Line 3: warning: exported type Address should have comment or be unexported (golint)
    • Line 13: warning: exported method Address.AddLinks should have comment or be unexported (golint)
    • user/users/cards.go
    • Line 8: warning: exported type Card should have comment or be unexported (golint)
    • Line 16: warning: exported method Card.MaskCC should have comment or be unexported (golint)
    • Line 21: warning: exported method Card.AddLinks should have comment or be unexported (golint)
    • user/users/links.go
    • Line 22: warning: exported type Links should have comment or be unexported (golint)
    • Line 24: warning: exported method Links.AddLink should have comment or be unexported (golint)
    • Line 33: warning: exported method Links.AddAttrLink should have comment or be unexported (golint)
    • Line 40: warning: exported method Links.AddCustomer should have comment or be unexported (golint)
    • Line 46: warning: exported method Links.AddAddress should have comment or be unexported (golint)
    • Line 50: warning: exported method Links.AddCard should have comment or be unexported (golint)
    • Line 54: warning: exported type Href 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.

    • user/api/endpoints.go
    • Line 52: warning: ineffectual assignment to ctx (ineffassign)
    • Line 65: warning: ineffectual assignment to ctx (ineffassign)
    • Line 78: warning: ineffectual assignment to ctx (ineffassign)
    • Line 117: warning: ineffectual assignment to ctx (ineffassign)
    • Line 130: warning: ineffectual assignment to ctx (ineffassign)
    • Line 151: warning: ineffectual assignment to ctx (ineffassign)
    • Line 164: warning: ineffectual assignment to ctx (ineffassign)
    • Line 185: warning: ineffectual assignment to ctx (ineffassign)
    • Line 198: warning: ineffectual assignment to ctx (ineffassign)
    • Line 214: warning: ineffectual assignment to ctx (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!