Preparing report...

Report for github.com/IBM/ubiquity-k8s

A    Great!    Found 25 issues across 39 files

Tweet

gofmt87%

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!


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!


golint41%

Golint is a linter for Go source code.

    • ubiquity-k8s/resources/resources.go
    • Line 5: warning: don't use underscores in Go names; const KubernetesVersion_1_5 should be KubernetesVersion1_5 (golint)
    • Line 5: warning: exported const KubernetesVersion_1_5 should have comment or be unexported (golint)
    • Line 6: warning: don't use underscores in Go names; const KubernetesVersion_1_6OrLater should be KubernetesVersion1_6OrLater (golint)
    • Line 6: warning: exported const KubernetesVersion_1_6OrLater should have comment or be unexported (golint)
    • Line 7: warning: exported const ProvisionerName should have comment or be unexported (golint)
    • Line 9: warning: comment on exported const UbiquityK8sFlexVolumeDriverName should be of the form "UbiquityK8sFlexVolumeDriverName ..." (golint)
    • Line 13: warning: exported const UbiquityK8sFlexVolumeDriverVendor should have comment or be unexported (golint)
    • Line 14: warning: exported const UbiquityK8sFlexVolumeDriverFullName should have comment or be unexported (golint)
    • Line 15: warning: exported const UbiquityFlexLogFileName should have comment or be unexported (golint)
    • Line 17: warning: exported const UbiquityProvisionerName should have comment or be unexported (golint)
    • Line 18: warning: exported const UbiquityProvisionerLogFileName should have comment or be unexported (golint)
    • Line 19: warning: exported const FlexDir should have comment or be unexported (golint)
    • Line 20: warning: exported const FlexLogFilePath should have comment or be unexported (golint)
    • Line 21: warning: exported const FlexConfPath should have comment or be unexported (golint)
    • Line 23: warning: exported type FlexVolumeResponse should have comment or be unexported (golint)
    • Line 31: warning: exported type FlexVolumeMountRequest should have comment or be unexported (golint)
    • Line 39: warning: exported type FlexVolumeUnmountRequest should have comment or be unexported (golint)
    • Line 44: warning: exported type FlexVolumeAttachRequest should have comment or be unexported (golint)
    • Line 51: warning: exported type FlexVolumeWaitForAttachRequest should have comment or be unexported (golint)
    • Line 57: warning: exported type FlexVolumeDetachRequest should have comment or be unexported (golint)
    • Line 64: warning: exported type FlexVolumeIsAttachedRequest should have comment or be unexported (golint)
    • Line 71: warning: exported type FlexVolumeMountDeviceRequest should have comment or be unexported (golint)
    • Line 78: warning: exported type FlexVolumeUnmountDeviceRequest should have comment or be unexported (golint)
    • Line 83: warning: exported type FlexVolumeGetVolumeNameRequest should have comment or be unexported (golint)
    • ubiquity-k8s/utils/utils.go
    • Line 12: warning: exported function LoadConfig should have comment or be unexported (golint)
    • Line 45: warning: exported function GetCurrentNamespace should have comment or be unexported (golint)
    • ubiquity-k8s/utils/errors/errors.go
    • Line 3: warning: exported type ErrorReason should have comment or be unexported (golint)
    • Line 6: warning: exported const ErrorReasonUbiquityServiceIPEmpty should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported function NewError should have comment or be unexported (golint)
    • Line 23: warning: exported type ReasonInterface should have comment or be unexported (golint)
    • Line 47: warning: exported function IsUbiquityServiceIPEmpty should have comment or be unexported (golint)
    • Line 51: warning: exported function IsENVNamespaceNotSet should have comment or be unexported (golint)
    • Line 55: warning: exported function IsENVStorageClassNotSet should have comment or be unexported (golint)
    • Line 59: warning: exported function IsENVUbiquityDbPvNameNotSet should have comment or be unexported (golint)
    • Line 63: warning: exported function IsENVUbiquityDbSCNotSet should have comment or be unexported (golint)
    • Line 67: warning: exported var UbiquityServiceIPEmpty should have comment or be unexported (golint)
    • Line 68: warning: exported var ENVNamespaceNotSet should have comment or be unexported (golint)
    • Line 69: warning: exported var ENVStorageClassNotSet should have comment or be unexported (golint)
    • Line 70: warning: exported var ENVUbiquityDbPvNameNotSet should have comment or be unexported (golint)
    • Line 71: warning: exported var ENVUbiquityDbSCNotSet should have comment or be unexported (golint)
    • ubiquity-k8s/utils/logger_utils.go
    • Line 11: warning: exported function InitFlexLogger should have comment or be unexported (golint)
    • Line 12: warning: don't use underscores in Go names; var logger_params should be loggerParams (golint)
    • Line 17: warning: exported function InitProvisionerLogger should have comment or be unexported (golint)
    • Line 22: warning: exported function InitGenericLogger should have comment or be unexported (golint)
    • ubiquity-k8s/sidecars/flex/sidecar.go
    • Line 32: warning: exported type ServiceSyncer should have comment or be unexported (golint)
    • Line 39: warning: context.Context should be the first parameter of a function (golint)
    • Line 39: warning: exported function NewServiceSyncer should have comment or be unexported (golint)
    • ubiquity-k8s/helm_chart/hookexecutor/decoder.go
    • Line 13: warning: exported type Decode should have comment or be unexported (golint)
    • Line 35: warning: exported var KubeDecoder should have comment or be unexported (golint)
    • Line 37: warning: exported function FromJson should have comment or be unexported (golint)
    • Line 41: warning: exported function FromYaml should have comment or be unexported (golint)
    • ubiquity-k8s/helm_chart/hookexecutor/pre_delete.go
    • Line 70: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 100: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 160: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ubiquity-k8s/controller/errors.go
    • Line 24: warning: comment on exported type NoMounterForVolumeError should be of the form "NoMounterForVolumeError ..." (with optional leading article) (golint)
    • Line 33: warning: exported const MissingWwnMountRequestErrorStr should have comment or be unexported (golint)
    • Line 35: warning: exported const FailRemovePVorigDirErrorStr should have comment or be unexported (golint)
    • Line 37: warning: exported type FailRemovePVorigDirError should have comment or be unexported (golint)
    • Line 46: warning: exported const WrongSlinkErrorStr should have comment or be unexported (golint)
    • Line 58: warning: exported const SupportK8sVesion should have comment or be unexported (golint)
    • Line 68: warning: exported const K8sPVDirectoryIsNotDirNorSlinkErrorStr should have comment or be unexported (golint)
    • Line 81: warning: exported const IdempotentUnmountSkipOnVolumeNotExistWarnigMsg should have comment or be unexported (golint)
    • Line 82: warning: exported const IdempotentIsAttachedSkipOnVolumeNotExistWarnigMsg should have comment or be unexported (golint)
    • Line 83: warning: exported const IdempotentDetachSkipOnVolumeNotExistWarnigMsg should have comment or be unexported (golint)
    • Line 85: warning: exported const K8sPVDirectoryIsNotSlinkErrorStr should have comment or be unexported (golint)
    • Line 98: warning: exported const PvBackendNotSupportedErrorStr should have comment or be unexported (golint)
    • Line 100: warning: exported type PvBackendNotSupportedError should have comment or be unexported (golint)
    • Line 108: warning: exported const BackendNotImplementedGetRealMountpointErrorStr should have comment or be unexported (golint)
    • Line 110: warning: exported type BackendNotImplementedGetRealMountpointError should have comment or be unexported (golint)
    • Line 118: warning: exported const PVIsAlreadyUsedByAnotherPodMessage should have comment or be unexported (golint)
    • Line 120: warning: exported type PVIsAlreadyUsedByAnotherPod should have comment or be unexported (golint)
    • Line 129: warning: exported var WrongK8sDirectoryPathErrorMessage should have comment or be unexported (golint)
    • Line 131: warning: exported type WrongK8sDirectoryPathError should have comment or be unexported (golint)
    • Line 139: warning: exported const SpectrumScaleMissingMntPtVolumeErrorStr should have comment or be unexported (golint)
    • Line 141: warning: exported type SpectrumScaleMissingMntPtVolumeError should have comment or be unexported (golint)
    • ubiquity-k8s/volume/provision.go
    • Line 63: warning: exported function NewFlexProvisioner should have comment or be unexported (golint)
    • Line 70: warning: don't use underscores in Go names; var request_context should be requestContext (golint)
    • Line 144: warning: don't use underscores in Go names; var request_context should be requestContext (golint)
    • Line 145: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 167: warning: don't use underscores in Go names; var volume_details should be volumeDetails (golint)
    • Line 207: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 223: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ubiquity-k8s/cmd/hook-executor/main.go
    • Line 13: warning: comment on exported type PostInstallCommand should be of the form "PostInstallCommand ..." (with optional leading article) (golint)
    • Line 18: warning: exported method PostInstallCommand.Execute should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type PreDeleteCommand should be of the form "PreDeleteCommand ..." (with optional leading article) (golint)
    • Line 28: warning: exported method PreDeleteCommand.Execute should have comment or be unexported (golint)
    • Line 33: warning: comment on exported type SanityCommand should be of the form "SanityCommand ..." (with optional leading article) (golint)
    • Line 38: warning: exported method SanityCommand.Execute should have comment or be unexported (golint)
    • Line 43: warning: exported type Options should have comment or be unexported (golint)
    • ubiquity-k8s/cmd/flex/main/cli.go
    • Line 59: warning: exported method InitCommand.Execute should have comment or be unexported (golint)
    • Line 74: warning: exported method GetVolumeNameCommand.Execute should have comment or be unexported (golint)
    • Line 85: warning: exported type AttachCommand should have comment or be unexported (golint)
    • Line 89: warning: exported method AttachCommand.Execute should have comment or be unexported (golint)
    • Line 148: warning: comment on exported type WaitForAttachCommand should be of the form "WaitForAttachCommand ..." (with optional leading article) (golint)
    • Line 154: warning: exported method WaitForAttachCommand.Execute should have comment or be unexported (golint)
    • Line 194: warning: exported method IsAttachedCommand.Execute should have comment or be unexported (golint)
    • Line 231: warning: exported type DetachCommand should have comment or be unexported (golint)
    • Line 235: warning: exported method DetachCommand.Execute should have comment or be unexported (golint)
    • Line 275: warning: comment on exported type MountDeviceCommand should be of the form "MountDeviceCommand ..." (with optional leading article) (golint)
    • Line 281: warning: exported method MountDeviceCommand.Execute should have comment or be unexported (golint)
    • Line 315: warning: comment on exported type UnmountDeviceCommand should be of the form "UnmountDeviceCommand ..." (with optional leading article) (golint)
    • Line 321: warning: exported method UnmountDeviceCommand.Execute should have comment or be unexported (golint)
    • Line 354: warning: exported method MountCommand.Execute should have comment or be unexported (golint)
    • Line 440: warning: exported method UnmountCommand.Execute should have comment or be unexported (golint)
    • Line 476: warning: exported type TestUbiquityCommand should have comment or be unexported (golint)
    • Line 480: warning: exported method TestUbiquityCommand.Execute should have comment or be unexported (golint)
    • Line 503: warning: exported type Options should have comment or be unexported (golint)
    • ubiquity-k8s/helm_chart/hookexecutor/utils.go
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 104: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 134: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 140: warning: comment on exported function Watch should be of the form "Watch ..." (golint)
    • Line 195: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ubiquity-k8s/helm_chart/hookexecutor/interface.go
    • Line 7: warning: exported type Executor should have comment or be unexported (golint)
    • Line 15: warning: exported function PostInstallExecutor should have comment or be unexported (golint)
    • Line 19: warning: exported function PreDeleteExecutor should have comment or be unexported (golint)
    • Line 23: warning: exported function SanityExecutor should have comment or be unexported (golint)
    • ubiquity-k8s/helm_chart/hookexecutor/pre_delete_test.go
    • Line 21: warning: don't use underscores in Go names; var test_pvYaml should be testPvYaml (golint)
    • Line 42: warning: don't use underscores in Go names; var test_pvcYaml should be testPvcYaml (golint)
    • Line 65: warning: don't use underscores in Go names; var test_deployYaml should be testDeployYaml (golint)
    • Line 96: warning: don't use underscores in Go names; var test_podYaml should be testPodYaml (golint)
    • Line 126: warning: don't use underscores in Go names; var test_one should be testOne (golint)
    • Line 127: warning: don't use underscores in Go names; var test_zero should be testZero (golint)
    • ubiquity-k8s/controller/controller.go
    • Line 38: warning: exported const K8sPodsDirecotryName should have comment (or a comment on this block) or be unexported (golint)
    • Line 125: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 176: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 193: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 247: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 298: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 315: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 333: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 424: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 442: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 504: warning: don't use underscores in Go names; var go_id should be goID (golint)
    • Line 578: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 595: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 722: warning: don't use underscores in Go names; var file_pattern should be filePattern (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words