Preparing report...

Report for github.com/zalando/postgres-operator

A+    Excellent!    Found 23 issues across 123 files

Tweet

gofmt96%

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!


gocyclo91%

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-operator/pkg/cluster/cluster.go
    • Line 621: warning: cyclomatic complexity 44 of function (*Cluster).Update() is high (> 15) (gocyclo)
    • Line 234: warning: cyclomatic complexity 25 of function (*Cluster).Create() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 25 of function (*Cluster).compareStatefulSetWith() is high (> 15) (gocyclo)
    • Line 1170: warning: cyclomatic complexity 16 of function (*Cluster).initHumanUsers() is high (> 15) (gocyclo)
    • postgres-operator/pkg/cluster/sync.go
    • Line 262: warning: cyclomatic complexity 30 of function (*Cluster).syncStatefulSet() is high (> 15) (gocyclo)
    • Line 22: warning: cyclomatic complexity 24 of function (*Cluster).Sync() is high (> 15) (gocyclo)
    • Line 609: warning: cyclomatic complexity 19 of function (*Cluster).syncDatabases() is high (> 15) (gocyclo)
    • Line 531: warning: cyclomatic complexity 16 of function (*Cluster).syncRoles() is high (> 15) (gocyclo)
    • postgres-operator/pkg/cluster/connection_pooler.go
    • Line 682: warning: cyclomatic complexity 28 of function (*Cluster).syncConnectionPooler() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 20 of function (*Cluster).syncConnectionPoolerWorker() is high (> 15) (gocyclo)
    • Line 566: warning: cyclomatic complexity 16 of function (*Cluster).needSyncConnectionPoolerDefaults() is high (> 15) (gocyclo)
    • postgres-operator/pkg/controller/util.go
    • Line 264: warning: cyclomatic complexity 22 of function (*Controller).getInfrastructureRole() is high (> 15) (gocyclo)
    • Line 121: warning: cyclomatic complexity 17 of function (*Controller).getInfrastructureRoleDefinitions() is high (> 15) (gocyclo)

golint91%

Golint is a linter for Go source code.

    • postgres-operator/pkg/cluster/types.go
    • Line 73: warning: exported type TemplateParams should have comment or be unexported (golint)
    • Line 75: warning: exported type InstallFunction should have comment or be unexported (golint)
    • Line 77: warning: exported type SyncReason should have comment or be unexported (golint)
    • Line 79: warning: comment on exported var NoSync should be of the form "NoSync ..." (golint)
    • postgres-operator/pkg/util/k8sutil/k8sutil.go
    • Line 35: warning: exported function Int32ToPointer should have comment or be unexported (golint)
    • Line 70: warning: exported type MockSecretGetter should have comment or be unexported (golint)
    • Line 81: warning: exported type MockDeploymentGetter should have comment or be unexported (golint)
    • Line 84: warning: exported type MockDeploymentNotExistGetter should have comment or be unexported (golint)
    • Line 95: warning: exported type MockServiceGetter should have comment or be unexported (golint)
    • Line 98: warning: exported type MockServiceNotExistGetter should have comment or be unexported (golint)
    • Line 105: warning: exported type MockConfigMapsGetter should have comment or be unexported (golint)
    • Line 364: warning: exported method MockDeploymentGetter.Deployments should have comment or be unexported (golint)
    • Line 368: warning: exported method MockDeploymentNotExistGetter.Deployments should have comment or be unexported (golint)
    • Line 437: warning: exported method MockServiceGetter.Services should have comment or be unexported (golint)
    • Line 441: warning: exported method MockServiceNotExistGetter.Services should have comment or be unexported (golint)
    • Line 491: warning: exported function ClientMissingObjects should have comment or be unexported (golint)
    • postgres-operator/pkg/util/util.go
    • Line 40: warning: comment on exported function True should be of the form "True ..." (golint)
    • Line 46: warning: exported function False should have comment or be unexported (golint)
    • Line 73: warning: exported type Hasher should have comment or be unexported (golint)
    • Line 74: warning: exported type Random should have comment or be unexported (golint)
    • Line 76: warning: exported type Encryptor should have comment or be unexported (golint)
    • Line 81: warning: exported function NewEncryptor should have comment or be unexported (golint)
    • Line 95: warning: exported method Encryptor.PGUserPassword should have comment or be unexported (golint)
    • Line 104: warning: exported method Encryptor.PGUserPasswordMD5 should have comment or be unexported (golint)
    • Line 109: warning: exported method Encryptor.PGUserPasswordScramSHA256 should have comment or be unexported (golint)
    • Line 139: warning: comment on exported function IsEqualIgnoreOrder should be of the form "IsEqualIgnoreOrder ..." (golint)
    • Line 144: warning: don't use underscores in Go names; var a_copy should be aCopy (golint)
    • Line 145: warning: don't use underscores in Go names; var b_copy should be bCopy (golint)
    • Line 154: warning: comment on exported function StringSliceReplaceElement should be of the form "StringSliceReplaceElement ..." (golint)
    • Line 208: warning: comment on exported function SliceContains should be of the form "SliceContains ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words