Preparing report...

Report for github.com/Ghostbaby/zookeeper-operator

A+    Excellent!    Found 61 issues across 73 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!


gocyclo98%

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.


golint16%

Golint is a linter for Go source code.

    • zookeeper-operator/api/v1alpha1/workload_webhook.go
    • Line 35: warning: exported method Workload.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 127: warning: exported method Workload.CheckResourceMem should have comment or be unexported (golint)
    • Line 140: warning: exported method Workload.CheckResourceCpu should have comment or be unexported (golint)
    • Line 154: warning: exported function ResourceMemString2Int should have comment or be unexported (golint)
    • Line 170: warning: exported function ResourceCpuString2Int should have comment or be unexported (golint)
    • zookeeper-operator/controllers/workload/common/zk/base.go
    • Line 15: warning: exported type BaseClient should have comment or be unexported (golint)
    • Line 22: warning: exported method BaseClient.Get should have comment or be unexported (golint)
    • Line 26: warning: exported method BaseClient.Post should have comment or be unexported (golint)
    • Line 85: warning: exported method BaseClient.Close should have comment or be unexported (golint)
    • Line 95: warning: exported method BaseClient.Equal should have comment or be unexported (golint)
    • Line 105: warning: exported method BaseClient.IsAlive should have comment or be unexported (golint)
    • zookeeper-operator/controllers/k8s/discovery.go
    • Line 10: warning: comment on exported function WrapDiscoveryClient should be of the form "WrapDiscoveryClient ..." (golint)
    • Line 18: warning: comment on exported type DisClient should be of the form "DisClient ..." (with optional leading article) (golint)
    • Line 28: warning: exported type ClusterDiscoveryClient should have comment or be unexported (golint)
    • Line 40: warning: exported method ClusterDiscoveryClient.OpenAPISchema should have comment or be unexported (golint)
    • zookeeper-operator/controllers/getter.go
    • Line 21: warning: exported type Reconciler should have comment or be unexported (golint)
    • Line 26: warning: exported type ServiceGetter should have comment or be unexported (golint)
    • Line 31: warning: exported type GetOptions should have comment or be unexported (golint)
    • Line 45: warning: exported type ServiceGetterImpl should have comment or be unexported (golint)
    • Line 48: warning: exported method ServiceGetterImpl.Workload should have comment or be unexported (golint)
    • zookeeper-operator/controllers/k8s/new.go
    • Line 18: warning: exported function NewKubeClient should have comment or be unexported (golint)
    • Line 38: warning: exported type Factory should have comment or be unexported (golint)
    • Line 68: warning: exported function NewFactory should have comment or be unexported (golint)
    • zookeeper-operator/controllers/workload/model/const.go
    • Line 4: warning: exported const AppLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported const ZooKeeperStatefulset should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported const ExporterPort should have comment (or a comment on this block) or be unexported (golint)
    • Line 50: warning: exported const AgentPort should have comment (or a comment on this block) or be unexported (golint)
    • Line 60: warning: exported const ClientPort should have comment (or a comment on this block) or be unexported (golint)
    • Line 70: warning: exported const ServiceMonitorInterval should have comment (or a comment on this block) or be unexported (golint)
    • zookeeper-operator/controllers/workload_controller.go
    • Line 62: warning: exported var ReconcileWaitResult should have comment or be unexported (golint)
    • Line 75: warning: exported method WorkloadReconciler.Reconcile should have comment or be unexported (golint)
    • Line 124: warning: exported method WorkloadReconciler.SetupWithManager should have comment or be unexported (golint)
    • zookeeper-operator/controllers/workload/common/sts/utils.go
    • Line 76: warning: exported function GetExporterImage should have comment or be unexported (golint)
    • Line 80: warning: exported method STS.CreateExporterContainer should have comment or be unexported (golint)
    • Line 140: warning: comment on exported function GenJvmHeapSize should be of the form "GenJvmHeapSize ..." (golint)
    • Line 238: warning: exported function GetDataVolume should have comment or be unexported (golint)
    • Line 269: warning: exported method STS.CreateAgentContainer should have comment or be unexported (golint)
    • Line 335: warning: exported function GetStatefulSet should have comment or be unexported (golint)
    • zookeeper-operator/agent/g/cfg.go
    • Line 12: warning: exported type HttpConfig should have comment or be unexported (golint)
    • Line 18: warning: exported type GlobalConfig should have comment or be unexported (golint)
    • Line 28: warning: exported var ConfigFile should have comment or be unexported (golint)
    • Line 33: warning: exported function Config should have comment or be unexported (golint)
    • Line 39: warning: exported function Hostname should have comment or be unexported (golint)
    • Line 57: warning: exported function ParseConfig should have comment or be unexported (golint)
    • zookeeper-operator/agent/http/http.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 12: warning: exported type Dto should have comment or be unexported (golint)
    • Line 17: warning: exported function RenderJson should have comment or be unexported (golint)
    • Line 28: warning: exported function RenderDataJson should have comment or be unexported (golint)
    • Line 32: warning: exported function RenderMsgJson should have comment or be unexported (golint)
    • Line 36: warning: exported function AutoRender should have comment or be unexported (golint)
    • Line 45: warning: exported function Start should have comment or be unexported (golint)
    • zookeeper-operator/controllers/workload/common/utils/pod.go
    • Line 42: warning: exported function PodNames should have comment or be unexported (golint)
    • Line 50: warning: exported function GetReplicas should have comment or be unexported (golint)
    • Line 57: warning: exported function GetByName should have comment or be unexported (golint)
    • Line 69: warning: comment on exported function IsPodReady should be of the form "IsPodReady ..." (golint)
    • Line 80: warning: exported function GetStatefulSetPods should have comment or be unexported (golint)
    • Line 102: warning: exported function GetCurrentPods should have comment or be unexported (golint)
    • Line 146: warning: comment on exported function GetPodIp should be of the form "GetPodIp ..." (golint)
    • Line 162: warning: exported function GetServiceUrl should have comment or be unexported (golint)
    • zookeeper-operator/controllers/workload/getter.go
    • Line 27: warning: exported type Reconciler should have comment or be unexported (golint)
    • Line 32: warning: exported type Getter should have comment or be unexported (golint)
    • Line 43: warning: exported type GetOptions should have comment or be unexported (golint)
    • Line 59: warning: exported type GetterImpl should have comment or be unexported (golint)
    • Line 62: warning: exported method ReconcileWorkload.GetOptions should have comment or be unexported (golint)
    • Line 78: warning: exported method GetterImpl.ProvisionWorkload should have comment or be unexported (golint)
    • Line 95: warning: exported method GetterImpl.ScaleWorkload should have comment or be unexported (golint)
    • Line 106: warning: exported method GetterImpl.RolloutWorkload should have comment or be unexported (golint)
    • zookeeper-operator/api/v1alpha1/workload_types.go
    • Line 61: warning: exported type UpdateStrategy should have comment or be unexported (golint)
    • Line 78: warning: exported function Int32 should have comment or be unexported (golint)
    • Line 80: warning: exported type ClusterSpec should have comment or be unexported (golint)
    • Line 92: warning: exported type ExporterSpec should have comment or be unexported (golint)
    • Line 99: warning: comment on exported type Resources should be of the form "Resources ..." (with optional leading article) (golint)
    • Line 111: warning: comment on exported type Storage should be of the form "Storage ..." (with optional leading article) (golint)
    • Line 119: warning: exported type PodAffinity should have comment or be unexported (golint)
    • Line 161: warning: exported type ZkResource should have comment or be unexported (golint)
    • Line 168: warning: exported type ZooKeeperOrchestrationPhase should have comment or be unexported (golint)
    • Line 171: warning: comment on exported const ZooKeeperReadyPhase should be of the form "ZooKeeperReadyPhase ..." (golint)
    • Line 179: warning: exported const ZooKeeperDownScaling should have comment (or a comment on this block) or be unexported (golint)
    • zookeeper-operator/controllers/workload/common/cm/init_script.go
    • Line 13: warning: exported var ConfigVolume should have comment or be unexported (golint)
    • Line 40: warning: exported method SharedVolumeArray.Volumes should have comment or be unexported (golint)
    • Line 53: warning: comment on exported type SharedVolumeArray should be of the form "SharedVolumeArray ..." (with optional leading article) (golint)
    • Line 97: warning: exported const PrepareFsScriptConfigKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 160: warning: exported function RenderPrepareFsScript 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!