Preparing report...

Report for github.com/rook/nfs

A+    Excellent!    Found 46 issues across 173 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


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!


gocyclo98%

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.


golint73%

Golint is a linter for Go source code.

    • nfs/pkg/operator/nfs/controller.go
    • Line 50: warning: exported type NFSServerReconciler should have comment or be unexported (golint)
    • Line 58: warning: exported method NFSServerReconciler.Reconcile should have comment or be unexported (golint)
    • nfs/pkg/operator/nfs/webhook.go
    • Line 25: warning: exported type Webhook should have comment or be unexported (golint)
    • Line 30: warning: exported function NewWebhook should have comment or be unexported (golint)
    • Line 37: warning: exported method Webhook.Run should have comment or be unexported (golint)
    • nfs/pkg/operator/k8sutil/deployment.go
    • Line 119: warning: exported function WaitForDeploymentToStart should have comment or be unexported (golint)
    • Line 168: warning: exported type Failure should have comment or be unexported (golint)
    • Line 173: warning: exported type Failures should have comment or be unexported (golint)
    • Line 175: warning: exported method Failures.CollatedErrors should have comment or be unexported (golint)
    • Line 304: warning: exported function UpdateMultipleDeploymentsAndWait should have comment or be unexported (golint)
    • Line 448: warning: exported function AddRookVersionLabelToObjectMeta should have comment or be unexported (golint)
    • Line 455: warning: exported function AddLabelToDeployment should have comment or be unexported (golint)
    • Line 465: warning: exported function AddLabelToPod should have comment or be unexported (golint)
    • Line 475: warning: exported function AddLabelToJob should have comment or be unexported (golint)
    • Line 502: warning: exported function CreateOrUpdateDeployment should have comment or be unexported (golint)
    • nfs/pkg/apis/rook.io/v1alpha2/types.go
    • Line 34: warning: exported type Volume should have comment or be unexported (golint)
    • Line 40: warning: exported type Attachment should have comment or be unexported (golint)
    • Line 51: warning: exported type VolumeList should have comment or be unexported (golint)
    • nfs/tests/framework/installer/installer.go
    • Line 34: warning: comment on exported const CassandraTestSuite should be of the form "CassandraTestSuite ..." (golint)
    • Line 36: warning: exported const CephTestSuite should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported function SkipTestSuite should have comment or be unexported (golint)
    • Line 63: warning: exported function SystemNamespace should have comment or be unexported (golint)
    • nfs/pkg/operator/nfs/provisioner.go
    • Line 51: warning: exported type Provisioner should have comment or be unexported (golint)
    • Line 73: warning: comment on exported method Provisioner.Provision should be of the form "Provision ..." (golint)
    • Line 167: warning: exported method Provisioner.Delete should have comment or be unexported (golint)
    • nfs/pkg/operator/k8sutil/kvstore.go
    • Line 30: warning: exported type ConfigMapKVStore should have comment or be unexported (golint)
    • Line 36: warning: exported function NewConfigMapKVStore should have comment or be unexported (golint)
    • Line 44: warning: exported method ConfigMapKVStore.GetValue should have comment or be unexported (golint)
    • Line 59: warning: exported method ConfigMapKVStore.SetValue should have comment or be unexported (golint)
    • Line 63: warning: exported method ConfigMapKVStore.SetValueWithLabels should have comment or be unexported (golint)
    • Line 102: warning: exported method ConfigMapKVStore.GetStore should have comment or be unexported (golint)
    • Line 112: warning: exported method ConfigMapKVStore.ClearStore should have comment or be unexported (golint)
    • nfs/pkg/apis/nfs.rook.io/v1alpha1/types.go
    • Line 1: warning: package comment should be of the form "Package v1alpha1 ..." (golint)
    • Line 30: warning: exported const Finalizer should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported const EventCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported type NFSServerState should have comment or be unexported (golint)
    • Line 42: warning: exported const StateInitializing should have comment (or a comment on this block) or be unexported (golint)
    • nfs/cmd/rook/rook/rook.go
    • Line 47: warning: exported const RookEnvVarPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: exported var RootCmd should have comment or be unexported (golint)
    • Line 59: warning: exported var Cfg should have comment or be unexported (golint)
    • Line 63: warning: exported type Config should have comment or be unexported (golint)
    • Line 178: warning: exported function GetOperatorImage should have comment or be unexported (golint)
    • Line 196: warning: exported function GetOperatorServiceAccount should have comment or be unexported (golint)
    • Line 210: warning: exported function CheckOperatorResources should have comment or be unexported (golint)
    • nfs/pkg/util/exec/exec_pod.go
    • Line 133: warning: exported method RemotePodCommandExecutor.ExecCommandInContainerWithFullOutputWithTimeout should have comment or be unexported (golint)
    • nfs/pkg/util/flags/flags.go
    • Line 1: warning: package comment should be of the form "Package flags ..." (golint)
    • Line 34: warning: exported function VerifyRequiredFlags should have comment or be unexported (golint)
    • Line 58: warning: exported function SetLoggingFlags should have comment or be unexported (golint)
    • Line 70: warning: exported function SetFlagsFromEnv should have comment or be unexported (golint)
    • nfs/pkg/operator/nfs/quota_fake.go
    • Line 3: warning: exported type FakeQuota should have comment or be unexported (golint)
    • Line 5: warning: exported function NewFakeProjectQuota should have comment or be unexported (golint)
    • Line 9: warning: exported method FakeQuota.CreateProjectQuota should have comment or be unexported (golint)
    • Line 13: warning: exported method FakeQuota.RemoveProjectQuota should have comment or be unexported (golint)
    • Line 17: warning: exported method FakeQuota.RestoreProjectQuota should have comment or be unexported (golint)
    • nfs/tests/framework/utils/k8s_helper.go
    • Line 121: warning: exported method K8sHelper.VersionAtLeast should have comment or be unexported (golint)
    • Line 126: warning: exported method K8sHelper.VersionMinorMatches should have comment or be unexported (golint)
    • Line 133: warning: exported method K8sHelper.MakeContext should have comment or be unexported (golint)
    • Line 137: warning: exported method K8sHelper.GetDockerImage should have comment or be unexported (golint)
    • Line 203: warning: exported method K8sHelper.Exec should have comment or be unexported (golint)
    • Line 207: warning: exported method K8sHelper.ExecRemote should have comment or be unexported (golint)
    • Line 334: warning: comment on exported method K8sHelper.DeleteResourceAndWait should be of the form "DeleteResourceAndWait ..." (golint)
    • Line 358: warning: exported method K8sHelper.CreateNamespace should have comment or be unexported (golint)
    • Line 369: warning: exported method K8sHelper.CountPodsWithLabel should have comment or be unexported (golint)
    • Line 488: warning: exported method K8sHelper.GetPodDescribeFromNamespace should have comment or be unexported (golint)
    • Line 508: warning: exported method K8sHelper.GetEventsFromNamespace should have comment or be unexported (golint)
    • Line 539: warning: exported method K8sHelper.PrintPodDescribe should have comment or be unexported (golint)
    • Line 557: warning: exported method K8sHelper.PrintEventsForNamespace should have comment or be unexported (golint)
    • Line 687: warning: exported method K8sHelper.ReadFromPod should have comment or be unexported (golint)
    • Line 691: warning: exported method K8sHelper.ReadFromPodRetry should have comment or be unexported (golint)
    • Line 820: warning: exported method K8sHelper.PrintPVs should have comment or be unexported (golint)
    • Line 842: warning: exported method K8sHelper.PrintPVCs should have comment or be unexported (golint)
    • Line 864: warning: exported method K8sHelper.PrintResources should have comment or be unexported (golint)
    • Line 874: warning: exported method K8sHelper.PrintStorageClasses should have comment or be unexported (golint)
    • Line 922: warning: exported method K8sHelper.GetPodNamesForApp should have comment or be unexported (golint)
    • Line 1030: warning: exported method K8sHelper.IsDefaultStorageClassPresent should have comment or be unexported (golint)
    • Line 1046: warning: comment on exported method K8sHelper.CheckPvcCountAndStatus should be of the form "CheckPvcCountAndStatus ..." (golint)
    • Line 1290: warning: exported method K8sHelper.WaitUntilPVCIsDeleted should have comment or be unexported (golint)
    • Line 1305: warning: exported method K8sHelper.DeletePvcWithLabel should have comment or be unexported (golint)
    • Line 1377: warning: exported method K8sHelper.GetRGWServiceURL should have comment or be unexported (golint)
    • Line 1384: warning: comment on exported method K8sHelper.GetInternalRGWServiceURL should be of the form "GetInternalRGWServiceURL ..." (golint)
    • Line 1397: warning: comment on exported method K8sHelper.GetExternalRGWServiceURL should be of the form "GetExternalRGWServiceURL ..." (golint)
    • Line 1601: warning: exported method K8sHelper.DeleteRoleAndBindings should have comment or be unexported (golint)
    • Line 1615: warning: exported method K8sHelper.DeleteRoleBinding should have comment or be unexported (golint)
    • Line 1620: warning: exported method K8sHelper.ScaleStatefulSet should have comment or be unexported (golint)
    • Line 1626: warning: exported function IsKubectlErrorNotFound should have comment or be unexported (golint)
    • Line 1703: warning: exported method K8sHelper.GetResourceStatus should have comment or be unexported (golint)
    • Line 1707: warning: exported method K8sHelper.WaitUntilResourceIsDeleted should have comment or be unexported (golint)
    • nfs/pkg/operator/k8sutil/pod.go
    • Line 124: warning: comment on exported function AddUnreachableNodeToleration should be of the form "AddUnreachableNodeToleration ..." (golint)
    • Line 257: warning: comment on exported function GetPodLog should be of the form "GetPodLog ..." (golint)
    • Line 350: warning: exported function ForceDeletePodIfStuck should have comment or be unexported (golint)
    • Line 377: warning: exported function RemoveDuplicateEnvVars should have comment or be unexported (golint)
    • Line 401: warning: exported function IsPodScheduled should have comment or be unexported (golint)
    • nfs/pkg/util/sys/parse.go
    • Line 1: warning: package comment should be of the form "Package sys ..." (golint)
    • Line 23: warning: comment on exported function Grep should be of the form "Grep ..." (golint)
    • nfs/pkg/operator/nfs/quota.go
    • Line 18: warning: exported type Quotaer should have comment or be unexported (golint)
    • Line 24: warning: exported type Quota should have comment or be unexported (golint)
    • Line 29: warning: exported function NewProjectQuota should have comment or be unexported (golint)
    • Line 119: warning: exported method Quota.CreateProjectQuota should have comment or be unexported (golint)
    • Line 170: warning: exported method Quota.RemoveProjectQuota should have comment or be unexported (golint)
    • Line 174: warning: exported method Quota.RestoreProjectQuota should have comment or be unexported (golint)
    • nfs/pkg/operator/k8sutil/resources.go
    • Line 128: warning: exported function MergeResourceRequirements should have comment or be unexported (golint)
    • Line 165: warning: exported function SetOwnerRefsWithoutBlockOwner should have comment or be unexported (golint)
    • Line 184: warning: exported type ContainerResource should have comment or be unexported (golint)
    • nfs/pkg/apis/rook.io/v1alpha2/register.go
    • Line 1: warning: package comment should be of the form "Package v1alpha2 ..." (golint)
    • Line 25: warning: exported const Version should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported var AddToScheme should have comment or be unexported (golint)
    • nfs/pkg/util/file.go
    • Line 32: warning: exported function WriteFile should have comment or be unexported (golint)
    • Line 44: warning: exported function WriteFileToLog should have comment or be unexported (golint)
    • nfs/tests/framework/installer/general_manifests.go
    • Line 23: warning: exported function GetPodWithVolume should have comment or be unexported (golint)
    • Line 48: warning: exported function GetPVC should have comment or be unexported (golint)
    • Line 63: warning: exported function GetPVCRestore should have comment or be unexported (golint)
    • Line 82: warning: exported function GetPVCClone should have comment or be unexported (golint)
    • Line 100: warning: exported function GetSnapshot should have comment or be unexported (golint)
    • nfs/pkg/apis/nfs.rook.io/register.go
    • Line 1: warning: package comment should be of the form "Package nfsrookio ..." (golint)
    • Line 19: warning: exported const CustomResourceGroupName should have comment (or a comment on this block) or be unexported (golint)
    • nfs/pkg/util/sys/kmod.go
    • Line 1: warning: package comment should be of the form "Package sys ..." (golint)
    • Line 38: warning: exported function IsBuiltinKernelModule should have comment or be unexported (golint)
    • Line 54: warning: exported function LoadKernelModule should have comment or be unexported (golint)
    • Line 68: warning: exported function CheckKernelModuleParam should have comment or be unexported (golint)
    • nfs/pkg/operator/k8sutil/volume.go
    • Line 30: warning: exported const BinariesMountPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 83: warning: exported function BinariesMountInfo should have comment or be unexported (golint)
    • nfs/pkg/apis/nfs.rook.io/v1alpha1/register.go
    • Line 1: warning: package comment should be of the form "Package v1alpha1 ..." (golint)
    • Line 27: warning: exported const CustomResourceGroup should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported var AddToScheme should have comment or be unexported (golint)

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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!