Preparing report...

Report for github.com/yunify/qingcloud-csi

A+    Excellent!    Found 22 issues across 38 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!


golint42%

Golint is a linter for Go source code.

    • qingcloud-csi/pkg/disk/driver/snapshotclass.go
    • Line 22: warning: exported const SnapshotClassTagsName should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type QingSnapshotClass should have comment or be unexported (golint)
    • Line 34: warning: exported function NewQingSnapshotClassFromMap should have comment or be unexported (golint)
    • Line 49: warning: exported method QingSnapshotClass.GetTags should have comment or be unexported (golint)
    • Line 53: warning: exported method QingSnapshotClass.SetTags should have comment or be unexported (golint)
    • qingcloud-csi/pkg/disk/driver/types.go
    • Line 24: warning: exported const DefaultInstanceIdFilePath should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported var DefaultVolumeAccessModeType should have comment or be unexported (golint)
    • Line 31: warning: exported var DefaultControllerServiceCapability should have comment or be unexported (golint)
    • Line 39: warning: exported var DefaultNodeServiceCapability should have comment or be unexported (golint)
    • Line 45: warning: exported var DefaultPluginCapability should have comment or be unexported (golint)
    • Line 70: warning: exported const HighPerformanceVolumeType should have comment (or a comment on this block) or be unexported (golint)
    • Line 80: warning: exported type VolumeType should have comment or be unexported (golint)
    • Line 82: warning: exported method VolumeType.Int should have comment or be unexported (golint)
    • Line 90: warning: exported method VolumeType.ValidateAttachedOn should have comment or be unexported (golint)
    • Line 99: warning: exported method VolumeType.IsValid should have comment or be unexported (golint)
    • Line 102: 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 107: warning: comment on exported var VolumeTypeName should be of the form "VolumeTypeName ..." (golint)
    • Line 119: warning: exported var VolumeTypeToStepSize should have comment or be unexported (golint)
    • Line 129: warning: exported var VolumeTypeToMinSize should have comment or be unexported (golint)
    • Line 139: warning: exported var VolumeTypeToMaxSize should have comment or be unexported (golint)
    • Line 149: warning: exported type InstanceType should have comment or be unexported (golint)
    • Line 151: warning: exported method InstanceType.Int should have comment or be unexported (golint)
    • Line 155: warning: exported method InstanceType.IsValid should have comment or be unexported (golint)
    • Line 158: 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 164: warning: exported const HighPerformanceInstanceType should have comment (or a comment on this block) or be unexported (golint)
    • Line 174: warning: exported var InstanceTypeName should have comment or be unexported (golint)
    • Line 185: warning: exported var InstanceTypeValue should have comment or be unexported (golint)
    • Line 196: warning: exported var InstanceTypeAttachPreferred should have comment or be unexported (golint)
    • Line 207: warning: exported var VolumeTypeAttachConstraint should have comment or be unexported (golint)
    • Line 257: warning: exported const DiskSingleReplicaType should have comment (or a comment on this block) or be unexported (golint)
    • qingcloud-csi/pkg/common/calculator.go
    • Line 25: warning: comment on exported function GibToByte should be of the form "GibToByte ..." (golint)
    • Line 31: warning: comment on exported function ByteCeilToGib should be of the form "ByteCeilToGib ..." (golint)
    • Line 44: warning: comment on exported function IsValidCapacityBytes should be of the form "IsValidCapacityBytes ..." (golint)
    • qingcloud-csi/pkg/cloud/mock/mock_cloud_manager.go
    • Line 30: warning: exported type MockCloudManager should have comment or be unexported (golint)
    • Line 38: warning: exported function NewMockCloudManagerFromConfig should have comment or be unexported (golint)
    • Line 44: warning: exported method MockCloudManager.SetConfig should have comment or be unexported (golint)
    • Line 48: warning: exported method MockCloudManager.SetSnapshots should have comment or be unexported (golint)
    • Line 52: warning: exported method MockCloudManager.SetVolumes should have comment or be unexported (golint)
    • Line 56: warning: exported method MockCloudManager.SetZones should have comment or be unexported (golint)
    • Line 60: warning: exported method MockCloudManager.SetInstances should have comment or be unexported (golint)
    • Line 64: warning: exported method MockCloudManager.FindSnapshot should have comment or be unexported (golint)
    • Line 73: warning: exported method MockCloudManager.FindSnapshotByName should have comment or be unexported (golint)
    • Line 81: warning: exported method MockCloudManager.CreateSnapshot should have comment or be unexported (golint)
    • Line 105: warning: exported method MockCloudManager.DeleteSnapshot should have comment or be unexported (golint)
    • Line 117: warning: exported method MockCloudManager.CreateVolumeFromSnapshot should have comment or be unexported (golint)
    • Line 130: warning: comment on exported method MockCloudManager.FindVolume should be of the form "FindVolume ..." (golint)
    • Line 146: warning: exported method MockCloudManager.FindVolumeByName should have comment or be unexported (golint)
    • Line 162: warning: exported method MockCloudManager.CreateVolume should have comment or be unexported (golint)
    • Line 186: warning: exported method MockCloudManager.DeleteVolume should have comment or be unexported (golint)
    • Line 200: warning: exported method MockCloudManager.AttachVolume should have comment or be unexported (golint)
    • Line 205: warning: exported method MockCloudManager.DetachVolume should have comment or be unexported (golint)
    • Line 209: warning: exported method MockCloudManager.ResizeVolume should have comment or be unexported (golint)
    • Line 213: warning: exported method MockCloudManager.CloneVolume should have comment or be unexported (golint)
    • Line 217: warning: comment on exported method MockCloudManager.FindInstance should be of the form "FindInstance ..." (golint)
    • Line 221: warning: exported method MockCloudManager.GetZone should have comment or be unexported (golint)
    • Line 224: warning: exported method MockCloudManager.GetZoneList should have comment or be unexported (golint)
    • Line 237: warning: comment on exported method MockCloudManager.FindTag should be of the form "FindTag ..." (golint)
    • qingcloud-csi/pkg/cloud/cloud_manager.go
    • Line 23: warning: exported type VolumeManager should have comment or be unexported (golint)
    • Line 70: warning: exported type SnapshotManager should have comment or be unexported (golint)
    • Line 101: warning: exported type UtilManager should have comment or be unexported (golint)
    • Line 120: warning: exported type CloudManager should have comment or be unexported (golint)
    • qingcloud-csi/pkg/cloud/qingcloud_manager.go
    • Line 39: warning: exported function NewQingCloudManagerFromConfig should have comment or be unexported (golint)
    • Line 65: warning: comment on exported function NewQingCloudManagerFromFile should be of the form "NewQingCloudManagerFromFile ..." (golint)
    • Line 189: warning: receiver name sm should be consistent with previous receiver name cm for qingCloudManager (golint)
    • Line 299: warning: receiver name qm should be consistent with previous receiver name cm for qingCloudManager (golint)
    • Line 502: warning: receiver name qm should be consistent with previous receiver name cm for qingCloudManager (golint)
    • Line 582: warning: receiver name zm should be consistent with previous receiver name cm for qingCloudManager (golint)
    • qingcloud-csi/pkg/disk/driver/driver.go
    • Line 25: warning: exported type DiskDriver should have comment or be unexported (golint)
    • Line 36: warning: exported type InitDiskDriverInput should have comment or be unexported (golint)
    • Line 47: warning: comment on exported function GetDiskDriver should be of the form "GetDiskDriver ..." (golint)
    • Line 53: warning: exported method DiskDriver.InitDiskDriver should have comment or be unexported (golint)
    • Line 101: warning: exported method DiskDriver.ValidateControllerServiceRequest should have comment or be unexported (golint)
    • Line 114: warning: exported method DiskDriver.ValidateNodeServiceRequest should have comment or be unexported (golint)
    • Line 127: warning: exported method DiskDriver.ValidateVolumeCapability should have comment or be unexported (golint)
    • Line 134: warning: exported method DiskDriver.ValidateVolumeCapabilities should have comment or be unexported (golint)
    • Line 143: warning: exported method DiskDriver.ValidateVolumeAccessMode should have comment or be unexported (golint)
    • Line 152: warning: exported method DiskDriver.ValidatePluginCapabilityService should have comment or be unexported (golint)
    • Line 161: warning: exported method DiskDriver.GetName should have comment or be unexported (golint)
    • Line 165: warning: exported method DiskDriver.GetVersion should have comment or be unexported (golint)
    • Line 169: warning: exported method DiskDriver.GetInstanceId should have comment or be unexported (golint)
    • Line 173: warning: exported method DiskDriver.GetMaxVolumePerNode should have comment or be unexported (golint)
    • Line 177: warning: exported method DiskDriver.GetControllerCapability should have comment or be unexported (golint)
    • Line 181: warning: exported method DiskDriver.GetNodeCapability should have comment or be unexported (golint)
    • Line 185: warning: exported method DiskDriver.GetPluginCapability should have comment or be unexported (golint)
    • Line 189: warning: exported method DiskDriver.GetVolumeCapability should have comment or be unexported (golint)
    • Line 193: warning: exported method DiskDriver.GetTopologyZoneKey should have comment or be unexported (golint)
    • Line 197: warning: exported method DiskDriver.GetTopologyInstanceTypeKey should have comment or be unexported (golint)
    • qingcloud-csi/pkg/common/common.go
    • Line 43: warning: comment on exported function GenerateHashInEightBytes should be of the form "GenerateHashInEightBytes ..." (golint)
    • Line 50: warning: comment on exported function RetryOnError should be of the form "RetryOnError ..." (golint)
    • Line 63: warning: exported type RetryLimiter should have comment or be unexported (golint)
    • Line 70: warning: exported function NewRetryLimiter should have comment or be unexported (golint)
    • qingcloud-csi/pkg/common/lock.go
    • Line 25: warning: exported const OperationPendingFmt should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported function NewResourceLocks should have comment or be unexported (golint)
    • Line 53: warning: exported method ResourceLocks.Release should have comment or be unexported (golint)
    • qingcloud-csi/pkg/disk/rpcserver/controllerserver.go
    • Line 38: warning: exported type ControllerServer should have comment or be unexported (golint)
    • Line 46: warning: comment on exported function NewControllerServer should be of the form "NewControllerServer ..." (golint)
    • Line 60: warning: comment on exported method ControllerServer.CreateVolume should be of the form "CreateVolume ..." (golint)
    • Line 153: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 198: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 241: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 356: warning: comment on exported method ControllerServer.DeleteVolume should be of the form "DeleteVolume ..." (golint)
    • Line 405: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 412: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 417: warning: comment on exported method ControllerServer.ControllerPublishVolume should be of the form "ControllerPublishVolume ..." (golint)
    • Line 482: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 512: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 526: 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 537: warning: comment on exported method ControllerServer.ControllerUnpublishVolume should be of the form "ControllerUnpublishVolume ..." (golint)
    • Line 606: warning: comment on exported method ControllerServer.ValidateVolumeCapabilities should be of the form "ValidateVolumeCapabilities ..." (golint)
    • Line 726: 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 733: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 741: warning: exported method ControllerServer.ListVolumes should have comment or be unexported (golint)
    • Line 745: warning: exported method ControllerServer.GetCapacity should have comment or be unexported (golint)
    • Line 882: warning: comment on exported method ControllerServer.DeleteSnapshot should be of the form "DeleteSnapshot ..." (golint)
    • Line 927: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 934: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 939: warning: exported method ControllerServer.ListSnapshots should have comment or be unexported (golint)
    • Line 943: warning: exported method ControllerServer.ControllerGetCapabilities should have comment or be unexported (golint)
    • Line 950: warning: comment on exported method ControllerServer.PickTopology should be of the form "PickTopology ..." (golint)
    • Line 994: warning: exported method ControllerServer.IsValidTopology should have comment or be unexported (golint)
    • Line 1007: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • qingcloud-csi/pkg/cloud/types.go
    • Line 24: warning: exported const WaitJobInterval should have comment (or a comment on this block) or be unexported (golint)
    • Line 60: warning: exported const SnapshotFull should have comment (or a comment on this block) or be unexported (golint)
    • Line 74: warning: exported var DiskReplicaTypeName should have comment or be unexported (golint)
    • Line 87: warning: exported const EnableDescribeSnapshotVerboseMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 92: warning: exported const EnableDescribeInstanceAppCluster should have comment (or a comment on this block) or be unexported (golint)
    • Line 97: warning: exported const EnableDescribeInstanceVerboseMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 102: warning: exported const ResourceTypeVolume should have comment (or a comment on this block) or be unexported (golint)
    • qingcloud-csi/pkg/disk/driver/storageclass.go
    • Line 30: warning: exported const StorageClassTypeName should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported type QingStorageClass should have comment or be unexported (golint)
    • Line 149: warning: exported method QingStorageClass.GetDiskType should have comment or be unexported (golint)
    • Line 153: warning: exported method QingStorageClass.GetMinSizeByte should have comment or be unexported (golint)
    • Line 157: warning: exported method QingStorageClass.GetMaxSizeByte should have comment or be unexported (golint)
    • Line 160: warning: exported method QingStorageClass.GetStepSizeByte should have comment or be unexported (golint)
    • Line 164: warning: exported method QingStorageClass.GetFsType should have comment or be unexported (golint)
    • Line 168: warning: exported method QingStorageClass.GetReplica should have comment or be unexported (golint)
    • Line 172: warning: exported method QingStorageClass.GetTags should have comment or be unexported (golint)
    • Line 208: warning: comment on exported method QingStorageClass.FormatVolumeSizeByte should be of the form "FormatVolumeSizeByte ..." (golint)
    • Line 224: warning: comment on exported method QingStorageClass.GetRequiredVolumeSizeByte should be of the form "GetRequiredVolumeSizeByte ..." (golint)
    • qingcloud-csi/pkg/disk/driver/topology.go
    • Line 19: warning: exported type Topology should have comment or be unexported (golint)
    • Line 24: warning: exported function NewTopology should have comment or be unexported (golint)
    • Line 28: warning: exported method Topology.GetZone should have comment or be unexported (golint)
    • Line 32: warning: exported method Topology.GetInstanceType should have comment or be unexported (golint)
    • Line 36: warning: exported method Topology.SetZone should have comment or be unexported (golint)
    • Line 40: warning: exported method Topology.SetInstanceType should have comment or be unexported (golint)
    • qingcloud-csi/pkg/common/rpcserver.go
    • Line 32: warning: comment on exported type NonBlockingGRPCServer should be of the form "NonBlockingGRPCServer ..." (with optional leading article) (golint)
    • Line 44: warning: exported function NewNonBlockingGRPCServer should have comment or be unexported (golint)
    • Line 127: warning: exported function ParseEndpoint should have comment or be unexported (golint)
    • qingcloud-csi/pkg/common/types.go
    • Line 19: warning: exported const Int64Max should have comment or be unexported (golint)
    • Line 21: warning: exported const DefaultTimeFormat should have comment or be unexported (golint)
    • Line 24: warning: exported const Kib should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported const FileSystemExt3 should have comment (or a comment on this block) or be unexported (golint)
    • qingcloud-csi/pkg/disk/rpcserver/identityserver.go
    • Line 30: warning: exported type IdentityServer should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function NewIdentityServer should be of the form "NewIdentityServer ..." (golint)
    • Line 46: warning: comment on exported method IdentityServer.Probe should be of the form "Probe ..." (golint)
    • Line 58: warning: comment on exported method IdentityServer.GetPluginCapabilities should be of the form "GetPluginCapabilities ..." (golint)
    • Line 59: warning: receiver name d should be consistent with previous receiver name is for IdentityServer (golint)
    • Line 67: warning: exported method IdentityServer.GetPluginInfo should have comment or be unexported (golint)
    • Line 67: warning: receiver name d should be consistent with previous receiver name is for IdentityServer (golint)
    • qingcloud-csi/pkg/cloud/errors.go
    • Line 14: warning: exported function IsLeaseInfoNotReady should have comment or be unexported (golint)
    • Line 18: warning: exported function IsSnapshotNotAvailable should have comment or be unexported (golint)
    • Line 22: warning: exported function IsTryLater should have comment or be unexported (golint)
    • Line 26: warning: exported type CannotFindDevicePathError should have comment or be unexported (golint)
    • Line 32: warning: exported function NewCannotFindDevicePathError should have comment or be unexported (golint)
    • Line 40: warning: exported function IsCannotFindDevicePath should have comment or be unexported (golint)
    • qingcloud-csi/pkg/disk/driver/utils.go
    • Line 27: warning: comment on exported function IsValidReplica should be of the form "IsValidReplica ..." (golint)
    • Line 40: warning: comment on exported function IsValidFileSystemType should be of the form "IsValidFileSystemType ..." (golint)
    • qingcloud-csi/pkg/disk/rpcserver/nodeserver.go
    • Line 37: warning: exported type NodeServer should have comment or be unexported (golint)
    • Line 46: warning: comment on exported function NewNodeServer should be of the form "NewNodeServer ..." (golint)
    • Line 57: warning: comment on exported method NodeServer.NodePublishVolume should be of the form "NodePublishVolume ..." (golint)
    • Line 156: warning: comment on exported method NodeServer.NodeUnpublishVolume should be of the form "NodeUnpublishVolume ..." (golint)
    • Line 200: warning: comment on exported method NodeServer.NodeStageVolume should be of the form "NodeStageVolume ..." (golint)
    • Line 279: warning: comment on exported method NodeServer.NodeUnstageVolume should be of the form "NodeUnstageVolume ..." (golint)
    • Line 350: warning: exported method NodeServer.NodeGetCapabilities should have comment or be unexported (golint)
    • Line 361: warning: exported method NodeServer.NodeGetInfo should have comment or be unexported (golint)
    • Line 470: warning: comment on exported method NodeServer.NodeGetVolumeStats should be of the form "NodeGetVolumeStats ..." (golint)

gocyclo92%

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.

    • qingcloud-csi/pkg/disk/rpcserver/controllerserver.go
    • Line 67: warning: cyclomatic complexity 45 of function (*ControllerServer).CreateVolume() is high (> 15) (gocyclo)
    • Line 757: warning: cyclomatic complexity 20 of function (*ControllerServer).CreateSnapshot() is high (> 15) (gocyclo)
    • Line 421: warning: cyclomatic complexity 18 of function (*ControllerServer).ControllerPublishVolume() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)