Preparing report...

Report for github.com/toughnoah/elastalert-operator

A+    Excellent!    Found 13 issues across 25 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!


gocyclo100%

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.

No problems detected. Good job!


golint56%

Golint is a linter for Go source code.

    • elastalert-operator/controllers/podspec/deployment.go
    • Line 19: warning: exported type PodTemplateBuilder should have comment or be unexported (golint)
    • Line 25: warning: exported function GenerateNewDeployment should have comment or be unexported (golint)
    • Line 36: warning: exported function BuildDeployment should have comment or be unexported (golint)
    • Line 63: warning: context.Context should be the first parameter of a function (golint)
    • Line 63: warning: exported function WaitForStability should have comment or be unexported (golint)
    • elastalert-operator/controllers/podspec/podtemplate.go
    • Line 9: warning: exported function BuildPodTemplateSpec should have comment or be unexported (golint)
    • Line 114: warning: exported function NewPodTemplateBuilder should have comment or be unexported (golint)
    • Line 149: warning: exported function GetDefaultContainerPorts should have comment or be unexported (golint)
    • Line 159: warning: exported function GetUtcTimeString should have comment or be unexported (golint)
    • Line 162: warning: exported function GetUtcTime should have comment or be unexported (golint)
    • elastalert-operator/controllers/deployment_controllers.go
    • Line 18: warning: exported type DeploymentReconciler should have comment or be unexported (golint)
    • Line 24: warning: exported method DeploymentReconciler.Reconcile should have comment or be unexported (golint)
    • Line 62: warning: exported method DeploymentReconciler.SetupWithManager should have comment or be unexported (golint)
    • Line 79: warning: context.Context should be the first parameter of a function (golint)
    • elastalert-operator/api/v1alpha1/elastalert_types.go
    • Line 26: warning: comment on exported const ElastAlertPhraseFailed should be of the form "ElastAlertPhraseFailed ..." (golint)
    • Line 28: warning: comment on exported const ElastAlertPhraseSucceeded should be of the form "ElastAlertPhraseSucceeded ..." (golint)
    • Line 31: warning: exported const ElastAlertAvailableReason should have comment (or a comment on this block) or be unexported (golint)
    • Line 76: warning: comment on exported type ElastalertStatus should be of the form "ElastalertStatus ..." (with optional leading article) (golint)
    • Line 86: warning: comment on exported type Elastalert should be of the form "Elastalert ..." (with optional leading article) (golint)
    • elastalert-operator/controllers/podspec/defaulter.go
    • Line 23: warning: exported function NewDefaulter should have comment or be unexported (golint)
    • Line 46: warning: exported method Defaulter.WithCommand should have comment or be unexported (golint)
    • Line 53: warning: exported method Defaulter.WithArgs should have comment or be unexported (golint)
    • Line 60: warning: exported method Defaulter.WithPorts should have comment or be unexported (golint)
    • Line 92: warning: exported method Defaulter.WithReadinessProbe should have comment or be unexported (golint)
    • Line 99: warning: exported method Defaulter.WithLivenessProbe should have comment or be unexported (golint)
    • Line 116: warning: exported method Defaulter.WithEnv should have comment or be unexported (golint)
    • Line 143: warning: exported method Defaulter.WithVolumeMounts should have comment or be unexported (golint)
    • Line 156: warning: exported method Defaulter.WithPreStopHook should have comment or be unexported (golint)
    • Line 348: warning: exported method PodTemplateBuilder.WithPreStopHook should have comment or be unexported (golint)
    • elastalert-operator/controllers/elastalert_controller.go
    • Line 44: warning: comment on exported method ElastalertReconciler.Reconcile should be of the form "Reconcile ..." (golint)
    • Line 119: warning: context.Context should be the first parameter of a function (golint)
    • Line 119: warning: exported function UpdateElastalertStatus should have comment or be unexported (golint)
    • Line 127: warning: context.Context should be the first parameter of a function (golint)
    • Line 127: warning: exported function UpdateStatus should have comment or be unexported (golint)
    • Line 145: warning: context.Context should be the first parameter of a function (golint)
    • Line 186: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 198: warning: context.Context should be the first parameter of a function (golint)
    • Line 222: warning: context.Context should be the first parameter of a function (golint)
    • Line 242: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 255: warning: exported function NewCondition should have comment or be unexported (golint)
    • elastalert-operator/controllers/podspec/configmap.go
    • Line 14: warning: exported function GenerateNewConfigmap should have comment or be unexported (golint)
    • Line 45: warning: exported function PatchConfigSettings should have comment or be unexported (golint)
    • Line 75: warning: exported function ConfigMapsToMap should have comment or be unexported (golint)
    • Line 83: warning: exported function GenerateYamlMap should have comment or be unexported (golint)
    • Line 101: warning: exported function PatchAlertSettings should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign88%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!