Preparing report...

Report for github.com/kubedb/postgres

A+    Excellent!    Found 32 issues across 44 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!


gocyclo90%

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.

    • postgres/pkg/admission/validator.go
    • Line 155: warning: cyclomatic complexity 31 of function ValidatePostgres() is high (> 15) (gocyclo)
    • Line 88: warning: cyclomatic complexity 22 of function (*PostgresValidator).Admit() is high (> 15) (gocyclo)
    • Line 317: warning: cyclomatic complexity 18 of function validateSpecForDB() is high (> 15) (gocyclo)

golint31%

Golint is a linter for Go source code.

    • postgres/pkg/admission/validator.go
    • Line 47: warning: exported type PostgresValidator should have comment or be unexported (golint)
    • Line 63: warning: exported method PostgresValidator.Resource should have comment or be unexported (golint)
    • Line 72: warning: exported method PostgresValidator.Initialize should have comment or be unexported (golint)
    • Line 88: warning: exported method PostgresValidator.Admit should have comment or be unexported (golint)
    • postgres/pkg/controller/health.go
    • Line 28: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 39: warning: exported method Controller.RunHealthChecker should have comment or be unexported (golint)
    • Line 45: warning: exported method Controller.CheckPostgresDBHealth should have comment or be unexported (golint)
    • Line 228: warning: comment on exported method Controller.GetPostgresAuthCredentials should be of the form "GetPostgresAuthCredentials ..." (golint)
    • Line 272: warning: comment on exported method Controller.IsPostgreSQLServerOnline should be of the form "IsPostgreSQLServerOnline ..." (golint)
    • Line 291: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 296: warning: comment on exported function HostDNS should be of the form "HostDNS ..." (golint)
    • Line 301: warning: comment on exported function PrimaryServiceDNS should be of the form "PrimaryServiceDNS ..." (golint)
    • postgres/pkg/controller/secret.go
    • Line 37: warning: exported const EnvPostgresUser should have comment (or a comment on this block) or be unexported (golint)
    • Line 144: warning: exported method Controller.PostgresForSecret should have comment or be unexported (golint)
    • Line 154: warning: exported method Controller.GetPostgresSecrets should have comment or be unexported (golint)
    • postgres/test/e2e/framework/pvc.go
    • Line 26: warning: should not use dot imports (golint)
    • Line 34: warning: exported method Framework.EventuallyPVCCount should have comment or be unexported (golint)
    • Line 57: warning: exported method Invocation.GetPersistentVolumeClaim should have comment or be unexported (golint)
    • Line 80: warning: exported method Invocation.GetNamedPersistentVolumeClaim should have comment or be unexported (golint)
    • Line 103: warning: exported method Invocation.CreatePersistentVolumeClaim should have comment or be unexported (golint)
    • Line 108: warning: exported method Invocation.DeletePersistentVolumeClaim should have comment or be unexported (golint)
    • postgres/pkg/cmds/server/start.go
    • Line 39: warning: exported type PostgresServerOptions should have comment or be unexported (golint)
    • Line 47: warning: exported function NewPostgresServerOptions should have comment or be unexported (golint)
    • Line 65: warning: exported method PostgresServerOptions.AddFlags should have comment or be unexported (golint)
    • Line 70: warning: exported method PostgresServerOptions.Validate should have comment or be unexported (golint)
    • Line 74: warning: exported method PostgresServerOptions.Complete should have comment or be unexported (golint)
    • Line 78: warning: exported method PostgresServerOptions.Config should have comment or be unexported (golint)
    • Line 103: warning: exported method PostgresServerOptions.Run should have comment or be unexported (golint)
    • postgres/pkg/controller/pg_client.go
    • Line 26: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 32: warning: exported method Controller.GetPostgresClient should have comment or be unexported (golint)
    • postgres/test/e2e/framework/postgres.go
    • Line 29: warning: should not use dot imports (golint)
    • Line 42: warning: exported var JobPvcStorageSize should have comment or be unexported (golint)
    • Line 50: warning: exported method Invocation.Postgres should have comment or be unexported (golint)
    • Line 75: warning: exported method Framework.CreatePostgres should have comment or be unexported (golint)
    • Line 80: warning: exported method Framework.GetPostgres should have comment or be unexported (golint)
    • Line 84: warning: exported method Framework.PatchPostgres should have comment or be unexported (golint)
    • Line 93: warning: exported method Framework.DeletePostgres should have comment or be unexported (golint)
    • Line 97: warning: exported method Framework.EventuallyPostgres should have comment or be unexported (golint)
    • Line 114: warning: exported method Framework.EventuallyPostgresPhase should have comment or be unexported (golint)
    • Line 126: warning: exported method Framework.EventuallyPostgresPodCount should have comment or be unexported (golint)
    • Line 133: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 144: warning: exported method Framework.EventuallyPostgresReady should have comment or be unexported (golint)
    • Line 156: warning: exported method Framework.CleanPostgres should have comment or be unexported (golint)
    • Line 175: warning: exported method Framework.EvictPodsFromStatefulSet should have comment or be unexported (golint)
    • postgres/test/e2e/framework/util.go
    • Line 28: warning: should not use dot imports (golint)
    • Line 40: warning: exported method Framework.CleanWorkloadLeftOvers should have comment or be unexported (golint)
    • Line 62: warning: exported method Framework.PrintDebugHelpers should have comment or be unexported (golint)
    • Line 95: warning: exported method Framework.EventuallyWipedOut should have comment or be unexported (golint)
    • postgres/pkg/controller/statefulset.go
    • Line 46: warning: exported const PostgresInitContainerName should have comment (or a comment on this block) or be unexported (golint)
    • Line 182: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 222: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • postgres/pkg/admission/mutator.go
    • Line 40: warning: exported type PostgresMutator should have comment or be unexported (golint)
    • Line 51: warning: exported method PostgresMutator.Resource should have comment or be unexported (golint)
    • Line 60: warning: exported method PostgresMutator.Initialize should have comment or be unexported (golint)
    • Line 76: warning: exported method PostgresMutator.Admit should have comment or be unexported (golint)
    • postgres/test/e2e/framework/configmap.go
    • Line 30: warning: exported method Invocation.ConfigMapForInitialization should have comment or be unexported (golint)
    • Line 70: warning: exported method Invocation.GetCustomConfig should have comment or be unexported (golint)
    • Line 82: warning: exported method Invocation.CreateConfigMap should have comment or be unexported (golint)
    • Line 87: warning: exported method Framework.DeleteConfigMap should have comment or be unexported (golint)
    • postgres/test/e2e/framework/rbac.go
    • Line 35: warning: exported const GET should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported method Invocation.ServiceAccount should have comment or be unexported (golint)
    • Line 58: warning: exported method Invocation.RoleForPostgres should have comment or be unexported (golint)
    • Line 135: warning: exported method Invocation.RoleForSnapshot should have comment or be unexported (golint)
    • Line 160: warning: exported method Invocation.RoleBinding should have comment or be unexported (golint)
    • Line 181: warning: exported method Framework.CreateServiceAccount should have comment or be unexported (golint)
    • Line 186: warning: exported method Framework.CreateRole should have comment or be unexported (golint)
    • Line 191: warning: exported method Framework.CreateRoleBinding should have comment or be unexported (golint)
    • Line 196: warning: exported method Framework.DeleteRoleBinding should have comment or be unexported (golint)
    • postgres/test/e2e/framework/namespace.go
    • Line 27: warning: exported method Framework.Namespace should have comment or be unexported (golint)
    • Line 31: warning: exported method Framework.CreateNamespace should have comment or be unexported (golint)
    • Line 41: warning: exported method Framework.DeleteNamespace should have comment or be unexported (golint)
    • postgres/test/e2e/framework/stash.go
    • Line 26: warning: should not use dot imports (golint)
    • Line 40: warning: exported method Framework.FoundStashCRDs should have comment or be unexported (golint)
    • Line 44: warning: exported method Invocation.BackupConfiguration should have comment or be unexported (golint)
    • Line 75: warning: exported method Framework.CreateBackupConfiguration should have comment or be unexported (golint)
    • Line 80: warning: exported method Framework.DeleteBackupConfiguration should have comment or be unexported (golint)
    • Line 84: warning: exported method Framework.PauseBackupConfiguration should have comment or be unexported (golint)
    • Line 92: warning: exported method Framework.Repository should have comment or be unexported (golint)
    • Line 104: warning: exported method Framework.CreateRepository should have comment or be unexported (golint)
    • Line 110: warning: exported method Framework.DeleteRepository should have comment or be unexported (golint)
    • Line 115: warning: exported method Framework.EventuallySnapshotInRepository should have comment or be unexported (golint)
    • Line 128: warning: exported method Invocation.RestoreSession should have comment or be unexported (golint)
    • Line 163: warning: exported method Framework.CreateRestoreSession should have comment or be unexported (golint)
    • Line 168: warning: exported method Framework.DeleteRestoreSession should have comment or be unexported (golint)
    • Line 173: warning: exported method Framework.EventuallyRestoreSessionPhase should have comment or be unexported (golint)
    • postgres/test/e2e/framework/appbinding.go
    • Line 26: warning: should not use dot imports (golint)
    • Line 31: warning: exported method Framework.EventuallyAppBinding should have comment or be unexported (golint)
    • Line 48: warning: exported method Framework.CheckAppBindingSpec should have comment or be unexported (golint)
    • postgres/test/e2e/framework/database.go
    • Line 28: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 29: warning: should not use dot imports (golint)
    • Line 34: warning: exported method Framework.ForwardPort should have comment or be unexported (golint)
    • Line 55: warning: exported method Framework.GetPostgresClient should have comment or be unexported (golint)
    • Line 60: warning: exported method Framework.EventuallyCreateSchema should have comment or be unexported (golint)
    • Line 104: warning: exported method Framework.EventuallyPingDatabase should have comment or be unexported (golint)
    • Line 130: warning: exported method Framework.EventuallyCreateTable should have comment or be unexported (golint)
    • Line 165: warning: exported method Framework.EventuallyCountTable should have comment or be unexported (golint)
    • Line 196: warning: exported method Framework.CheckPostgres should have comment or be unexported (golint)
    • Line 200: warning: exported type PgStatArchiver should have comment or be unexported (golint)
    • Line 204: warning: exported method Framework.EventuallyCountArchive should have comment or be unexported (golint)
    • Line 234: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 246: warning: exported method Framework.EventuallyPGSettings should have comment or be unexported (golint)
    • postgres/test/e2e/framework/secret.go
    • Line 28: warning: should not use dot imports (golint)
    • Line 45: warning: exported var CustomSecretSuffix should have comment or be unexported (golint)
    • Line 50: warning: exported method Invocation.SecretForLocalBackend should have comment or be unexported (golint)
    • Line 60: warning: exported method Invocation.SecretForS3Backend should have comment or be unexported (golint)
    • Line 78: warning: exported method Invocation.SecretForMinioBackend should have comment or be unexported (golint)
    • Line 97: warning: exported method Invocation.SecretForMinioServer should have comment or be unexported (golint)
    • Line 124: warning: exported method Invocation.SecretForGCSBackend should have comment or be unexported (golint)
    • Line 142: warning: exported method Invocation.SecretForAzureBackend should have comment or be unexported (golint)
    • Line 160: warning: exported method Invocation.SecretForSwiftBackend should have comment or be unexported (golint)
    • Line 184: warning: exported method Invocation.SecretForDatabaseAuthentication should have comment or be unexported (golint)
    • Line 197: warning: exported method Invocation.SecretForDatabaseAuthenticationWithLabel should have comment or be unexported (golint)
    • Line 215: warning: exported method Invocation.PatchSecretForRestic should have comment or be unexported (golint)
    • Line 228: warning: exported method Framework.CreateSecret should have comment or be unexported (golint)
    • Line 233: warning: exported method Framework.UpdateSecret should have comment or be unexported (golint)
    • Line 252: warning: exported method Framework.DeleteSecret should have comment or be unexported (golint)
    • Line 260: warning: exported method Framework.EventuallyDBSecretCount should have comment or be unexported (golint)
    • Line 283: warning: exported method Framework.CheckSecret should have comment or be unexported (golint)
    • postgres/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)
    • postgres/test/e2e/framework/minio.go
    • Line 29: warning: should not use dot imports (golint)
    • Line 46: warning: exported const MINIO_PUBLIC_CRT_NAME should have comment (or a comment on this block) or be unexported (golint)
    • Line 74: warning: exported var MinioTLS should have comment or be unexported (golint)
    • Line 79: warning: exported method Invocation.CreateMinioServer should have comment or be unexported (golint)
    • Line 101: warning: exported method Invocation.CreateHTTPMinioServer should have comment or be unexported (golint)
    • Line 143: warning: exported method Invocation.CreateHTTPSMinioServer should have comment or be unexported (golint)
    • Line 188: warning: exported method Framework.IsTLS should have comment or be unexported (golint)
    • Line 192: warning: exported method Framework.IsMinio should have comment or be unexported (golint)
    • Line 199: warning: exported method Framework.ForwardMinioPort should have comment or be unexported (golint)
    • Line 214: warning: exported method Invocation.CreateBucket should have comment or be unexported (golint)
    • Line 251: warning: exported method Invocation.CreateMinioBucket should have comment or be unexported (golint)
    • Line 281: warning: exported method Invocation.CreateDeploymentForMinioServer should have comment or be unexported (golint)
    • Line 286: warning: exported method Invocation.MinioServerDeploymentHTTPS should have comment or be unexported (golint)
    • Line 413: warning: exported method Invocation.ServiceForMinioServer should have comment or be unexported (golint)
    • Line 445: warning: exported method Invocation.CreateService should have comment or be unexported (golint)
    • Line 449: warning: exported method Invocation.MinioServiceAddress should have comment or be unexported (golint)
    • Line 453: warning: exported method Framework.GetMinioPortForwardingEndPoint should have comment or be unexported (golint)
    • Line 461: warning: exported method Invocation.MinioServerSANs should have comment or be unexported (golint)
    • Line 472: warning: exported method Invocation.MinioServerDeploymentHTTP should have comment or be unexported (golint)
    • Line 565: warning: exported method Invocation.DeleteMinioServer should have comment or be unexported (golint)
    • Line 577: warning: exported method Framework.DeleteServiceForMinioServer should have comment or be unexported (golint)
    • Line 581: warning: exported method Framework.DeleteDeploymentForMinioServer should have comment or be unexported (golint)
    • postgres/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)
    • postgres/test/e2e/framework/framework.go
    • Line 25: warning: should not use dot imports (golint)
    • Line 38: warning: exported var DockerRegistry should have comment or be unexported (golint)
    • Line 42: warning: exported type Framework should have comment or be unexported (golint)
    • Line 56: warning: exported function New should have comment or be unexported (golint)
    • Line 86: warning: exported method Framework.Invoke should have comment or be unexported (golint)
    • Line 93: warning: exported method Invocation.App should have comment or be unexported (golint)
    • Line 97: warning: exported method Invocation.ExtClient should have comment or be unexported (golint)
    • Line 101: warning: exported type Invocation should have comment or be unexported (golint)
    • postgres/pkg/server/server.go
    • Line 54: warning: exported var Scheme should have comment or be unexported (golint)
    • Line 76: warning: exported type PostgresServerConfig 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 PostgresServer.Run should have comment or be unexported (golint)
    • Line 103: warning: exported type CompletedConfig should have comment or be unexported (golint)
    • postgres/pkg/controller/controller.go
    • Line 55: warning: exported type Controller should have comment or be unexported (golint)
    • Line 70: warning: exported function New should have comment or be unexported (golint)
    • Line 105: warning: comment on exported method Controller.EnsureCustomResourceDefinitions should be of the form "EnsureCustomResourceDefinitions ..." (golint)
    • Line 116: warning: comment on exported method Controller.Init should be of the form "Init ..." (golint)
    • Line 131: 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!


misspell97%

Misspell Finds commonly misspelled English words