Preparing report...

Report for kubedb.dev/mongodb

A    Great!    Found 20 issues across 28 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!


gocyclo75%

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.

    • /kubedb.dev/mongodb/pkg/controller/statefulset.go
    • Line 543: warning: cyclomatic complexity 18 of function (*Reconciler).ensureNonTopology() is high (> 15) (gocyclo)
    • Line 773: warning: cyclomatic complexity 18 of function (*Reconciler).ensureStatefulSet() is high (> 15) (gocyclo)
    • Line 95: warning: cyclomatic complexity 16 of function (*Reconciler).ensureTopologyCluster() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 16 of function (*Reconciler).ensureShardNode() is high (> 15) (gocyclo)

golint39%

Golint is a linter for Go source code.

    • /kubedb.dev/mongodb/pkg/cmds/server/start.go
    • Line 37: warning: exported type MongoDBServerOptions should have comment or be unexported (golint)
    • Line 45: warning: exported function NewMongoDBServerOptions should have comment or be unexported (golint)
    • Line 62: warning: exported method MongoDBServerOptions.AddFlags should have comment or be unexported (golint)
    • Line 67: warning: exported method MongoDBServerOptions.Validate should have comment or be unexported (golint)
    • Line 71: warning: exported method MongoDBServerOptions.Complete should have comment or be unexported (golint)
    • Line 75: warning: exported method MongoDBServerOptions.Config should have comment or be unexported (golint)
    • Line 100: warning: exported method MongoDBServerOptions.Run should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/admission/mutator.go
    • Line 40: warning: exported type MongoDBMutator should have comment or be unexported (golint)
    • Line 51: warning: exported method MongoDBMutator.Resource should have comment or be unexported (golint)
    • Line 60: warning: exported method MongoDBMutator.Initialize should have comment or be unexported (golint)
    • Line 76: warning: exported method MongoDBMutator.Admit should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/admission/validator.go
    • Line 44: warning: exported type MongoDBValidator should have comment or be unexported (golint)
    • Line 60: warning: exported method MongoDBValidator.Resource should have comment or be unexported (golint)
    • Line 69: warning: exported method MongoDBValidator.Initialize should have comment or be unexported (golint)
    • Line 85: warning: exported method MongoDBValidator.Admit should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/server/server.go
    • Line 54: warning: exported var Scheme should have comment or be unexported (golint)
    • Line 76: warning: exported type MongoDBServerConfig should have comment or be unexported (golint)
    • Line 82: warning: exported type ExtraConfig should have comment or be unexported (golint)
    • Line 92: warning: exported method MongoDBServer.Run should have comment or be unexported (golint)
    • Line 103: warning: exported type CompletedConfig should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/cmds/server/options.go
    • Line 44: warning: exported type ExtraOptions should have comment or be unexported (golint)
    • Line 57: warning: exported function NewExtraOptions should have comment or be unexported (golint)
    • Line 71: warning: exported method ExtraOptions.AddGoFlags should have comment or be unexported (golint)
    • Line 83: warning: exported method ExtraOptions.AddFlags should have comment or be unexported (golint)
    • Line 89: warning: exported method ExtraOptions.ApplyTo should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/controller/client.go
    • Line 40: warning: exported method Controller.GetMongoClient should have comment or be unexported (golint)
    • Line 59: warning: exported method Controller.GetURL should have comment or be unexported (golint)
    • Line 64: warning: exported method Controller.GetMongoDBClientOpts should have comment or be unexported (golint)
    • Line 108: warning: exported method Controller.GetMongoDBRootCredentials should have comment or be unexported (golint)
    • Line 119: warning: exported method Controller.CreateTLSUsers should have comment or be unexported (golint)
    • Line 158: warning: exported method Controller.CreateTLSUser should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/controller/config.go
    • Line 39: warning: exported type OperatorConfig should have comment or be unexported (golint)
    • Line 53: warning: exported function NewOperatorConfig should have comment or be unexported (golint)
    • Line 59: warning: exported method OperatorConfig.New should have comment or be unexported (golint)
    • /kubedb.dev/mongodb/pkg/controller/controller.go
    • Line 51: warning: exported type Controller should have comment or be unexported (golint)
    • Line 69: warning: exported function New should have comment or be unexported (golint)
    • Line 115: warning: comment on exported method Controller.Init should be of the form "Init ..." (golint)
    • Line 132: warning: comment on exported method Controller.Run should be of the form "Run ..." (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!