Preparing report...

Report for github.com/kubeflow/tf-operator

(v1.3.0)

A    Great!    Found 47 issues across 104 files

Tweet

gofmt78%

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!


gocyclo96%

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.


golint74%

Golint is a linter for Go source code.

    • pkg/common/util/client.go
    • Line 23: warning: exported function HomeDir should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function GetDelegatingClientFromClient should be of the form "GetDelegatingClientFromClient ..." (golint)
    • pkg/apis/mxnet/v1/mxjob_types.go
    • Line 49: warning: comment on exported const MXTrain should be of the form "MXTrain ..." (golint)
    • Line 53: warning: comment on exported const MXTune should be of the form "MXTune ..." (golint)
    • Line 69: warning: comment on exported const MXReplicaTypeTunerTracker should be of the form "MXReplicaTypeTunerTracker ..." (golint)
    • Line 73: warning: comment on exported const MXReplicaTypeTunerServer should be of the form "MXReplicaTypeTunerServer ..." (golint)
    • Line 76: warning: comment on exported const MXReplicaTypeTuner should be of the form "MXReplicaTypeTuner ..." (golint)
    • pkg/common/util/v1/testutil/util.go
    • Line 31: warning: exported const LabelGroupName should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported const DeprecatedLabelTFJobName should be of the form "DeprecatedLabelTFJobName ..." (golint)
    • Line 42: warning: exported var GroupName should have comment or be unexported (golint)
    • Line 46: warning: exported function GenLabels should have comment or be unexported (golint)
    • Line 54: warning: exported function GenOwnerReference should have comment or be unexported (golint)
    • Line 79: warning: exported function GetKey should have comment or be unexported (golint)
    • Line 88: warning: exported function CheckCondition should have comment or be unexported (golint)
    • pkg/common/util/scheduler.go
    • Line 20: warning: exported const DefaultGangSchedulerName should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function IsGangSchedulerSet should have comment or be unexported (golint)
    • pkg/controller.v1/register_controller.go
    • Line 15: warning: don't use an underscore in package name (golint)
    • Line 32: warning: exported const ErrTemplateSchemeNotSupported should have comment or be unexported (golint)
    • Line 34: warning: exported type ReconcilerSetupFunc should have comment or be unexported (golint)
    • Line 36: warning: exported var SupportedSchemeReconciler should have comment or be unexported (golint)
    • Line 51: warning: exported type EnabledSchemes should have comment or be unexported (golint)
    • Line 57: warning: exported method EnabledSchemes.Set should have comment or be unexported (golint)
    • Line 59: warning: should omit 2nd value from range; this loop is equivalent to `for supportedKind := range ...` (golint)
    • Line 68: warning: exported method EnabledSchemes.FillAll should have comment or be unexported (golint)
    • Line 69: warning: should omit 2nd value from range; this loop is equivalent to `for supportedKind := range ...` (golint)
    • Line 74: warning: exported method EnabledSchemes.Empty should have comment or be unexported (golint)
    • pkg/controller.v1/mxnet/mxnet.go
    • Line 55: warning: exported type UrlPort should have comment or be unexported (golint)
    • Line 69: warning: exported function SetPodEnv should have comment or be unexported (golint)
    • Line 206: warning: don't use underscores in Go names; var url_port should be urlPort (golint)
    • Line 257: warning: exported function ContainSchedulerSpec should have comment or be unexported (golint)
    • pkg/common/util/v1/testutil/service.go
    • Line 28: warning: exported function NewBaseService should have comment or be unexported (golint)
    • Line 39: warning: exported function NewService should have comment or be unexported (golint)
    • Line 56: warning: exported function SetServices should have comment or be unexported (golint)
    • pkg/common/util/v1/testutil/pod.go
    • Line 38: warning: exported function NewBasePod should have comment or be unexported (golint)
    • Line 49: warning: exported function NewPod should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function NewPodList should be of the form "NewPodList ..." (golint)
    • Line 67: warning: exported function SetPodsStatuses should have comment or be unexported (golint)
    • pkg/common/util/v1/testutil/tfjob.go
    • Line 27: warning: exported function NewTFJobWithCleanPolicy should have comment or be unexported (golint)
    • Line 38: warning: exported function NewTFJobWithCleanupJobDelay should have comment or be unexported (golint)
    • Line 53: warning: exported function NewTFJobWithActiveDeadlineSeconds should have comment or be unexported (golint)
    • Line 68: warning: exported function NewTFJobWithBackoffLimit should have comment or be unexported (golint)
    • Line 85: warning: exported function NewTFJobWithChief should have comment or be unexported (golint)
    • Line 95: warning: exported function NewTFJobWithEvaluator should have comment or be unexported (golint)
    • Line 107: warning: exported function NewTFJobWithSuccessPolicy should have comment or be unexported (golint)
    • Line 113: warning: exported function NewTFJob should have comment or be unexported (golint)
    • Line 148: warning: exported function NewTFJobV2 should have comment or be unexported (golint)
    • Line 210: warning: exported function NewTFJobWithNamespace should have comment or be unexported (golint)
    • Line 217: warning: exported function NewTFJobWithEvaluatorAndNamespace should have comment or be unexported (golint)
    • Line 224: warning: exported function NewTFReplicaSpecTemplate should have comment or be unexported (golint)
    • Line 244: warning: exported function SetTFJobCompletionTime should have comment or be unexported (golint)
    • pkg/controller.v1/mxnet/mxjob_controller.go
    • Line 125: warning: comment on exported method MXJobReconciler.Reconcile should be of the form "Reconcile ..." (golint)
    • Line 223: warning: comment on exported method MXJobReconciler.ControllerName should be of the form "ControllerName ..." (golint)
    • Line 228: warning: exported method MXJobReconciler.GetAPIGroupVersionKind should have comment or be unexported (golint)
    • Line 232: warning: exported method MXJobReconciler.GetAPIGroupVersion should have comment or be unexported (golint)
    • Line 236: warning: exported method MXJobReconciler.GetGroupNameLabelValue should have comment or be unexported (golint)
    • Line 240: warning: exported method MXJobReconciler.GetJobFromInformerCache should have comment or be unexported (golint)
    • Line 254: warning: exported method MXJobReconciler.GetJobFromAPIClient should have comment or be unexported (golint)
    • Line 273: warning: exported method MXJobReconciler.GetPodsForJob should have comment or be unexported (golint)
    • Line 288: warning: exported method MXJobReconciler.GetServicesForJob should have comment or be unexported (golint)
    • Line 306: warning: exported method MXJobReconciler.DeleteJob should have comment or be unexported (golint)
    • Line 322: warning: exported method MXJobReconciler.UpdateJobStatus should have comment or be unexported (golint)
    • Line 429: warning: exported method MXJobReconciler.SetClusterSpec should have comment or be unexported (golint)
    • Line 433: warning: exported method MXJobReconciler.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 437: warning: exported method MXJobReconciler.GetDefaultContainerPortName should have comment or be unexported (golint)
    • Line 441: warning: exported method MXJobReconciler.IsMasterRole should have comment or be unexported (golint)
    • pkg/controller.v1/tensorflow/tfjob_controller.go
    • Line 71: warning: exported const FailedDeleteJobReason should have comment (or a comment on this block) or be unexported (golint)
    • Line 98: warning: exported function NewReconciler should have comment or be unexported (golint)
    • Line 233: warning: exported method TFJobReconciler.ControllerName should have comment or be unexported (golint)
    • Line 237: warning: exported method TFJobReconciler.GetAPIGroupVersionKind should have comment or be unexported (golint)
    • Line 241: warning: exported method TFJobReconciler.GetAPIGroupVersion should have comment or be unexported (golint)
    • Line 245: warning: exported method TFJobReconciler.GetGroupNameLabelValue should have comment or be unexported (golint)
    • Line 249: warning: exported method TFJobReconciler.GetJobFromInformerCache should have comment or be unexported (golint)
    • Line 257: warning: exported method TFJobReconciler.GetJobFromAPIClient should have comment or be unexported (golint)
    • Line 361: warning: exported method TFJobReconciler.DeleteJob should have comment or be unexported (golint)
    • Line 380: warning: exported method TFJobReconciler.UpdateJobStatus should have comment or be unexported (golint)
    • Line 539: warning: exported method TFJobReconciler.UpdateJobStatusInApiServer should have comment or be unexported (golint)
    • Line 568: warning: comment on exported method TFJobReconciler.SetClusterSpec should be of the form "SetClusterSpec ..." (golint)
    • Line 604: warning: exported method TFJobReconciler.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 608: warning: exported method TFJobReconciler.GetDefaultContainerPortName should have comment or be unexported (golint)
    • Line 612: warning: exported method TFJobReconciler.IsMasterRole should have comment or be unexported (golint)
    • Line 665: warning: comment on exported method TFJobReconciler.ReconcilePods should be of the form "ReconcilePods ..." (golint)
    • pkg/controller.v1/xgboost/xgboostjob_controller.go
    • Line 68: warning: comment on exported const FailedDeleteJobReason should be of the form "FailedDeleteJobReason ..." (golint)
    • Line 70: warning: exported const SuccessfulDeleteJobReason should have comment (or a comment on this block) or be unexported (golint)
    • Line 229: warning: exported method XGBoostJobReconciler.ControllerName should have comment or be unexported (golint)
    • Line 233: warning: exported method XGBoostJobReconciler.GetAPIGroupVersionKind should have comment or be unexported (golint)
    • Line 237: warning: exported method XGBoostJobReconciler.GetAPIGroupVersion should have comment or be unexported (golint)
    • Line 241: warning: exported method XGBoostJobReconciler.GetGroupNameLabelValue should have comment or be unexported (golint)
    • Line 444: warning: exported method XGBoostJobReconciler.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 448: warning: exported method XGBoostJobReconciler.GetDefaultContainerPortName should have comment or be unexported (golint)
    • Line 452: warning: exported method XGBoostJobReconciler.IsMasterRole should have comment or be unexported (golint)
    • pkg/controller.v1/pytorch/pytorchjob_controller.go
    • Line 212: warning: exported method PyTorchJobReconciler.ControllerName should have comment or be unexported (golint)
    • Line 216: warning: exported method PyTorchJobReconciler.GetAPIGroupVersionKind should have comment or be unexported (golint)
    • Line 220: warning: exported method PyTorchJobReconciler.GetAPIGroupVersion should have comment or be unexported (golint)
    • Line 224: warning: exported method PyTorchJobReconciler.GetGroupNameLabelValue should have comment or be unexported (golint)
    • Line 228: warning: exported method PyTorchJobReconciler.GetJobFromInformerCache should have comment or be unexported (golint)
    • Line 242: warning: exported method PyTorchJobReconciler.GetJobFromAPIClient should have comment or be unexported (golint)
    • Line 261: warning: exported method PyTorchJobReconciler.GetPodsForJob should have comment or be unexported (golint)
    • Line 278: warning: exported method PyTorchJobReconciler.GetServicesForJob should have comment or be unexported (golint)
    • Line 296: warning: exported method PyTorchJobReconciler.DeleteJob should have comment or be unexported (golint)
    • Line 427: warning: exported method PyTorchJobReconciler.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 431: warning: exported method PyTorchJobReconciler.GetDefaultContainerPortName should have comment or be unexported (golint)
    • Line 435: warning: exported method PyTorchJobReconciler.IsMasterRole should have comment or be unexported (golint)
    • pkg/common/metrics.go
    • Line 71: warning: exported function CreatedJobsCounterInc should have comment or be unexported (golint)
    • Line 71: warning: don't use underscores in Go names; func parameter job_namespace should be jobNamespace (golint)
    • Line 75: warning: exported function DeletedJobsCounterInc should have comment or be unexported (golint)
    • Line 75: warning: don't use underscores in Go names; func parameter job_namespace should be jobNamespace (golint)
    • Line 79: warning: exported function SuccessfulJobsCounterInc should have comment or be unexported (golint)
    • Line 79: warning: don't use underscores in Go names; func parameter job_namespace should be jobNamespace (golint)
    • Line 83: warning: exported function FailedJobsCounterInc should have comment or be unexported (golint)
    • Line 83: warning: don't use underscores in Go names; func parameter job_namespace should be jobNamespace (golint)
    • Line 87: warning: exported function RestartedJobsCounterInc should have comment or be unexported (golint)
    • Line 87: warning: don't use underscores in Go names; func parameter job_namespace should be jobNamespace (golint)
    • pkg/common/util/v1/unstructured/informer.go
    • Line 36: warning: exported type UnstructuredInformer should have comment or be unexported (golint)
    • Line 40: warning: exported function NewTFJobInformer should have comment or be unexported (golint)
    • Line 46: warning: exported method UnstructuredInformer.Informer should have comment or be unexported (golint)
    • Line 50: warning: exported method UnstructuredInformer.Lister 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!


misspell99%

Misspell Finds commonly misspelled English words