Preparing report...

Report for github.com/nirmata/kyverno

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


gocyclo94%

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.

    • kyverno/pkg/policy/validate.go
    • Line 180: warning: cyclomatic complexity 68 of function doMatchAndExcludeConflict() is high (> 15) (gocyclo)
    • Line 29: warning: cyclomatic complexity 37 of function Validate() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 19 of function isLabelAndAnnotationsString() is high (> 15) (gocyclo)
    • kyverno/pkg/kyverno/common/common.go
    • Line 416: warning: cyclomatic complexity 29 of function ApplyPolicyOnResource() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 17 of function GetPolicies() is high (> 15) (gocyclo)
    • Line 572: warning: cyclomatic complexity 17 of function GetPoliciesFromPaths() is high (> 15) (gocyclo)
    • Line 315: warning: cyclomatic complexity 16 of function GetVariable() is high (> 15) (gocyclo)

golint84%

Golint is a linter for Go source code.

    • kyverno/pkg/policyreport/policyreport.go
    • Line 16: warning: exported type PolicyReportEraser should have comment or be unexported (golint)
    • Line 20: warning: exported type EraseResultsEntries should have comment or be unexported (golint)
    • Line 22: warning: exported method ReportGenerator.EraseResultsEntries should have comment or be unexported (golint)
    • kyverno/pkg/kyverno/test/command.go
    • Line 65: warning: exported type Test should have comment or be unexported (golint)
    • Line 73: warning: exported type SkippedPolicy should have comment or be unexported (golint)
    • Line 79: warning: exported type TestResults should have comment or be unexported (golint)
    • Line 86: warning: exported type ReportResult should have comment or be unexported (golint)
    • Line 91: warning: exported type Resource should have comment or be unexported (golint)
    • Line 96: warning: exported type Table should have comment or be unexported (golint)
    • Line 101: warning: exported type Policy should have comment or be unexported (golint)
    • Line 106: warning: exported type Values should have comment or be unexported (golint)
    • kyverno/test/e2e/utils.go
    • Line 24: warning: exported type APIRequest should have comment or be unexported (golint)
    • Line 137: warning: exported function CallAPI should have comment or be unexported (golint)
    • kyverno/pkg/engine/variables/vars.go
    • Line 40: warning: exported function SubstituteAll should have comment or be unexported (golint)
    • Line 49: warning: exported function SubstituteAllForceMutate should have comment or be unexported (golint)
    • Line 312: warning: exported function FindAndShiftReferences should have comment or be unexported (golint)
    • Line 358: warning: exported function SubstituteAllInRule should have comment or be unexported (golint)
    • Line 379: warning: exported function RuleToUntyped should have comment or be unexported (golint)
    • Line 394: warning: exported function UntypedToRule should have comment or be unexported (golint)
    • kyverno/pkg/kyverno/common/common.go
    • Line 36: warning: comment on exported type Policy should be of the form "Policy ..." (with optional leading article) (golint)
    • Line 43: warning: exported type Rule should have comment or be unexported (golint)
    • Line 48: warning: exported type Values should have comment or be unexported (golint)
    • Line 53: warning: exported type Resource should have comment or be unexported (golint)
    • Line 58: warning: exported type NamespaceSelector should have comment or be unexported (golint)
    • Line 63: warning: exported function GetPolicies should have comment or be unexported (golint)
    • Line 315: warning: exported function GetVariable should have comment or be unexported (golint)
    • kyverno/pkg/metrics/common_types.go
    • Line 3: warning: exported type PolicyValidationMode should have comment or be unexported (golint)
    • Line 6: warning: exported const Enforce should have comment (or a comment on this block) or be unexported (golint)
    • Line 10: warning: exported type PolicyType should have comment or be unexported (golint)
    • Line 13: warning: exported const Cluster should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type PolicyBackgroundMode should have comment or be unexported (golint)
    • Line 20: warning: exported const BackgroundTrue should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type RuleType should have comment or be unexported (golint)
    • Line 27: warning: exported const Validate should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type RuleResult should have comment or be unexported (golint)
    • Line 36: warning: exported const Pass should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported type RuleExecutionCause should have comment or be unexported (golint)
    • Line 46: warning: exported const AdmissionRequest should have comment (or a comment on this block) or be unexported (golint)
    • Line 50: warning: exported type ResourceRequestOperation should have comment or be unexported (golint)
    • Line 53: warning: exported const ResourceCreated should have comment (or a comment on this block) or be unexported (golint)
    • kyverno/pkg/metrics/parsers.go
    • Line 9: warning: exported function ParsePolicyValidationMode should have comment or be unexported (golint)
    • Line 20: warning: exported function ParsePolicyBackgroundMode should have comment or be unexported (golint)
    • Line 27: warning: exported function ParseRuleType should have comment or be unexported (golint)
    • kyverno/pkg/policycache/cache.go
    • Line 153: warning: receiver name pc should be consistent with previous receiver name m for pMap (golint)
    • Line 202: warning: receiver name m should be consistent with previous receiver name pc for policyCache (golint)
    • kyverno/pkg/generate/validate.go
    • Line 14: warning: exported type Handler should have comment or be unexported (golint)
    • Line 135: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 143: warning: exported method Handler.Handle should have comment or be unexported (golint)
    • kyverno/pkg/kyverno/store/store.go
    • Line 3: warning: exported var Mock should have comment or be unexported (golint)
    • Line 4: warning: exported var ContextVar should have comment or be unexported (golint)
    • Line 6: warning: exported function SetMock should have comment or be unexported (golint)
    • Line 10: warning: exported function GetMock should have comment or be unexported (golint)
    • Line 14: warning: exported function SetContext should have comment or be unexported (golint)
    • Line 18: warning: exported function GetContext should have comment or be unexported (golint)
    • Line 22: warning: exported function GetPolicyFromContext should have comment or be unexported (golint)
    • Line 31: warning: exported function GetPolicyRuleFromContext should have comment or be unexported (golint)
    • Line 44: warning: exported type Context should have comment or be unexported (golint)
    • Line 48: warning: exported type Policy should have comment or be unexported (golint)
    • Line 53: warning: exported type Rule should have comment or be unexported (golint)
    • kyverno/pkg/metrics/policychanges/types.go
    • Line 7: warning: exported type PolicyChangeType should have comment or be unexported (golint)
    • Line 10: warning: exported const PolicyCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported type PromMetrics should have comment or be unexported (golint)
    • kyverno/pkg/metrics/policyruleresults/parsers.go
    • Line 9: warning: exported function ParsePromMetrics should have comment or be unexported (golint)
    • Line 13: warning: exported function ParseRuleTypeFromEngineRuleResponse should have comment or be unexported (golint)
    • Line 26: warning: exported function ParseResourceRequestOperation should have comment or be unexported (golint)
    • kyverno/pkg/kyverno/apply/command.go
    • Line 36: warning: exported type Resource should have comment or be unexported (golint)
    • Line 41: warning: exported type Policy should have comment or be unexported (golint)
    • Line 46: warning: exported type Values should have comment or be unexported (golint)
    • Line 50: warning: exported type SkippedPolicy should have comment or be unexported (golint)
    • Line 108: warning: exported function Command should have comment or be unexported (golint)
    • kyverno/pkg/policyreport/reportrequest.go
    • Line 132: warning: exported type EngineResponseResult should have comment or be unexported (golint)
    • Line 137: warning: exported method Info.ToKey should have comment or be unexported (golint)
    • Line 150: warning: exported method Info.GetRuleLength should have comment or be unexported (golint)
    • kyverno/pkg/metrics/metrics.go
    • Line 7: warning: exported type PromConfig should have comment or be unexported (golint)
    • Line 12: warning: exported type PromMetrics should have comment or be unexported (golint)
    • Line 20: warning: exported function NewPromConfig should have comment or be unexported (golint)
    • kyverno/pkg/metrics/policyruleinfo/types.go
    • Line 7: warning: exported type PolicyRuleInfoMetricChangeType should have comment or be unexported (golint)
    • Line 10: warning: exported const PolicyRuleCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported type PromMetrics should have comment or be unexported (golint)
    • kyverno/pkg/utils/util.go
    • Line 204: warning: comment on exported function ApiextensionsJsonToKyvernoConditions should be of the form "ApiextensionsJsonToKyvernoConditions ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell99%

Misspell Finds commonly misspelled English words