Preparing report...

Report for github.com/kubernetes-incubator/service-catalog

A+    Excellent!    Found 50 issues across 443 files

Tweet

gofmt99%

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!


gocyclo95%

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.

    • service-catalog/pkg/controller/controller.go
    • Line 1144: warning: cyclomatic complexity 20 of function convertClusterServicePlans() is high (> 15) (gocyclo)
    • Line 874: warning: cyclomatic complexity 16 of function GenerateEscapedName() is high (> 15) (gocyclo)
    • Line 1090: warning: cyclomatic complexity 16 of function convertCommonServicePlan() is high (> 15) (gocyclo)
    • service-catalog/pkg/migration/migration.go
    • Line 185: warning: cyclomatic complexity 29 of function (*Service).Restore() is high (> 15) (gocyclo)
    • Line 362: warning: cyclomatic complexity 26 of function (*Service).LoadResources() is high (> 15) (gocyclo)
    • Line 545: warning: cyclomatic complexity 25 of function (*Service).BackupResources() is high (> 15) (gocyclo)
    • Line 477: warning: cyclomatic complexity 17 of function (*Service).Cleanup() is high (> 15) (gocyclo)
    • service-catalog/pkg/controller/controller_instance.go
    • Line 1015: warning: cyclomatic complexity 35 of function (*controller).pollServiceInstance() is high (> 15) (gocyclo)
    • Line 673: warning: cyclomatic complexity 33 of function (*controller).reconcileServiceInstanceUpdate() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 29 of function (*controller).reconcileServiceInstanceAdd() is high (> 15) (gocyclo)
    • Line 855: warning: cyclomatic complexity 27 of function (*controller).reconcileServiceInstanceDelete() is high (> 15) (gocyclo)
    • Line 2049: warning: cyclomatic complexity 17 of function isServiceInstancePropertiesStateEqual() is high (> 15) (gocyclo)
    • Line 2381: warning: cyclomatic complexity 17 of function (*controller).prepareUpdateInstanceRequest() is high (> 15) (gocyclo)
    • Line 2471: warning: cyclomatic complexity 16 of function (*controller).prepareDeprovisionRequest() is high (> 15) (gocyclo)
    • service-catalog/pkg/controller/controller_binding.go
    • Line 918: warning: cyclomatic complexity 31 of function (*controller).pollServiceBinding() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 30 of function (*controller).reconcileServiceBindingAdd() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 28 of function (*controller).reconcileServiceBindingDelete() is high (> 15) (gocyclo)
    • service-catalog/pkg/apis/servicecatalog/validation/instance.go
    • Line 112: warning: cyclomatic complexity 24 of function validateServiceInstanceStatus() is high (> 15) (gocyclo)
    • Line 552: warning: cyclomatic complexity 22 of function validateScopedPlanRef() is high (> 15) (gocyclo)
    • Line 182: warning: cyclomatic complexity 17 of function validateServiceInstancePropertiesState() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 16 of function validateServiceInstanceUpdate() is high (> 15) (gocyclo)

golint96%

Golint is a linter for Go source code.

    • service-catalog/test/e2e/framework/test_context.go
    • Line 29: warning: exported const RecommendedConfigPathEnvVar should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type TestContextType should have comment or be unexported (golint)
    • Line 42: warning: exported var TestContext should have comment or be unexported (golint)
    • Line 44: warning: comment on exported function RegisterCommonFlags should be of the form "RegisterCommonFlags ..." (golint)
    • Line 65: warning: exported function RegisterParseFlags should have comment or be unexported (golint)
    • service-catalog/test/e2e/framework/util.go
    • Line 24: warning: should not use dot imports (golint)
    • Line 25: warning: should not use dot imports (golint)
    • Line 38: warning: comment on exported const Poll should be of the form "Poll ..." (golint)
    • Line 44: warning: comment on exported const EndpointRegisterTimeout should be of the form "EndpointRegisterTimeout ..." (golint)
    • Line 56: warning: exported function Logf should have comment or be unexported (golint)
    • Line 60: warning: exported function Failf should have comment or be unexported (golint)
    • Line 66: warning: exported function Skipf should have comment or be unexported (golint)
    • Line 72: warning: exported type ClientConfigGetter should have comment or be unexported (golint)
    • Line 74: warning: comment on exported var RunId should be of the form "RunId ..." (golint)
    • Line 77: warning: exported function CreateKubeNamespace should have comment or be unexported (golint)
    • Line 101: warning: exported function DeleteKubeNamespace should have comment or be unexported (golint)
    • Line 105: warning: exported function ExpectNoError should have comment or be unexported (golint)
    • Line 112: warning: comment on exported function WaitForPodRunningInNamespace should be of the form "WaitForPodRunningInNamespace ..." (golint)
    • Line 125: warning: exported function WaitForEndpoint should have comment or be unexported (golint)
    • service-catalog/test/fake/clientset.go
    • Line 35: warning: exported method Clientset.Discovery should have comment or be unexported (golint)
    • Line 41: warning: exported method Clientset.ServicecatalogV1beta1 should have comment or be unexported (golint)
    • Line 45: warning: exported method Clientset.Servicecatalog should have comment or be unexported (golint)
    • service-catalog/test/fake/servicecatalog.go
    • Line 36: warning: exported method ServicecatalogV1beta1.ClusterServiceBrokers should have comment or be unexported (golint)
    • Line 40: warning: exported method ServicecatalogV1beta1.ClusterServiceClasses should have comment or be unexported (golint)
    • Line 44: warning: exported method ServicecatalogV1beta1.ServiceInstances should have comment or be unexported (golint)
    • Line 49: warning: exported method ServicecatalogV1beta1.ServiceBindings should have comment or be unexported (golint)
    • Line 54: warning: exported method ServicecatalogV1beta1.ClusterServicePlans should have comment or be unexported (golint)
    • Line 58: warning: exported method ServicecatalogV1beta1.RESTClient should have comment or be unexported (golint)
    • service-catalog/test/fake/serviceinstances.go
    • Line 37: warning: exported method ServiceInstances.Create should have comment or be unexported (golint)
    • Line 41: warning: exported method ServiceInstances.Update should have comment or be unexported (golint)
    • Line 50: warning: exported method ServiceInstances.UpdateStatus should have comment or be unexported (golint)
    • Line 59: warning: exported method ServiceInstances.Delete should have comment or be unexported (golint)
    • Line 63: warning: exported method ServiceInstances.DeleteCollection should have comment or be unexported (golint)
    • Line 67: warning: exported method ServiceInstances.Get should have comment or be unexported (golint)
    • Line 71: warning: exported method ServiceInstances.List should have comment or be unexported (golint)
    • service-catalog/test/e2e/util.go
    • Line 26: warning: exported function NewUPSBrokerPod should have comment or be unexported (golint)
    • Line 55: warning: exported function NewUPSBrokerService should have comment or be unexported (golint)
    • service-catalog/pkg/kubernetes/pkg/util/configz/configz.go
    • Line 32: warning: exported type Config should have comment or be unexported (golint)
    • Line 36: warning: exported function InstallHandler should have comment or be unexported (golint)
    • Line 44: warning: exported function New should have comment or be unexported (golint)
    • Line 55: warning: exported function Delete should have comment or be unexported (golint)
    • Line 61: warning: exported method Config.Set should have comment or be unexported (golint)
    • Line 67: warning: exported method Config.MarshalJSON should have comment or be unexported (golint)
    • service-catalog/test/e2e/framework/framework.go
    • Line 23: warning: should not use dot imports (golint)
    • Line 24: warning: should not use dot imports (golint)
    • Line 47: warning: comment on exported function NewDefaultFramework should be of the form "NewDefaultFramework ..." (golint)
    • Line 92: warning: comment on exported function ServiceCatalogDescribe should be of the form "ServiceCatalogDescribe ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.

    • service-catalog/test/e2e/walkthrough.go
    • Line 248: warning: ineffectual assignment to instance (ineffassign)
    • Line 285: warning: ineffectual assignment to instance (ineffassign)
    • Line 321: warning: ineffectual assignment to instance (ineffassign)
    • Line 520: warning: ineffectual assignment to instance (ineffassign)
    • Line 557: warning: ineffectual assignment to instance (ineffassign)
    • Line 593: warning: ineffectual assignment to instance (ineffassign)

misspell97%

Misspell Finds commonly misspelled English words