Preparing report...

Report for kubedb.dev/redis

A+    Excellent!    Found 24 issues across 33 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!


gocyclo84%

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/redis/pkg/configure-cluster/cluster.go
    • Line 352: warning: cyclomatic complexity 20 of function (Config).ensureExtraMastersBeRemoved() is high (> 15) (gocyclo)
    • Line 217: warning: cyclomatic complexity 20 of function (Config).getOrderedNodes() is high (> 15) (gocyclo)
    • Line 524: warning: cyclomatic complexity 16 of function (Config).rebalanceSlots() is high (> 15) (gocyclo)

golint33%

Golint is a linter for Go source code.

    • /kubedb.dev/redis/pkg/server/server.go
    • Line 54: warning: exported var Scheme should have comment or be unexported (golint)
    • Line 76: warning: exported type RedisServerConfig 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 RedisServer.Run should have comment or be unexported (golint)
    • Line 103: warning: exported type CompletedConfig should have comment or be unexported (golint)
    • /kubedb.dev/redis/pkg/testing/test_helper.go
    • Line 37: warning: exported type TestConfig should have comment or be unexported (golint)
    • Line 44: warning: comment on exported method TestConfig.GetClusterNodes should be of the form "GetClusterNodes ..." (golint)
    • Line 70: warning: exported method TestConfig.GetPingResult should have comment or be unexported (golint)
    • Line 98: warning: exported method TestConfig.SetItem should have comment or be unexported (golint)
    • Line 125: warning: exported method TestConfig.GetItem should have comment or be unexported (golint)
    • Line 155: warning: exported method TestConfig.GetRedisConfig should have comment or be unexported (golint)
    • Line 206: warning: exported method TestConfig.FlushDBForCluster should have comment or be unexported (golint)
    • Line 239: warning: exported method TestConfig.FlushDBForStandalone should have comment or be unexported (golint)
    • Line 257: warning: exported method TestConfig.GetDBSizeForStandalone should have comment or be unexported (golint)
    • Line 279: warning: exported method TestConfig.GetDbSizeForCluster should have comment or be unexported (golint)
    • Line 314: warning: exported method TestConfig.GetDbSizeForIndividualNodeInCluster should have comment or be unexported (golint)
    • Line 341: warning: exported method TestConfig.ClusterFailOver should have comment or be unexported (golint)
    • Line 364: warning: exported method TestConfig.GetClusterSlots should have comment or be unexported (golint)
    • Line 390: warning: exported method TestConfig.DeleteItem should have comment or be unexported (golint)
    • Line 419: warning: exported method TestConfig.GetRandomKey should have comment or be unexported (golint)
    • Line 451: warning: exported method TestConfig.GetClusterNodesForCluster should have comment or be unexported (golint)
    • Line 523: warning: exported method TestConfig.GetClusterInfoForRedis should have comment or be unexported (golint)
    • Line 544: warning: exported method TestConfig.GetClusterSaveConfig should have comment or be unexported (golint)
    • Line 565: warning: exported method TestConfig.GetClusterCountKeysInSlot should have comment or be unexported (golint)
    • Line 591: warning: exported method TestConfig.GetClusterCountFailureReports should have comment or be unexported (golint)
    • Line 617: warning: exported method TestConfig.GetClusterSlaves should have comment or be unexported (golint)
    • /kubedb.dev/redis/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)
    • /kubedb.dev/redis/pkg/cmds/server/start.go
    • Line 37: warning: exported type RedisServerOptions should have comment or be unexported (golint)
    • Line 45: warning: exported function NewRedisServerOptions should have comment or be unexported (golint)
    • Line 62: warning: exported method RedisServerOptions.AddFlags should have comment or be unexported (golint)
    • Line 67: warning: exported method RedisServerOptions.Validate should have comment or be unexported (golint)
    • Line 71: warning: exported method RedisServerOptions.Complete should have comment or be unexported (golint)
    • Line 75: warning: exported method RedisServerOptions.Config should have comment or be unexported (golint)
    • Line 100: warning: exported method RedisServerOptions.Run should have comment or be unexported (golint)
    • /kubedb.dev/redis/pkg/testing/cluster.go
    • Line 32: warning: exported method TestConfig.GetDatabasePodWithPodName should have comment or be unexported (golint)
    • Line 35: warning: exported method TestConfig.GetDatabasePodForRedisStandalone should have comment or be unexported (golint)
    • Line 40: warning: exported method TestConfig.GetDatabasePodForRedisCluster should have comment or be unexported (golint)
    • Line 46: warning: exported type RedisNode should have comment or be unexported (golint)
    • Line 61: warning: exported type ClusterNode should have comment or be unexported (golint)
    • Line 66: warning: exported type ClusterNodes should have comment or be unexported (golint)
    • Line 69: warning: exported type ClusterSlot should have comment or be unexported (golint)
    • Line 93: warning: exported method TestConfig.AssertSlotsEqual should have comment or be unexported (golint)
    • Line 111: warning: exported method ClusterNodes.ClusterNodes should have comment or be unexported (golint)
    • Line 186: warning: exported function AvailableClusterSlots should have comment or be unexported (golint)
    • /kubedb.dev/redis/pkg/admission/mutator.go
    • Line 38: warning: exported type RedisMutator should have comment or be unexported (golint)
    • Line 49: warning: exported method RedisMutator.Resource should have comment or be unexported (golint)
    • Line 58: warning: exported method RedisMutator.Initialize should have comment or be unexported (golint)
    • Line 74: warning: exported method RedisMutator.Admit should have comment or be unexported (golint)
    • /kubedb.dev/redis/pkg/controller/config.go
    • Line 43: warning: exported type OperatorConfig should have comment or be unexported (golint)
    • Line 57: warning: exported function NewOperatorConfig should have comment or be unexported (golint)
    • Line 63: warning: exported method OperatorConfig.New should have comment or be unexported (golint)
    • /kubedb.dev/redis/pkg/configure-cluster/cluster_cmd.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 28: warning: exported type ResetType should have comment or be unexported (golint)
    • Line 171: warning: comment on exported function ClusterNodesCmd should be of the form "ClusterNodesCmd ..." (golint)
    • Line 183: warning: comment on exported function ClusterMeetCmd should be of the form "ClusterMeetCmd ..." (golint)
    • Line 192: warning: comment on exported function ClusterResetCmd should be of the form "ClusterResetCmd ..." (golint)
    • Line 201: warning: comment on exported function ClusterFailoverCmd should be of the form "ClusterFailoverCmd ..." (golint)
    • Line 210: warning: comment on exported function ClusterReplicateCmd should be of the form "ClusterReplicateCmd ..." (golint)
    • Line 223: warning: comment on exported function PingCmd should be of the form "PingCmd ..." (golint)
    • /kubedb.dev/redis/pkg/admission/validator.go
    • Line 45: warning: exported type RedisValidator should have comment or be unexported (golint)
    • Line 60: warning: exported method RedisValidator.Resource should have comment or be unexported (golint)
    • Line 69: warning: exported method RedisValidator.Initialize should have comment or be unexported (golint)
    • Line 85: warning: exported method RedisValidator.Admit should have comment or be unexported (golint)
    • /kubedb.dev/redis/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)

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!