Preparing report...

Report for kubedb.dev/elasticsearch

A    Great!    Found 52 issues across 63 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!


gocyclo80%

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.


golint20%

Golint is a linter for Go source code.

    • /kubedb.dev/elasticsearch/pkg/distribution/search_guard/nodes.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported method Elasticsearch.EnsureMasterNodes should have comment or be unexported (golint)
    • Line 113: warning: exported method Elasticsearch.EnsureDataNodes should have comment or be unexported (golint)
    • Line 178: warning: exported method Elasticsearch.EnsureIngestNodes should have comment or be unexported (golint)
    • Line 242: warning: exported method Elasticsearch.EnsureCombinedNode should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/lib/cert/pkcs12/pkcs12.go
    • Line 43: warning: exported function CreateCaCertificateJKS should have comment or be unexported (golint)
    • Line 79: warning: exported function CreateNodeCertificateJKS should have comment or be unexported (golint)
    • Line 131: warning: exported function CreateSGAdminCertificateJKS should have comment or be unexported (golint)
    • Line 188: warning: exported function CreateClientCertificateJKS should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/open_distro/open_distro.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported type Elasticsearch should have comment or be unexported (golint)
    • Line 41: warning: exported function New should have comment or be unexported (golint)
    • Line 50: warning: exported method Elasticsearch.UpdatedElasticsearch should have comment or be unexported (golint)
    • Line 54: warning: exported method Elasticsearch.RequiredCertSecretNames should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/controller/health.go
    • Line 38: warning: exported method Controller.RunHealthChecker should have comment or be unexported (golint)
    • Line 44: warning: exported method Controller.CheckElasticsearchHealth should have comment or be unexported (golint)
    • Line 58: warning: exported method Controller.CheckElasticsearchHealthOnce should have comment or be unexported (golint)
    • Line 213: warning: exported method Controller.GetElasticsearchClient should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/elastic_stack/nodes.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported method Elasticsearch.EnsureMasterNodes should have comment or be unexported (golint)
    • Line 113: warning: exported method Elasticsearch.EnsureDataNodes should have comment or be unexported (golint)
    • Line 178: warning: exported method Elasticsearch.EnsureIngestNodes should have comment or be unexported (golint)
    • Line 242: warning: exported method Elasticsearch.EnsureCombinedNode should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/open_distro/config.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 36: warning: exported const ConfigFileName should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: don't use underscores in Go names; var opendistro_security_enabled should be opendistroSecurityEnabled (golint)
    • Line 69: warning: don't use underscores in Go names; var opendistro_security_disabled should be opendistroSecurityDisabled (golint)
    • Line 76: warning: don't use underscores in Go names; var https_enabled should be httpsEnabled (golint)
    • Line 86: warning: don't use underscores in Go names; var https_disabled should be httpsDisabled (golint)
    • Line 90: warning: exported method Elasticsearch.EnsureDefaultConfig should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/lib/user/es-user.go
    • Line 28: warning: comment on exported function HasUser should be of the form "HasUser ..." (golint)
    • Line 37: warning: comment on exported function SetMissingUser should be of the form "SetMissingUser ..." (golint)
    • Line 46: warning: exported function SetPasswordHashForUser should have comment or be unexported (golint)
    • Line 70: warning: comment on exported function InUserConfigCompareEqual should be of the form "InUserConfigCompareEqual ..." (golint)
    • /kubedb.dev/elasticsearch/pkg/controller/controller.go
    • Line 52: warning: exported type Controller should have comment or be unexported (golint)
    • Line 68: warning: exported function New should have comment or be unexported (golint)
    • Line 103: warning: comment on exported method Controller.EnsureCustomResourceDefinitions should be of the form "EnsureCustomResourceDefinitions ..." (golint)
    • Line 114: warning: comment on exported method Controller.Init should be of the form "Init ..." (golint)
    • Line 130: warning: comment on exported method Controller.Run should be of the form "Run ..." (golint)
    • /kubedb.dev/elasticsearch/pkg/admission/mutator.go
    • Line 40: warning: exported type ElasticsearchMutator should have comment or be unexported (golint)
    • Line 51: warning: exported method ElasticsearchMutator.Resource should have comment or be unexported (golint)
    • Line 60: warning: exported method ElasticsearchMutator.Initialize should have comment or be unexported (golint)
    • Line 76: warning: exported method ElasticsearchMutator.Admit should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/search_guard/config.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 36: warning: exported const ConfigFileName should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: don't use underscores in Go names; var searchguard_security_enabled should be searchguardSecurityEnabled (golint)
    • Line 71: warning: don't use underscores in Go names; var searchguard_security_disabled should be searchguardSecurityDisabled (golint)
    • Line 75: warning: don't use underscores in Go names; var https_enabled should be httpsEnabled (golint)
    • Line 85: warning: don't use underscores in Go names; var https_disabled should be httpsDisabled (golint)
    • Line 89: warning: exported method Elasticsearch.EnsureDefaultConfig should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/search_guard/search_guard.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported type Elasticsearch should have comment or be unexported (golint)
    • Line 41: warning: exported function New should have comment or be unexported (golint)
    • Line 50: warning: exported method Elasticsearch.UpdatedElasticsearch should have comment or be unexported (golint)
    • Line 54: warning: exported method Elasticsearch.RequiredCertSecretNames should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/open_distro/nodes.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported method Elasticsearch.EnsureMasterNodes should have comment or be unexported (golint)
    • Line 113: warning: exported method Elasticsearch.EnsureDataNodes should have comment or be unexported (golint)
    • Line 178: warning: exported method Elasticsearch.EnsureIngestNodes should have comment or be unexported (golint)
    • Line 242: warning: exported method Elasticsearch.EnsureCombinedNode should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/server/server.go
    • Line 54: warning: exported var Scheme should have comment or be unexported (golint)
    • Line 76: warning: exported type ElasticsearchServerConfig 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 ElasticsearchServer.Run should have comment or be unexported (golint)
    • Line 103: warning: exported type CompletedConfig should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/elastic_stack/config.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 31: warning: exported const ConfigFileName should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: don't use underscores in Go names; var xpack_security_enabled should be xpackSecurityEnabled (golint)
    • Line 44: warning: don't use underscores in Go names; var xpack_security_disabled should be xpackSecurityDisabled (golint)
    • Line 48: warning: don't use underscores in Go names; var https_enabled should be httpsEnabled (golint)
    • Line 55: warning: don't use underscores in Go names; var https_disabled should be httpsDisabled (golint)
    • Line 59: warning: exported method Elasticsearch.EnsureDefaultConfig should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/distribution/elastic_stack/elastic_stack.go
    • Line 17: warning: don't use an underscore in package name (golint)
    • Line 28: warning: exported type Elasticsearch should have comment or be unexported (golint)
    • Line 37: warning: exported function New should have comment or be unexported (golint)
    • Line 46: warning: exported method Elasticsearch.UpdatedElasticsearch should have comment or be unexported (golint)
    • Line 50: warning: exported method Elasticsearch.RequiredCertSecretNames should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/cmds/server/options.go
    • Line 44: warning: exported type ExtraOptions should have comment or be unexported (golint)
    • Line 56: warning: exported function NewExtraOptions should have comment or be unexported (golint)
    • Line 70: warning: exported method ExtraOptions.AddGoFlags should have comment or be unexported (golint)
    • Line 82: warning: exported method ExtraOptions.AddFlags should have comment or be unexported (golint)
    • Line 88: warning: exported method ExtraOptions.ApplyTo should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/cmds/server/start.go
    • Line 39: warning: exported type ElasticsearchServerOptions should have comment or be unexported (golint)
    • Line 47: warning: exported function NewElasticsearchServerOptions should have comment or be unexported (golint)
    • Line 66: warning: exported method ElasticsearchServerOptions.AddFlags should have comment or be unexported (golint)
    • Line 71: warning: exported method ElasticsearchServerOptions.Validate should have comment or be unexported (golint)
    • Line 75: warning: exported method ElasticsearchServerOptions.Complete should have comment or be unexported (golint)
    • Line 79: warning: exported method ElasticsearchServerOptions.Config should have comment or be unexported (golint)
    • Line 104: warning: exported method ElasticsearchServerOptions.Run should have comment or be unexported (golint)
    • /kubedb.dev/elasticsearch/pkg/lib/cert/pkcs8/pkcs8.go
    • Line 41: warning: comment on exported function CreateCaCertificate should be of the form "CreateCaCertificate ..." (golint)
    • Line 78: warning: comment on exported function CreateTransportCertificate should be of the form "CreateTransportCertificate ..." (golint)
    • Line 120: warning: comment on exported function CreateHTTPCertificate should be of the form "CreateHTTPCertificate ..." (golint)
    • Line 167: warning: comment on exported function CreateClientCertificate should be of the form "CreateClientCertificate ..." (golint)
    • /kubedb.dev/elasticsearch/pkg/admission/validator.go
    • Line 46: warning: exported type ElasticsearchValidator should have comment or be unexported (golint)
    • Line 64: warning: exported method ElasticsearchValidator.Resource should have comment or be unexported (golint)
    • Line 73: warning: exported method ElasticsearchValidator.Initialize should have comment or be unexported (golint)
    • Line 89: warning: exported method ElasticsearchValidator.Admit 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!