Preparing report...

Report for github.com/fluid-cloudnative/fluid

A+    Excellent!    Found 102 issues across 212 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!


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.

    • fluid/pkg/ddc/jindo/transform.go
    • Line 124: warning: cyclomatic complexity 19 of function (*JindoEngine).transformMaster() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 17 of function (*JindoEngine).transform() is high (> 15) (gocyclo)

golint56%

Golint is a linter for Go source code.

    • fluid/pkg/utils/dataset/volume/delete.go
    • Line 30: warning: comment on exported function DeleteFusePersistentVolume should be of the form "DeleteFusePersistentVolume ..." (golint)
    • Line 73: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 81: warning: comment on exported function DeleteFusePersistentVolumeClaim should be of the form "DeleteFusePersistentVolumeClaim ..." (golint)
    • Line 121: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fluid/pkg/ddc/alluxio/types.go
    • Line 26: warning: comment on exported type Alluxio should be of the form "Alluxio ..." (with optional leading article) (golint)
    • Line 72: warning: exported type HadoopConfig should have comment or be unexported (golint)
    • Line 78: warning: exported type UFSPath should have comment or be unexported (golint)
    • Line 83: warning: exported type UFSVolume should have comment or be unexported (golint)
    • Line 88: warning: exported type Metastore should have comment or be unexported (golint)
    • Line 93: warning: exported type Journal should have comment or be unexported (golint)
    • Line 98: warning: exported type ShortCircuit should have comment or be unexported (golint)
    • Line 104: warning: exported type Ports should have comment or be unexported (golint)
    • Line 112: warning: exported type APIGateway should have comment or be unexported (golint)
    • Line 117: warning: exported type JobMaster should have comment or be unexported (golint)
    • Line 121: warning: exported type JobWorker should have comment or be unexported (golint)
    • Line 125: warning: exported type Worker should have comment or be unexported (golint)
    • Line 135: warning: exported type Master should have comment or be unexported (golint)
    • Line 149: warning: exported type Restore should have comment or be unexported (golint)
    • Line 155: warning: exported type Fuse should have comment or be unexported (golint)
    • Line 172: warning: exported type Tieredstore should have comment or be unexported (golint)
    • Line 176: warning: exported type Level should have comment or be unexported (golint)
    • Line 187: warning: exported type Affinity should have comment or be unexported (golint)
    • fluid/pkg/common/fluid_ufs_scheme.go
    • Line 1: warning: package comment should be of the form "Package common ..." (golint)
    • Line 19: warning: exported type FluidUFSScheme should have comment or be unexported (golint)
    • Line 22: warning: comment on exported const PathScheme should be of the form "PathScheme ..." (golint)
    • Line 24: warning: exported const VolumeScheme should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: comment on exported const HttpScheme should be of the form "HttpScheme ..." (golint)
    • Line 34: warning: exported function IsFluidNativeScheme should have comment or be unexported (golint)
    • Line 44: warning: exported function IsFluidWebScheme should have comment or be unexported (golint)
    • fluid/pkg/csi/fuse/nodeserver.go
    • Line 49: 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 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 127: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fluid/pkg/ddc/jindo/ufs.go
    • Line 30: warning: comment on exported method JindoEngine.TotalStorageBytes should be of the form "TotalStorageBytes ..." (golint)
    • Line 35: warning: comment on exported method JindoEngine.TotalFileNums should be of the form "TotalFileNums ..." (golint)
    • fluid/pkg/utils/runtimes.go
    • Line 26: warning: comment on exported function NewRuntime should be of the form "NewRuntime ..." (golint)
    • Line 38: warning: comment on exported function AddRuntimesIfNotExist should be of the form "AddRuntimesIfNotExist ..." (golint)
    • fluid/api/v1alpha1/constant.go
    • Line 19: warning: comment on exported const DatasetReadyReason should be of the form "DatasetReadyReason ..." (golint)
    • Line 22: warning: comment on exported const DatasetDataSetFailedReason should be of the form "DatasetDataSetFailedReason ..." (golint)
    • Line 26: warning: exported type PlacementMode should have comment or be unexported (golint)
    • Line 29: warning: exported const ExclusiveMode should have comment (or a comment on this block) or be unexported (golint)
    • fluid/pkg/common/types.go
    • Line 22: warning: exported type RuntimeRole should have comment or be unexported (golint)
    • Line 27: warning: comment on exported type CacheStateList should be of the form "CacheStateList ..." (with optional leading article) (golint)
    • Line 71: warning: exported type ResourceList should have comment or be unexported (golint)
    • Line 73: warning: exported type Resources should have comment or be unexported (golint)
    • Line 79: warning: exported const FLUID_FUSE_BALLOON_KEY should have comment (or a comment on this block) or be unexported (golint)
    • Line 90: warning: comment on exported type InitUsers should be of the form "InitUsers ..." (with optional leading article) (golint)
    • fluid/pkg/ddc/jindo/const.go
    • Line 4: warning: exported const CSI_DRIVER should have comment (or a comment on this block) or be unexported (golint)
    • Line 8: warning: don't use underscores in Go names; const Mount_TYPE should be MountTYPE (golint)
    • fluid/pkg/utils/init_user.go
    • Line 24: warning: exported function GetInitUsersArgs should have comment or be unexported (golint)
    • Line 33: warning: exported function GetInitUserEnv should have comment or be unexported (golint)
    • fluid/pkg/utils/quantity.go
    • Line 24: warning: exported function TranformQuantityToAlluxioUnit should have comment or be unexported (golint)
    • Line 35: warning: exported function TranformQuantityToJindoUnit should have comment or be unexported (golint)
    • Line 43: warning: exported function TranformQuantityToUnits should have comment or be unexported (golint)
    • fluid/pkg/ddc/alluxio/utils.go
    • Line 245: warning: exported method AlluxioEngine.GetMetadataInfoFile should have comment or be unexported (golint)
    • Line 249: warning: exported method AlluxioEngine.GetMetadataFileName should have comment or be unexported (golint)
    • Line 253: warning: exported method AlluxioEngine.GetMetadataInfoFileName should have comment or be unexported (golint)
    • fluid/pkg/ddc/base/label.go
    • Line 38: warning: exported method RuntimeInfo.GetLabelnameForMemory should have comment or be unexported (golint)
    • Line 48: warning: exported method RuntimeInfo.GetLabelnameForDisk should have comment or be unexported (golint)
    • Line 58: warning: exported method RuntimeInfo.GetLabelnameForTotal should have comment or be unexported (golint)
    • Line 68: warning: exported method RuntimeInfo.GetCommonLabelname should have comment or be unexported (golint)
    • Line 77: warning: exported method RuntimeInfo.GetRuntimeLabelname should have comment or be unexported (golint)
    • Line 86: warning: exported method RuntimeInfo.GetDatasetNumLabelname should have comment or be unexported (golint)
    • fluid/pkg/common/volume.go
    • Line 4: warning: exported const FLUID_PATH should have comment (or a comment on this block) or be unexported (golint)
    • Line 6: warning: don't use underscores in Go names; const Mount_TYPE should be MountTYPE (golint)
    • Line 12: warning: exported var FLUID_STORAGECLASS should have comment or be unexported (golint)
    • fluid/pkg/webhook/plugins/prefernodeswithcache/prefer_nodes_with_cache.go
    • Line 30: warning: exported const NAME should have comment or be unexported (golint)
    • Line 32: warning: exported type PreferNodesWithCache should have comment or be unexported (golint)
    • Line 37: warning: exported function NewPlugin should have comment or be unexported (golint)
    • Line 44: warning: exported method PreferNodesWithCache.GetName should have comment or be unexported (golint)
    • Line 48: warning: exported method PreferNodesWithCache.InjectAffinity should have comment or be unexported (golint)
    • fluid/pkg/ddc/factory.go
    • Line 36: warning: comment on exported function CreateEngine should be of the form "CreateEngine ..." (golint)
    • Line 50: warning: comment on exported function GenerateEngineID should be of the form "GenerateEngineID ..." (golint)
    • fluid/pkg/ddc/base/volume.go
    • Line 18: warning: comment on exported method TemplateEngine.CreateVolume should be of the form "CreateVolume ..." (golint)
    • Line 24: warning: comment on exported method TemplateEngine.DeleteVolume should be of the form "DeleteVolume ..." (golint)
    • fluid/pkg/webhook/plugins/prefernodeswithoutcache/prefer_nodes_without_cache.go
    • Line 31: warning: exported const NAME should have comment or be unexported (golint)
    • Line 33: warning: exported type PreferNodesWithoutCache should have comment or be unexported (golint)
    • Line 38: warning: exported function NewPlugin should have comment or be unexported (golint)
    • Line 61: warning: exported method PreferNodesWithoutCache.GetName should have comment or be unexported (golint)
    • Line 65: warning: exported method PreferNodesWithoutCache.InjectAffinity should have comment or be unexported (golint)
    • fluid/pkg/ddc/base/runtime.go
    • Line 29: warning: comment on exported type RuntimeInfoInterface should be of the form "RuntimeInfoInterface ..." (with optional leading article) (golint)
    • Line 76: warning: comment on exported type RuntimeInfo should be of the form "RuntimeInfo ..." (with optional leading article) (golint)
    • Line 99: warning: exported type Fuse should have comment or be unexported (golint)
    • Line 106: warning: exported type TieredstoreInfo should have comment or be unexported (golint)
    • Line 110: warning: exported type Level should have comment or be unexported (golint)
    • Line 120: warning: exported type CachePath should have comment or be unexported (golint)
    • Line 126: warning: exported function BuildRuntimeInfo should have comment or be unexported (golint)
    • Line 145: warning: exported method RuntimeInfo.GetTieredstoreInfo should have comment or be unexported (golint)
    • Line 202: warning: exported method RuntimeInfo.SetDeprecatedPVName should have comment or be unexported (golint)
    • Line 206: warning: exported method RuntimeInfo.IsDeprecatedPVName should have comment or be unexported (golint)
    • fluid/pkg/utils/crtl_utils.go
    • Line 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 70: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 91: warning: exported function ContainsOwners should have comment or be unexported (golint)
    • fluid/pkg/ddc/jindo/operations/base.go
    • Line 13: warning: exported type JindoFileUtils should have comment or be unexported (golint)
    • Line 20: warning: exported function NewJindoFileUtils should have comment or be unexported (golint)
    • Line 66: warning: comment on exported method JindoFileUtils.ReportSummary should be of the form "ReportSummary ..." (golint)
    • Line 82: warning: exported method JindoFileUtils.GetUfsTotalSize should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method JindoFileUtils.Ready should be of the form "Ready ..." (golint)
    • fluid/pkg/ddc/alluxio/operations/base.go
    • Line 31: warning: exported type AlluxioFileUtils should have comment or be unexported (golint)
    • Line 38: warning: exported function NewAlluxioFileUtils should have comment or be unexported (golint)
    • Line 71: warning: comment on exported method AlluxioFileUtils.ReportSummary should be of the form "ReportSummary ..." (golint)
    • Line 87: warning: comment on exported method AlluxioFileUtils.LoadMetadataWithoutTimeout should be of the form "LoadMetadataWithoutTimeout ..." (golint)
    • Line 102: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 145: warning: exported type KeyOfMetaDataFile should have comment or be unexported (golint)
    • Line 148: warning: exported var DatasetName should have comment or be unexported (golint)
    • Line 184: warning: exported method AlluxioFileUtils.Mkdir should have comment or be unexported (golint)
    • Line 200: warning: exported method AlluxioFileUtils.Mount should have comment or be unexported (golint)
    • Line 247: warning: exported method AlluxioFileUtils.IsMounted should have comment or be unexported (golint)
    • Line 278: warning: comment on exported method AlluxioFileUtils.Ready should be of the form "Ready ..." (golint)
    • Line 292: warning: exported method AlluxioFileUtils.Du should have comment or be unexported (golint)
    • Line 333: warning: comment on exported method AlluxioFileUtils.Count should be of the form "Count ..." (golint)
    • Line 380: warning: comment on exported method AlluxioFileUtils.GetFileCount should be of the form "GetFileCount ..." (golint)
    • Line 473: warning: exported method AlluxioFileUtils.MasterPodName should have comment or be unexported (golint)
    • fluid/api/v1alpha1/status.go
    • Line 125: warning: exported type RuntimePhase should have comment or be unexported (golint)
    • Line 128: warning: exported const RuntimePhaseNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 172: warning: comment on exported const RuntimeWorkersScaledOutReason should be of the form "RuntimeWorkersScaledOutReason ..." (golint)
    • Line 180: warning: comment on exported const RuntimeFusesScaledOutReason should be of the form "RuntimeFusesScaledOutReason ..." (golint)
    • Line 184: warning: comment on exported type RuntimeCondition should be of the form "RuntimeCondition ..." (with optional leading article) (golint)
    • fluid/pkg/common/alluxio.go
    • Line 27: warning: comment on exported var AlluxioMountPathFormat should be of the form "AlluxioMountPathFormat ..." (golint)
    • Line 30: warning: exported var AlluxioLocalStorageRootPath should have comment or be unexported (golint)
    • fluid/version.go
    • Line 9: warning: exported type Version should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function PrintVersion should be of the form "PrintVersion ..." (golint)
    • Line 77: warning: comment on exported function LogVersion should be of the form "LogVersion ..." (golint)
    • fluid/pkg/utils/dataset.go
    • Line 42: warning: comment on exported function IsSetupDone should be of the form "IsSetupDone ..." (golint)
    • Line 53: warning: exported function GetAccessModesOfDataset should have comment or be unexported (golint)
    • fluid/pkg/common/storage.go
    • Line 3: warning: exported type ReadType should have comment or be unexported (golint)
    • Line 6: warning: exported const HumanReadType should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: exported type StorageType should have comment or be unexported (golint)
    • Line 14: warning: exported const MemoryStorageType should have comment (or a comment on this block) or be unexported (golint)
    • fluid/api/v1alpha1/dataset_types.go
    • Line 29: warning: comment on exported const PendingDatasetPhase should be of the form "PendingDatasetPhase ..." (golint)
    • Line 31: warning: comment on exported const BoundDatasetPhase should be of the form "BoundDatasetPhase ..." (golint)
    • Line 33: warning: comment on exported const FailedDatasetPhase should be of the form "FailedDatasetPhase ..." (golint)
    • Line 35: warning: comment on exported const NotBoundDatasetPhase should be of the form "NotBoundDatasetPhase ..." (golint)
    • Line 38: warning: exported const NoneDatasetPhase should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported type SecretKeySelector should have comment or be unexported (golint)
    • Line 51: warning: exported type EncryptOptionSource should have comment or be unexported (golint)
    • Line 56: warning: exported type EncryptOption should have comment or be unexported (golint)
    • Line 226: warning: comment on exported type DatasetCondition should be of the form "DatasetCondition ..." (with optional leading article) (golint)
    • Line 295: warning: exported method Dataset.IsExclusiveMode should have comment or be unexported (golint)
    • fluid/pkg/common/constants.go
    • Line 21: warning: comment on exported const LabelAnnotationStorageCapacityPrefix should be of the form "LabelAnnotationStorageCapacityPrefix ..." (golint)
    • Line 23: warning: comment on exported const LabelAnnotationDataset should be of the form "LabelAnnotationDataset ..." (golint)
    • Line 66: warning: exported type CacheStoreType should have comment or be unexported (golint)
    • Line 69: warning: exported const DiskCacheStore should have comment (or a comment on this block) or be unexported (golint)
    • Line 76: warning: exported const RecommendedKubeConfigPathEnv should have comment or be unexported (golint)
    • Line 78: warning: exported type MediumType should have comment or be unexported (golint)
    • Line 81: warning: exported const Memory should have comment (or a comment on this block) or be unexported (golint)
    • Line 94: warning: exported function GetDefaultTieredStoreOrder should have comment or be unexported (golint)
    • Line 99: warning: exported type Category should have comment or be unexported (golint)
    • Line 102: warning: exported const AccelerateCategory should have comment (or a comment on this block) or be unexported (golint)
    • Line 106: warning: exported var ExpectedFluidAnnotations should have comment or be unexported (golint)
    • Line 112: warning: exported const FluidExclusiveKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 116: warning: exported const RootDirPath should have comment (or a comment on this block) or be unexported (golint)
    • fluid/pkg/ddc/jindo/dataset.go
    • Line 15: warning: exported method JindoEngine.UpdateDatasetStatus should have comment or be unexported (golint)
    • Line 73: warning: exported method JindoEngine.UpdateCacheOfDataset should have comment or be unexported (golint)
    • Line 124: warning: exported method JindoEngine.BindToDataset should have comment or be unexported (golint)
    • fluid/pkg/ddc/jindo/operations/cached.go
    • Line 9: warning: comment on exported method JindoFileUtils.CleanCache should be of the form "CleanCache ..." (golint)
    • Line 27: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fluid/pkg/controllers/runtime_controller.go
    • Line 124: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 314: warning: comment on exported type RuntimeReconcilerInterface should be of the form "RuntimeReconcilerInterface ..." (with optional leading article) (golint)
    • fluid/pkg/ddc/jindo/types.go
    • Line 3: warning: exported type Jindo should have comment or be unexported (golint)
    • Line 23: warning: exported type HadoopConfig should have comment or be unexported (golint)
    • Line 29: warning: exported type Master should have comment or be unexported (golint)
    • Line 40: warning: exported type Worker should have comment or be unexported (golint)
    • Line 47: warning: exported type Ports should have comment or be unexported (golint)
    • Line 52: warning: exported type Fuse should have comment or be unexported (golint)
    • Line 61: warning: exported type Mounts should have comment or be unexported (golint)
    • Line 66: warning: exported type Resources should have comment or be unexported (golint)
    • Line 71: warning: exported type Resource should have comment or be unexported (golint)
    • fluid/pkg/utils/docker/image.go
    • Line 12: warning: exported const ImageTagEnvRegexFormat should have comment or be unexported (golint)
    • Line 15: warning: exported var ImageTagEnvRegex should have comment or be unexported (golint)
    • fluid/api/v1alpha1/common.go
    • Line 47: warning: comment on exported type HCFSStatus should be of the form "HCFSStatus ..." (with optional leading article) (golint)
    • Line 56: warning: comment on exported type APIGatewayStatus should be of the form "APIGatewayStatus ..." (with optional leading article) (golint)
    • fluid/pkg/ddc/alluxio/dataset.go
    • Line 30: warning: comment on exported method AlluxioEngine.UpdateCacheOfDataset should be of the form "UpdateCacheOfDataset ..." (golint)
    • Line 83: warning: comment on exported method AlluxioEngine.UpdateDatasetStatus should be of the form "UpdateDatasetStatus ..." (golint)
    • Line 156: warning: exported method AlluxioEngine.BindToDataset should have comment or be unexported (golint)
    • fluid/pkg/controllers/v1alpha1/dataset/dataset_controller.go
    • Line 57: warning: exported method DatasetReconciler.Reconcile should have comment or be unexported (golint)
    • Line 75: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 116: 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 174: warning: exported method DatasetReconciler.SetupWithManager should have comment or be unexported (golint)
    • fluid/pkg/common/deprecated/storage.go
    • Line 21: warning: exported const HumanReadType should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported const MemoryStorageType should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported const LabelAnnotationPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: comment on exported const LabelAnnotationStorageCapacityPrefix should be of the form "LabelAnnotationStorageCapacityPrefix ..." (golint)
    • fluid/pkg/ddc/alluxio/const.go
    • Line 22: warning: comment on exported const METRICS_PREFIX_BYTES_READ_LOCAL should be of the form "METRICS_PREFIX_BYTES_READ_LOCAL ..." (golint)
    • Line 25: warning: exported const METRICS_PREFIX_BYTES_READ_REMOTE should have comment (or a comment on this block) or be unexported (golint)
    • fluid/pkg/ddc/alluxio/shutdown.go
    • Line 38: warning: comment on exported method AlluxioEngine.Shutdown should be of the form "Shutdown ..." (golint)
    • Line 128: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fluid/pkg/ddc/alluxio/ufs_path_builder.go
    • Line 26: warning: exported type UFSPathBuilder should have comment or be unexported (golint)
    • Line 28: warning: comment on exported method UFSPathBuilder.GenAlluxioMountPath should be of the form "GenAlluxioMountPath ..." (golint)
    • Line 44: warning: comment on exported method UFSPathBuilder.GenAlluxioUFSRootPath should be of the form "GenAlluxioUFSRootPath ..." (golint)
    • Line 78: warning: comment on exported method UFSPathBuilder.GetLocalStorageRootDir should be of the form "GetLocalStorageRootDir ..." (golint)
    • Line 88: warning: comment on exported method UFSPathBuilder.GenLocalStoragePath should be of the form "GenLocalStoragePath ..." (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!