Preparing report...

Report for github.com/RHsyseng/operator-utils

(v1.4.9)

A+    Excellent!    Found 27 issues across 44 files

Tweet

gofmt97%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


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!


gocyclo97%

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.

    • pkg/resource/compare/defaults.go
    • Line 106: warning: cyclomatic complexity 25 of function equalDeploymentConfigs() is high (> 15) (gocyclo)
    • Line 328: warning: cyclomatic complexity 22 of function ignoreGenerateContainerValues() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 18 of function equalDeployment() is high (> 15) (gocyclo)
    • Line 561: warning: cyclomatic complexity 17 of function equalBuildConfigs() is high (> 15) (gocyclo)

golint40%

Golint is a linter for Go source code.

    • pkg/resource/write/writer.go
    • Line 13: warning: exported type UpdateHooks should have comment or be unexported (golint)
    • Line 36: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 45: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 54: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 61: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 82: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 95: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 132: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • internal/platform/types.go
    • Line 9: warning: exported type PlatformType should have comment or be unexported (golint)
    • Line 12: warning: exported const OpenShift should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type PlatformInfo should have comment or be unexported (golint)
    • Line 22: warning: exported method PlatformInfo.K8SMajorVersion should have comment or be unexported (golint)
    • Line 26: warning: exported method PlatformInfo.K8SMinorVersion should have comment or be unexported (golint)
    • Line 30: warning: exported method PlatformInfo.IsOpenShift should have comment or be unexported (golint)
    • Line 34: warning: exported method PlatformInfo.IsKubernetes should have comment or be unexported (golint)
    • Line 45: warning: exported type OpenShiftVersion should have comment or be unexported (golint)
    • Line 49: warning: exported method OpenShiftVersion.MajorVersion should have comment or be unexported (golint)
    • Line 53: warning: exported method OpenShiftVersion.MinorVersion should have comment or be unexported (golint)
    • Line 57: warning: exported method OpenShiftVersion.BuildVersion should have comment or be unexported (golint)
    • Line 66: warning: exported method OpenShiftVersion.Compare should have comment or be unexported (golint)
    • Line 66: warning: receiver name v should be consistent with previous receiver name info for OpenShiftVersion (golint)
    • Line 94: warning: comment on exported type PlatformClusterInfo should be of the form "PlatformClusterInfo ..." (with optional leading article) (golint)
    • pkg/resource/compare/utils.go
    • Line 12: warning: exported function NewMapBuilder should have comment or be unexported (golint)
    • Line 17: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 21: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • pkg/resource/detector/stateManager.go
    • Line 6: warning: exported const RealmLabelSelectorsKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: exported type StateManager should have comment or be unexported (golint)
    • Line 17: warning: exported function GetStateManager should have comment or be unexported (golint)
    • Line 25: warning: exported method StateManager.GetState should have comment or be unexported (golint)
    • Line 31: warning: exported method StateManager.SetState should have comment or be unexported (golint)
    • Line 37: warning: exported method StateManager.Clear should have comment or be unexported (golint)
    • pkg/resource/write/hooks/update_hooks.go
    • Line 11: warning: exported type UpdateHookMap should have comment or be unexported (golint)
    • Line 16: warning: exported function DefaultUpdateHooks should have comment or be unexported (golint)
    • Line 25: warning: exported method UpdateHookMap.Trigger should have comment or be unexported (golint)
    • Line 25: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • pkg/logs/logs.go
    • Line 17: warning: exported type Logger should have comment or be unexported (golint)
    • Line 28: warning: exported function GetLogger should have comment or be unexported (golint)
    • Line 104: warning: exported function GetBoolEnv should have comment or be unexported (golint)
    • Line 113: warning: exported function GetEnv should have comment or be unexported (golint)
    • pkg/resource/compare/defaults.go
    • Line 30: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 34: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 38: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 42: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 46: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 58: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 631: warning: exported function EqualPairs should have comment or be unexported (golint)
    • Line 640: warning: exported function Equals should have comment or be unexported (golint)
    • pkg/resource/compare/map.go
    • Line 11: warning: exported type MapComparator should have comment or be unexported (golint)
    • Line 15: warning: exported function NewMapComparator should have comment or be unexported (golint)
    • Line 21: warning: exported method MapComparator.Compare should have comment or be unexported (golint)
    • Line 21: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • pkg/test/mock_imagestreamtag.go
    • Line 11: warning: exported type MockImageStreamTag should have comment or be unexported (golint)
    • Line 15: warning: exported method MockImageStreamTag.Create should have comment or be unexported (golint)
    • Line 24: warning: exported method MockImageStreamTag.Update should have comment or be unexported (golint)
    • Line 34: warning: exported method MockImageStreamTag.Delete should have comment or be unexported (golint)
    • Line 42: warning: exported method MockImageStreamTag.Get should have comment or be unexported (golint)
    • Line 49: warning: exported method MockImageStreamTag.List should have comment or be unexported (golint)
    • pkg/olm/deployment_status.go
    • Line 12: warning: exported function GetDaemonSetStatus should have comment or be unexported (golint)
    • Line 33: warning: exported function GetDeploymentStatus should have comment or be unexported (golint)
    • Line 53: warning: exported function GetDeploymentConfigStatus should have comment or be unexported (golint)
    • Line 95: warning: exported function GetSingleDaemonSetStatus should have comment or be unexported (golint)
    • Line 99: warning: exported function GetSingleDeploymentStatus should have comment or be unexported (golint)
    • Line 103: warning: exported function GetSingleStatefulSetStatus should have comment or be unexported (golint)
    • Line 110: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pkg/olm/types.go
    • Line 3: warning: exported type DeploymentStatus should have comment or be unexported (golint)
    • pkg/utils/kubernetes/finalizer.go
    • Line 12: warning: exported type Finalizer should have comment or be unexported (golint)
    • Line 17: warning: exported method ExtendedReconciler.RegisterFinalizer should have comment or be unexported (golint)
    • Line 26: warning: exported method ExtendedReconciler.UnregisterFinalizer should have comment or be unexported (golint)
    • pkg/resource/read/reader.go
    • Line 24: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 30: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 37: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 72: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 89: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • internal/platform/platform_versioner.go
    • Line 22: warning: exported type PlatformVersioner should have comment or be unexported (golint)
    • Line 26: warning: exported type Discoverer should have comment or be unexported (golint)
    • Line 33: warning: exported type K8SBasedPlatformVersioner should have comment or be unexported (golint)
    • Line 68: warning: comment on exported method K8SBasedPlatformVersioner.DefaultArgs should be of the form "DefaultArgs ..." (golint)
    • Line 87: warning: exported method K8SBasedPlatformVersioner.GetPlatformInfo should have comment or be unexported (golint)
    • Line 124: warning: comment on exported method K8SBasedPlatformVersioner.LookupOpenShiftVersion should be of the form "LookupOpenShiftVersion ..." (golint)
    • Line 174: warning: exported method K8SBasedPlatformVersioner.CompareOpenShiftVersion should have comment or be unexported (golint)
    • pkg/test/mock_service.go
    • Line 25: warning: exported type MockPlatformService should have comment or be unexported (golint)
    • Line 82: warning: exported type MockPlatformServiceBuilder should have comment or be unexported (golint)
    • Line 88: warning: exported function NewMockPlatformServiceBuilder should have comment or be unexported (golint)
    • Line 96: warning: exported method MockPlatformServiceBuilder.WithScheme should have comment or be unexported (golint)
    • Line 100: warning: exported method MockPlatformServiceBuilder.WithExtraScheme should have comment or be unexported (golint)
    • Line 104: warning: exported method MockPlatformServiceBuilder.Build should have comment or be unexported (golint)
    • Line 156: warning: exported method MockPlatformService.Create should have comment or be unexported (golint)
    • Line 160: warning: exported method MockPlatformService.Delete should have comment or be unexported (golint)
    • Line 164: warning: exported method MockPlatformService.Get should have comment or be unexported (golint)
    • Line 168: warning: exported method MockPlatformService.List should have comment or be unexported (golint)
    • Line 172: warning: exported method MockPlatformService.Update should have comment or be unexported (golint)
    • Line 176: warning: exported method MockPlatformService.Patch should have comment or be unexported (golint)
    • Line 180: warning: exported method MockPlatformService.DeleteAllOf should have comment or be unexported (golint)
    • Line 184: warning: exported method MockPlatformService.GetCached should have comment or be unexported (golint)
    • Line 188: warning: exported method MockPlatformService.ImageStreamTags should have comment or be unexported (golint)
    • Line 192: warning: exported method MockPlatformService.GetScheme should have comment or be unexported (golint)
    • Line 196: warning: exported method MockPlatformService.Status should have comment or be unexported (golint)
    • Line 200: warning: exported method MockPlatformService.IsMockService should have comment or be unexported (golint)
    • pkg/resource/test/utils.go
    • Line 13: warning: exported function GetRoutes should have comment or be unexported (golint)
    • Line 27: warning: exported function GetServices should have comment or be unexported (golint)
    • Line 41: warning: exported function GetDeploymentConfigs should have comment or be unexported (golint)
    • Line 60: warning: exported function GetBuildConfigs should have comment or be unexported (golint)
    • Line 70: warning: exported function GetDeployments should have comment or be unexported (golint)
    • Line 89: warning: exported function GetSecrets should have comment or be unexported (golint)
    • Line 104: warning: exported function GetEnvVars should have comment or be unexported (golint)
    • pkg/validation/schema.go
    • Line 12: warning: exported type Schema should have comment or be unexported (golint)
    • Line 17: warning: exported function New should have comment or be unexported (golint)
    • Line 26: warning: exported function NewVersioned should have comment or be unexported (golint)
    • pkg/validation/schema_sync.go
    • Line 10: warning: exported type SchemaEntry should have comment or be unexported (golint)
    • Line 130: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pkg/utils/kubernetes/kube_service.go
    • Line 17: warning: exported type KubernetesPlatformService should have comment or be unexported (golint)
    • Line 24: warning: exported function GetInstance should have comment or be unexported (golint)
    • Line 39: warning: exported method KubernetesPlatformService.Create should have comment or be unexported (golint)
    • Line 43: warning: exported method KubernetesPlatformService.Delete should have comment or be unexported (golint)
    • Line 47: warning: exported method KubernetesPlatformService.Get should have comment or be unexported (golint)
    • Line 51: warning: exported method KubernetesPlatformService.List should have comment or be unexported (golint)
    • Line 55: warning: exported method KubernetesPlatformService.Update should have comment or be unexported (golint)
    • Line 59: warning: exported method KubernetesPlatformService.Patch should have comment or be unexported (golint)
    • Line 63: warning: exported method KubernetesPlatformService.DeleteAllOf should have comment or be unexported (golint)
    • Line 67: warning: exported method KubernetesPlatformService.GetCached should have comment or be unexported (golint)
    • Line 71: warning: exported method KubernetesPlatformService.ImageStreamTags should have comment or be unexported (golint)
    • Line 75: warning: exported method KubernetesPlatformService.GetScheme should have comment or be unexported (golint)
    • Line 79: warning: exported method KubernetesPlatformService.Status should have comment or be unexported (golint)
    • Line 83: warning: exported method KubernetesPlatformService.IsMockService should have comment or be unexported (golint)
    • pkg/utils/kubernetes/reconciler.go
    • Line 10: warning: exported type ExtendedReconciler should have comment or be unexported (golint)
    • Line 17: warning: exported function NewExtendedReconciler should have comment or be unexported (golint)
    • Line 26: warning: exported method ExtendedReconciler.Reconcile should have comment or be unexported (golint)
    • pkg/resource/compare/types.go
    • Line 8: warning: exported type ResourceDelta should have comment or be unexported (golint)
    • Line 14: warning: exported method ResourceDelta.HasChanges should have comment or be unexported (golint)
    • Line 27: warning: exported type ResourceComparator should have comment or be unexported (golint)
    • Line 36: warning: exported function DefaultComparator should have comment or be unexported (golint)
    • Line 43: warning: exported function SimpleComparator 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!