Preparing report...

Report for github.com/edgexfoundry-holding/edgex-ui-go

C    Needs some work    Found 24 issues across 28 files

Tweet

gofmt35%

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!


gocyclo96%

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.


golint14%

Golint is a linter for Go source code.

    • edgex-ui-go/web/app/repository/mongo/user.go
    • Line 25: warning: exported type UserMongoRepository should have comment or be unexported (golint)
    • Line 28: warning: exported method UserMongoRepository.ExistsUser should have comment or be unexported (golint)
    • Line 40: warning: exported method UserMongoRepository.Exists should have comment or be unexported (golint)
    • Line 55: warning: exported method UserMongoRepository.Insert should have comment or be unexported (golint)
    • Line 70: warning: exported method UserMongoRepository.Update should have comment or be unexported (golint)
    • Line 85: warning: exported method UserMongoRepository.Delete should have comment or be unexported (golint)
    • Line 98: warning: exported method UserMongoRepository.Select should have comment or be unexported (golint)
    • Line 113: warning: exported method UserMongoRepository.SelectAll should have comment or be unexported (golint)
    • edgex-ui-go/web/app/repository/mm/gateway.go
    • Line 25: warning: exported type GatewayRepository should have comment or be unexported (golint)
    • Line 28: warning: exported method GatewayRepository.Insert should have comment or be unexported (golint)
    • Line 38: warning: exported method GatewayRepository.SelectAll should have comment or be unexported (golint)
    • Line 43: warning: exported method GatewayRepository.Exists should have comment or be unexported (golint)
    • Line 47: warning: exported method GatewayRepository.Select should have comment or be unexported (golint)
    • Line 51: warning: exported method GatewayRepository.Update should have comment or be unexported (golint)
    • Line 55: warning: exported method GatewayRepository.Delete should have comment or be unexported (golint)
    • edgex-ui-go/web/app/repository/mm/user.go
    • Line 23: warning: exported type UserRepository should have comment or be unexported (golint)
    • Line 26: warning: exported method UserRepository.ExistsUser should have comment or be unexported (golint)
    • Line 37: warning: exported method UserRepository.Exists should have comment or be unexported (golint)
    • Line 41: warning: exported method UserRepository.Insert should have comment or be unexported (golint)
    • Line 46: warning: exported method UserRepository.Update should have comment or be unexported (golint)
    • Line 51: warning: exported method UserRepository.Delete should have comment or be unexported (golint)
    • Line 56: warning: exported method UserRepository.Select should have comment or be unexported (golint)
    • Line 61: warning: exported method UserRepository.SelectAll should have comment or be unexported (golint)
    • edgex-ui-go/web/app/common/filter.go
    • Line 29: warning: comment on exported var TokenCache should be of the form "TokenCache ..." (golint)
    • Line 33: warning: exported const RelativePathToProjectRoot should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported function GeneralFilter should have comment or be unexported (golint)
    • Line 55: warning: exported function AuthFilter should have comment or be unexported (golint)
    • Line 103: warning: should omit 2nd value from range; this loop is equivalent to `for prefix := range ...` (golint)
    • edgex-ui-go/web/app/common/proxyhandler.go
    • Line 27: warning: exported const OriginHostReqHeader should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: comment on exported var DynamicalProxyCache should be of the form "DynamicalProxyCache ..." (golint)
    • Line 34: warning: exported function ProxyHandler should have comment or be unexported (golint)
    • edgex-ui-go/initial/init.go
    • Line 15: warning: exported var ProxyMapping should have comment or be unexported (golint)
    • Line 17: warning: exported function Initialize should have comment or be unexported (golint)
    • edgex-ui-go/web/app/repository/gateway.go
    • Line 15: warning: exported type GatewayRepos should have comment or be unexported (golint)
    • Line 24: warning: exported function GetGatewayRepos should have comment or be unexported (golint)
    • Line 27: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • edgex-ui-go/web/app/controller/gateway.go
    • Line 30: warning: exported const HostIPKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported function ProxyConfigGateway should have comment or be unexported (golint)
    • Line 45: warning: exported function AddGateway should have comment or be unexported (golint)
    • Line 56: warning: exported function QueryAllGateway should have comment or be unexported (golint)
    • Line 69: warning: exported function RemoveGateway should have comment or be unexported (golint)
    • edgex-ui-go/web/app/component/websocket.go
    • Line 23: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 28: warning: exported type WsClientConn should have comment or be unexported (golint)
    • Line 39: warning: exported function WebSocketHandler should have comment or be unexported (golint)
    • Line 55: warning: exported function WsClientSend should have comment or be unexported (golint)
    • edgex-ui-go/web/app/controller/auth.go
    • Line 30: warning: exported const UserNameKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported function Login should have comment or be unexported (golint)
    • Line 63: warning: exported function Logout should have comment or be unexported (golint)
    • edgex-ui-go/web/app/repository/mongo/gateway.go
    • Line 26: warning: exported type GatewayMongoRepository should have comment or be unexported (golint)
    • Line 29: warning: exported method GatewayMongoRepository.Insert should have comment or be unexported (golint)
    • Line 46: warning: exported method GatewayMongoRepository.Delete should have comment or be unexported (golint)
    • Line 59: warning: exported method GatewayMongoRepository.SelectAll should have comment or be unexported (golint)
    • Line 74: warning: exported method GatewayMongoRepository.Select should have comment or be unexported (golint)
    • Line 89: warning: exported method GatewayMongoRepository.Exists should have comment or be unexported (golint)
    • Line 104: warning: exported method GatewayMongoRepository.Update should have comment or be unexported (golint)
    • edgex-ui-go/web/app/component/mqtt.go
    • Line 27: warning: exported const ClientIDPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported var MqttTokenCache should have comment or be unexported (golint)
    • Line 36: warning: comment on exported var ExportSubscriberCache should be of the form "ExportSubscriberCache ..." (golint)
    • Line 39: warning: exported function CreateMqttClient should have comment or be unexported (golint)
    • edgex-ui-go/web/app/repository/user.go
    • Line 15: warning: exported type UserRepos should have comment or be unexported (golint)
    • Line 25: warning: exported function GetUserRepos should have comment or be unexported (golint)
    • Line 28: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • edgex-ui-go/web/app/repository/mongo/mongo.go
    • Line 36: warning: exported type DataStore should have comment or be unexported (golint)
    • Line 40: warning: exported var DS should have comment or be unexported (golint)
    • Line 42: warning: exported method DataStore.DataStore should have comment or be unexported (golint)
    • Line 46: warning: exported function DBConnect should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!