Preparing report...

Report for github.com/newrelic/newrelic-kubernetes-operator

A+    Excellent!    Found 26 issues across 58 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!


golint58%

Golint is a linter for Go source code.

    • newrelic-kubernetes-operator/api/v1/alerts_apmcondition_webhook.go
    • Line 39: warning: exported method AlertsAPMCondition.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 128: warning: exported method AlertsAPMCondition.ValidateType should have comment or be unexported (golint)
    • Line 142: warning: exported method AlertsAPMCondition.ValidateMetric should have comment or be unexported (golint)
    • Line 184: warning: exported method AlertsAPMCondition.ValidateTerms should have comment or be unexported (golint)
    • Line 223: warning: exported method AlertsAPMCondition.ValidateUserDefinedValueFunction should have comment or be unexported (golint)
    • Line 238: warning: exported method AlertsAPMCondition.CheckExistingPolicyID should have comment or be unexported (golint)
    • Line 291: warning: exported method AlertsAPMCondition.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • Line 303: warning: exported method AlertsAPMCondition.CheckRequiredFields should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/alerts_policy_webhook.go
    • Line 36: warning: exported method AlertsPolicy.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 135: warning: exported method AlertsPolicy.DefaultIncidentPreference should have comment or be unexported (golint)
    • Line 143: warning: exported method AlertsPolicy.CheckForDuplicateConditions should have comment or be unexported (golint)
    • Line 158: warning: exported method AlertsPolicy.ValidateIncidentPreference should have comment or be unexported (golint)
    • Line 169: warning: exported method AlertsPolicy.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/policy_webhook.go
    • Line 34: warning: exported method Policy.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 132: warning: exported method Policy.DefaultIncidentPreference should have comment or be unexported (golint)
    • Line 140: warning: exported method Policy.CheckForDuplicateConditions should have comment or be unexported (golint)
    • Line 156: warning: exported method Policy.ValidateIncidentPreference should have comment or be unexported (golint)
    • Line 167: warning: exported method Policy.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/apmalertcondition_webhook.go
    • Line 47: warning: exported type InvalidAttributeSlice should have comment or be unexported (golint)
    • Line 57: warning: exported method ApmAlertCondition.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 147: warning: exported method ApmAlertCondition.ValidateType should have comment or be unexported (golint)
    • Line 163: warning: exported method ApmAlertCondition.ValidateMetric should have comment or be unexported (golint)
    • Line 207: warning: exported method ApmAlertCondition.ValidateTerms should have comment or be unexported (golint)
    • Line 249: warning: exported method ApmAlertCondition.ValidateUserDefinedValueFunction should have comment or be unexported (golint)
    • Line 266: warning: exported method ApmAlertCondition.CheckExistingPolicyID should have comment or be unexported (golint)
    • Line 325: warning: exported method ApmAlertCondition.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • Line 339: warning: exported method ApmAlertCondition.CheckRequiredFields should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/policy_types.go
    • Line 84: warning: exported method PolicySpec.APIPolicy should have comment or be unexported (golint)
    • Line 94: warning: exported method PolicyCondition.SpecHash should have comment or be unexported (golint)
    • Line 109: warning: exported method PolicyCondition.GetNamespace should have comment or be unexported (golint)
    • Line 166: warning: exported method PolicyCondition.GenerateSpecFromNrqlConditionSpec should have comment or be unexported (golint)
    • Line 171: warning: exported method PolicyCondition.GenerateSpecFromApmConditionSpec should have comment or be unexported (golint)
    • Line 176: warning: exported method PolicyCondition.ReturnNrqlConditionSpec should have comment or be unexported (golint)
    • Line 183: warning: exported method PolicyCondition.ReturnApmConditionSpec should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/internal/testutil/alerts.go
    • Line 22: warning: exported function AlertsPolicyTestSetup should have comment or be unexported (golint)
    • Line 45: warning: exported function NewTestAlertsPolicy should have comment or be unexported (golint)
    • Line 70: warning: exported function NewTestAlertsNrqlCondition should have comment or be unexported (golint)
    • Line 91: warning: exported function NewTestAlertsPolicyConditionSpec should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/alerts_nrqlcondition_webhook.go
    • Line 39: warning: exported method AlertsNrqlCondition.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 101: warning: exported method AlertsNrqlCondition.CheckExistingPolicyID should have comment or be unexported (golint)
    • Line 139: warning: exported method AlertsNrqlCondition.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • Line 151: warning: exported method AlertsNrqlCondition.CheckRequiredFields should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/alerts_policy_types.go
    • Line 48: warning: exported type AlertsPolicyConditionSpec should have comment or be unexported (golint)
    • Line 84: warning: exported method AlertsPolicySpec.ToAlertsPolicy should have comment or be unexported (golint)
    • Line 92: warning: exported method AlertsPolicySpec.ToAlertsPolicyUpdateInput should have comment or be unexported (golint)
    • Line 100: warning: exported method AlertsPolicySpec.ToAlertsPolicyInput should have comment or be unexported (golint)
    • Line 108: warning: exported method AlertsPolicyCondition.SpecHash should have comment or be unexported (golint)
    • Line 123: warning: exported method AlertsPolicyCondition.GetNamespace should have comment or be unexported (golint)
    • Line 175: warning: exported method AlertsPolicyCondition.GenerateSpecFromNrqlConditionSpec should have comment or be unexported (golint)
    • Line 180: warning: exported method AlertsPolicyCondition.GenerateSpecFromApmConditionSpec should have comment or be unexported (golint)
    • Line 185: warning: exported method AlertsPolicyCondition.ReturnNrqlConditionSpec should have comment or be unexported (golint)
    • Line 192: warning: exported method AlertsPolicyCondition.ReturnApmConditionSpec should have comment or be unexported (golint)
    • newrelic-kubernetes-operator/api/v1/nrqlalertcondition_webhook.go
    • Line 38: warning: exported method NrqlAlertCondition.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 108: warning: exported method NrqlAlertCondition.CheckExistingPolicyID should have comment or be unexported (golint)
    • Line 161: warning: exported method NrqlAlertCondition.CheckForAPIKeyOrSecret should have comment or be unexported (golint)
    • Line 175: warning: exported method NrqlAlertCondition.CheckRequiredFields should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!