Preparing report...

Report for github.com/atlassian/smith

A+    Excellent!    Found 43 issues across 112 files

Tweet

gofmt98%

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!


gocyclo96%

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.

    • smith/pkg/store/catalog.go
    • Line 142: warning: cyclomatic complexity 22 of function (*Catalog).GetPlanOf() is high (> 15) (gocyclo)
    • Line 92: warning: cyclomatic complexity 21 of function (*Catalog).GetClassOf() is high (> 15) (gocyclo)
    • smith/pkg/controller/bundlec/resource_sync_task.go
    • Line 147: warning: cyclomatic complexity 22 of function (*resourceSyncTask).processResource() is high (> 15) (gocyclo)
    • Line 423: warning: cyclomatic complexity 20 of function (*resourceSyncTask).prevalidate() is high (> 15) (gocyclo)
    • Line 522: warning: cyclomatic complexity 19 of function (*resourceSyncTask).evalSpec() is high (> 15) (gocyclo)

golint64%

Golint is a linter for Go source code.

    • smith/pkg/plugin/types.go
    • Line 13: warning: exported type ProcessResultType should have comment or be unexported (golint)
    • Line 16: warning: exported const ProcessResultSuccessType should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type Description should have comment or be unexported (golint)
    • Line 67: warning: exported type ProcessResultSuccess should have comment or be unexported (golint)
    • Line 72: warning: exported type ProcessResultFailure should have comment or be unexported (golint)
    • Line 78: warning: exported method ProcessResultSuccess.StatusType should have comment or be unexported (golint)
    • Line 82: warning: exported method ProcessResultFailure.StatusType should have comment or be unexported (golint)
    • smith/cmd/smith/app/bundle_controller.go
    • Line 46: warning: exported type BundleControllerConstructor should have comment or be unexported (golint)
    • Line 57: warning: exported method BundleControllerConstructor.AddFlags should have comment or be unexported (golint)
    • Line 61: warning: exported method BundleControllerConstructor.New should have comment or be unexported (golint)
    • Line 240: warning: exported method BundleControllerConstructor.Describe should have comment or be unexported (golint)
    • Line 302: warning: exported function FullScheme should have comment or be unexported (golint)
    • smith/pkg/specchecker/checker.go
    • Line 16: warning: exported type Checker should have comment or be unexported (golint)
    • Line 21: warning: exported function New should have comment or be unexported (golint)
    • Line 54: warning: exported method Checker.CompareActualVsSpec should have comment or be unexported (golint)
    • smith/pkg/store/multi.go
    • Line 13: warning: exported const ByNamespaceAndControllerUIDIndex should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type Multi should have comment or be unexported (golint)
    • Line 20: warning: exported function NewMulti should have comment or be unexported (golint)
    • Line 48: warning: exported method Multi.ObjectsControlledBy should have comment or be unexported (golint)
    • Line 77: warning: exported function ByNamespaceAndControllerUIDIndexKey should have comment or be unexported (golint)
    • smith/it/utils_for_tests.go
    • Line 62: warning: exported type TestFunc should have comment or be unexported (golint)
    • Line 64: warning: exported type Config should have comment or be unexported (golint)
    • Line 76: warning: exported method Config.CreateObject should have comment or be unexported (golint)
    • Line 89: warning: exported method Config.AwaitBundleCondition should have comment or be unexported (golint)
    • Line 101: warning: exported function AndCond should have comment or be unexported (golint)
    • Line 113: warning: exported function IsBundleStatusCond should have comment or be unexported (golint)
    • Line 167: warning: exported function IsBundleObservedGenerationCond should have comment or be unexported (golint)
    • Line 178: warning: exported function IsPodSpecAnnotationCond should have comment or be unexported (golint)
    • Line 220: warning: exported function TestSetup should have comment or be unexported (golint)
    • Line 238: warning: exported function SetupApp should have comment or be unexported (golint)
    • Line 354: warning: exported method Config.AssertBundle should have comment or be unexported (golint)
    • Line 382: warning: exported method Config.AssertBundleTimeout should have comment or be unexported (golint)
    • smith/pkg/specchecker/hash.go
    • Line 13: warning: exported function HashSecretRef should have comment or be unexported (golint)
    • Line 33: warning: exported function HashConfigMapRef should have comment or be unexported (golint)
    • smith/pkg/plugin/plugin.go
    • Line 8: warning: exported type Container should have comment or be unexported (golint)
    • Line 13: warning: exported type ValidationResult should have comment or be unexported (golint)
    • Line 17: warning: exported function NewContainer should have comment or be unexported (golint)
    • Line 37: warning: exported method Container.ValidateSpec should have comment or be unexported (golint)
    • smith/pkg/store/catalog.go
    • Line 1: warning: package comment should be of the form "Package store ..." (golint)
    • Line 34: warning: exported type ValidationResult should have comment or be unexported (golint)
    • Line 53: warning: exported function NewCatalog should have comment or be unexported (golint)
    • Line 92: warning: exported method Catalog.GetClassOf should have comment or be unexported (golint)
    • Line 142: warning: exported method Catalog.GetPlanOf should have comment or be unexported (golint)
    • Line 257: warning: exported method Catalog.ValidateServiceInstanceSpec should have comment or be unexported (golint)
    • smith/pkg/store/multi_basic.go
    • Line 13: warning: exported type MultiBasic should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMultiBasic should have comment or be unexported (golint)
    • Line 35: warning: exported method MultiBasic.RemoveInformer should have comment or be unexported (golint)
    • Line 81: warning: exported function ByNamespaceAndNameIndexKey should have comment or be unexported (golint)
    • smith/api.go
    • Line 4: warning: exported const Smith should have comment (or a comment on this block) or be unexported (golint)
    • Line 7: warning: comment on exported const CrFieldPathAnnotation should be of the form "CrFieldPathAnnotation ..." (golint)
    • smith/pkg/util/util.go
    • Line 13: warning: exported function Sleep should have comment or be unexported (golint)
    • Line 60: warning: exported function IsSecret should have comment or be unexported (golint)
    • smith/pkg/store/bundle.go
    • Line 21: warning: exported type ByNameStore should have comment or be unexported (golint)
    • Line 25: warning: exported type BundleStore should have comment or be unexported (golint)
    • Line 31: warning: exported function NewBundle should have comment or be unexported (golint)
    • smith/examples/sleeper/pkg/apis/sleeper/v1/types.go
    • Line 8: warning: exported const CrdDomain should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type SleeperState should have comment or be unexported (golint)
    • Line 26: warning: exported const New should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported var SleeperGVK should have comment or be unexported (golint)
    • Line 34: warning: comment on exported type SleeperList should be of the form "SleeperList ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported type Sleeper should be of the form "Sleeper ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported type SleeperSpec should be of the form "SleeperSpec ..." (with optional leading article) (golint)
    • Line 67: warning: comment on exported type SleeperStatus should be of the form "SleeperStatus ..." (with optional leading article) (golint)
    • smith/pkg/controller/bundlec/types.go
    • Line 15: warning: exported type SpecChecker should have comment or be unexported (golint)
    • Line 21: warning: exported type Store should have comment or be unexported (golint)
    • Line 28: warning: exported type BundleStore should have comment or be unexported (golint)
    • Line 37: warning: exported type SmartClient should have comment or be unexported (golint)
    • smith/examples/sleeper/sleeper_event_handler.go
    • Line 14: warning: exported type EventHandler should have comment or be unexported (golint)
    • Line 20: warning: exported method EventHandler.OnAdd should have comment or be unexported (golint)
    • Line 24: warning: exported method EventHandler.OnUpdate should have comment or be unexported (golint)
    • Line 31: warning: exported method EventHandler.OnDelete should have comment or be unexported (golint)
    • smith/pkg/apis/smith/v1/types.go
    • Line 22: warning: exported const BundleReasonTerminalError should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported const ResourceReasonDependenciesNotReady should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported type PluginStatusStr should have comment or be unexported (golint)
    • Line 48: warning: exported const PluginStatusOk should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported const BundleResourceSingular should have comment (or a comment on this block) or be unexported (golint)
    • Line 65: warning: exported var BundleGVK should have comment or be unexported (golint)
    • Line 67: warning: comment on exported type BundleList should be of the form "BundleList ..." (with optional leading article) (golint)
    • Line 80: warning: comment on exported type Bundle should be of the form "Bundle ..." (with optional leading article) (golint)
    • Line 96: warning: comment on exported type BundleSpec should be of the form "BundleSpec ..." (with optional leading article) (golint)
    • Line 101: warning: exported type PluginStatus should have comment or be unexported (golint)
    • Line 109: warning: comment on exported type BundleStatus should be of the form "BundleStatus ..." (with optional leading article) (golint)
    • Line 138: warning: exported method BundleStatus.GetResourceStatus should have comment or be unexported (golint)
    • Line 157: warning: comment on exported type Resource should be of the form "Resource ..." (with optional leading article) (golint)
    • Line 169: warning: comment on exported type Reference should be of the form "Reference ..." (with optional leading article) (golint)
    • Line 190: warning: comment on exported type ResourceSpec should be of the form "ResourceSpec ..." (with optional leading article) (golint)
    • Line 197: warning: exported method ResourceSpec.UnmarshalJSON should have comment or be unexported (golint)
    • Line 216: warning: comment on exported type PluginSpec should be of the form "PluginSpec ..." (with optional leading article) (golint)
    • Line 230: warning: comment on exported type ResourceStatus should be of the form "ResourceStatus ..." (with optional leading article) (golint)
    • Line 236: warning: comment on exported type ResourceStatusData should be of the form "ResourceStatusData ..." (with optional leading article) (golint)
    • Line 241: warning: exported type ObjectToDelete should have comment or be unexported (golint)
    • smith/examples/sleeper/app.go
    • Line 15: warning: exported const ResyncPeriod should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type App should have comment or be unexported (golint)
    • Line 24: warning: exported method App.Run should have comment or be unexported (golint)
    • smith/pkg/client/smart/smart.go
    • Line 10: warning: exported type DynamicClient should have comment or be unexported (golint)
    • Line 15: warning: exported method DynamicClient.ForGVK should have comment or be unexported (golint)
    • smith/pkg/statuschecker/checker.go
    • Line 15: warning: exported type ObjectStatusType should have comment or be unexported (golint)
    • Line 18: warning: exported const ObjectStatusTypeReady should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported type ObjectStatusResult should have comment or be unexported (golint)
    • Line 28: warning: exported type ObjectStatusReady should have comment or be unexported (golint)
    • Line 32: warning: exported type ObjectStatusUnknown should have comment or be unexported (golint)
    • Line 36: warning: exported type ObjectStatusInProgress should have comment or be unexported (golint)
    • Line 40: warning: exported type ObjectStatusError should have comment or be unexported (golint)
    • Line 46: warning: exported method ObjectStatusReady.StatusType should have comment or be unexported (golint)
    • Line 49: warning: exported method ObjectStatusUnknown.StatusType should have comment or be unexported (golint)
    • Line 52: warning: exported method ObjectStatusInProgress.StatusType should have comment or be unexported (golint)
    • Line 55: warning: exported method ObjectStatusError.StatusType should have comment or be unexported (golint)
    • Line 69: warning: exported type Interface should have comment or be unexported (golint)
    • Line 73: warning: exported type Checker should have comment or be unexported (golint)
    • Line 78: warning: exported function New should have comment or be unexported (golint)
    • Line 94: warning: exported method Checker.CheckStatus should have comment or be unexported (golint)
    • smith/pkg/util/graph/types.go
    • Line 29: warning: exported function NewGraph should have comment or be unexported (golint)
    • Line 36: warning: exported method Graph.AddVertex should have comment or be unexported (golint)
    • Line 45: warning: exported method Graph.AddEdge should have comment or be unexported (golint)
    • Line 60: warning: exported method Graph.ContainsVertex should have comment or be unexported (golint)
    • smith/pkg/util/testing/utils_for_tests.go
    • Line 11: warning: exported function AssertCondition should have comment or be unexported (golint)
    • Line 19: warning: exported function AssertResourceCondition should have comment or be unexported (golint)
    • Line 32: warning: exported function AssertResourceConditionMessage should have comment or be unexported (golint)
    • smith/pkg/resources/crd_helpers.go
    • Line 24: warning: exported function PrintCleanedObject should have comment or be unexported (golint)
    • Line 50: warning: exported function EnsureCrdExistsAndIsEstablished should have comment or be unexported (golint)
    • Line 59: warning: exported function EnsureCrdExists should have comment or be unexported (golint)
    • Line 105: warning: exported function WaitForCrdToBecomeEstablished should have comment or be unexported (golint)
    • Line 147: warning: exported function IsEqualCrd should have comment or be unexported (golint)
    • smith/pkg/store/crd.go
    • Line 14: warning: exported type Crd should have comment or be unexported (golint)
    • Line 18: warning: exported function NewCrd should have comment or be unexported (golint)
    • smith/examples/sleeper/client.go
    • Line 14: warning: exported function Scheme should have comment or be unexported (golint)
    • Line 23: warning: exported function Client should have comment or be unexported (golint)
    • Line 37: warning: exported function Crd 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!