Preparing report...

Report for github.com/slntopp/infinimesh

(v0.0.0-20211213144936-8dabb6a7ea71)

A+    Excellent!    Found 41 issues across 66 files

Tweet

gofmt90%

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!


gocyclo92%

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.

    • pkg/node/namespace.go
    • Line 280: warning: cyclomatic complexity 21 of function (*NamespaceController).DeleteNamespace() is high (> 15) (gocyclo)

golint63%

Golint is a linter for Go source code.

    • pkg/shadow/consumer.go
    • Line 33: warning: exported type StateMerger should have comment or be unexported (golint)
    • Line 94: warning: exported method StateMerger.Setup should have comment or be unexported (golint)
    • Line 122: warning: exported method StateMerger.Cleanup should have comment or be unexported (golint)
    • Line 122: warning: receiver name h should be consistent with previous receiver name c for StateMerger (golint)
    • Line 132: warning: exported method StateMerger.ConsumeClaim should have comment or be unexported (golint)
    • Line 132: warning: receiver name h should be consistent with previous receiver name c for StateMerger (golint)
    • pkg/registry/server.go
    • Line 39: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 536: warning: comment on exported method Server.GetDeviceStatus should be of the form "GetDeviceStatus ..." (golint)
    • pkg/avro/consumer.go
    • Line 14: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 22: warning: exported method Consumer.Setup should have comment or be unexported (golint)
    • Line 27: warning: exported method Consumer.Cleanup should have comment or be unexported (golint)
    • Line 31: warning: exported method Consumer.ConsumeClaim should have comment or be unexported (golint)
    • cmd/inf/config.go
    • Line 34: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 40: warning: exported type Context should have comment or be unexported (golint)
    • Line 144: warning: exported method Config.GetCurrentContext should have comment or be unexported (golint)
    • Line 173: warning: exported function ReadConfig should have comment or be unexported (golint)
    • pkg/router/router.go
    • Line 25: warning: exported type Router should have comment or be unexported (golint)
    • Line 29: warning: exported function New should have comment or be unexported (golint)
    • Line 35: warning: exported method Router.Route should have comment or be unexported (golint)
    • pkg/timeseries/repo.go
    • Line 26: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 30: warning: exported type TimeseriesRepo should have comment or be unexported (golint)
    • Line 35: warning: exported type DataPoint should have comment or be unexported (golint)
    • Line 49: warning: exported function NewTimescaleRepo should have comment or be unexported (golint)
    • pkg/shadow/balance_strategy.go
    • Line 26: warning: exported type BalanceStrategyCoPartitioned should have comment or be unexported (golint)
    • Line 28: warning: exported method BalanceStrategyCoPartitioned.Name should have comment or be unexported (golint)
    • Line 32: warning: exported method BalanceStrategyCoPartitioned.Plan should have comment or be unexported (golint)
    • pkg/node/dgraph/repo.go
    • Line 405: 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)
    • pkg/mqtt/api.go
    • Line 20: warning: exported type IncomingMessage should have comment or be unexported (golint)
    • Line 27: warning: comment on exported type OutgoingMessage should be of the form "OutgoingMessage ..." (with optional leading article) (golint)
    • Line 35: warning: exported type Message should have comment or be unexported (golint)
    • Line 40: warning: exported type Payload should have comment or be unexported (golint)
    • pkg/shadow/repository.go
    • Line 26: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 29: warning: exported type Repo should have comment or be unexported (golint)
    • Line 36: warning: comment on exported type DeviceState should be of the form "DeviceState ..." (with optional leading article) (golint)
    • Line 42: warning: exported type DeviceStateDB should have comment or be unexported (golint)
    • Line 75: warning: exported function NewRedisRepo should have comment or be unexported (golint)
    • pkg/timeseries/consumer.go
    • Line 38: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 43: warning: exported method Consumer.Setup should have comment or be unexported (golint)
    • Line 48: warning: exported method Consumer.Cleanup should have comment or be unexported (golint)
    • Line 52: warning: exported method Consumer.ConsumeClaim should have comment or be unexported (golint)
    • pkg/log/log.go
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pkg/repo/repo.go
    • Line 11: warning: exported type Repo should have comment or be unexported (golint)
    • Line 17: warning: exported type DeviceState should have comment or be unexported (golint)
    • Line 46: warning: exported function NewRedisRepo should have comment or be unexported (golint)
    • pkg/repo/server.go
    • Line 10: warning: exported type Server should have comment or be unexported (golint)
    • Line 15: warning: exported method Server.Get should have comment or be unexported (golint)
    • Line 38: warning: exported method Server.SetDeviceState should have comment or be unexported (golint)
    • Line 62: warning: exported method Server.DeleteDeviceState should have comment or be unexported (golint)
    • pkg/grafana/client.go
    • Line 28: warning: exported type Client should have comment or be unexported (golint)
    • Line 36: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.CreateUser should have comment or be unexported (golint)
    • Line 76: warning: exported method Client.CreateOrg should have comment or be unexported (golint)
    • Line 105: warning: exported method Client.AddUserToOrg should have comment or be unexported (golint)
    • Line 134: warning: exported method Client.GetOrgID should have comment or be unexported (golint)
    • Line 170: warning: exported method Client.GetUserID should have comment or be unexported (golint)
    • Line 205: warning: exported method Client.MakeUserAdmin should have comment or be unexported (golint)
    • Line 233: warning: exported method Client.SwitchUserOrg 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.

    • pkg/node/dgraph/repo_test.go
    • Line 57: warning: ineffectual assignment to err (ineffassign)
    • Line 140: warning: ineffectual assignment to err (ineffassign)
    • Line 195: warning: ineffectual assignment to err (ineffassign)
    • Line 321: warning: ineffectual assignment to err (ineffassign)
    • Line 409: warning: ineffectual assignment to err (ineffassign)
    • Line 422: warning: ineffectual assignment to err (ineffassign)
    • Line 444: warning: ineffectual assignment to err (ineffassign)
    • Line 457: warning: ineffectual assignment to err (ineffassign)
    • Line 490: warning: ineffectual assignment to err (ineffassign)
    • Line 592: warning: ineffectual assignment to nsNew (ineffassign)
    • Line 603: warning: ineffectual assignment to err (ineffassign)

misspell77%

Misspell Finds commonly misspelled English words

    • cmd/apiserver/namespace.go
    • Line 55: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 77: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 99: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 227: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 250: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • cmd/apiserver/devices.go
    • Line 56: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 78: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 100: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • Line 123: warning: "succesfully" is a misspelling of "successfully" (misspell)
    • pkg/node/object.go
    • Line 39: warning: "heirarchy" is a misspelling of "hierarchy" (misspell)
    • Line 105: warning: "heirarchy" is a misspelling of "hierarchy" (misspell)
    • Line 147: warning: "heirarchy" is a misspelling of "hierarchy" (misspell)
    • pkg/repo/repo.go
    • Line 66: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 71: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 88: warning: "occured" is a misspelling of "occurred" (misspell)
    • Line 99: warning: "occured" is a misspelling of "occurred" (misspell)