Preparing report...

Report for github.com/kubeflow/common

(v0.4.1)

An error occurred while generating the report.    Found 38 issues across 97 files

Tweet

gofmt95%

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!


golint64%

Golint is a linter for Go source code.

    • pkg/reconciler.v1/common/job.go
    • Line 40: warning: exported const GroupName should have comment (or a comment on this block) or be unexported (golint)
    • Line 442: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 482: warning: exported method KubeflowJobReconciler.GetJob should have comment or be unexported (golint)
    • Line 486: warning: exported method KubeflowJobReconciler.ExtractReplicasSpec should have comment or be unexported (golint)
    • Line 490: warning: exported method KubeflowJobReconciler.ExtractRunPolicy should have comment or be unexported (golint)
    • Line 494: warning: exported method KubeflowJobReconciler.ExtractJobStatus should have comment or be unexported (golint)
    • Line 498: warning: exported method KubeflowJobReconciler.IsMasterRole should have comment or be unexported (golint)
    • pkg/controller.v1/control/controller_ref_manager.go
    • Line 31: warning: exported type BaseControllerRefManager should have comment or be unexported (golint)
    • Line 40: warning: exported method BaseControllerRefManager.CanAdopt should have comment or be unexported (golint)
    • Line 119: warning: exported type PodControllerRefManager should have comment or be unexported (golint)
    • Line 248: warning: exported type ServiceControllerRefManager should have comment or be unexported (golint)
    • pkg/controller.v1/expectation/expectation.go
    • Line 14: warning: comment on exported const ExpectationsTimeout should be of the form "ExpectationsTimeout ..." (golint)
    • Line 134: warning: exported method ControllerExpectations.ExpectCreations should have comment or be unexported (golint)
    • Line 138: warning: exported method ControllerExpectations.ExpectDeletions should have comment or be unexported (golint)
    • Line 142: warning: comment on exported method ControllerExpectations.LowerExpectations should be of the form "LowerExpectations ..." (golint)
    • Line 151: warning: comment on exported method ControllerExpectations.RaiseExpectations should be of the form "RaiseExpectations ..." (golint)
    • Line 186: warning: receiver name e should be consistent with previous receiver name exp for ControlleeExpectations (golint)
    • Line 192: warning: receiver name e should be consistent with previous receiver name exp for ControlleeExpectations (golint)
    • Line 198: warning: receiver name e should be consistent with previous receiver name exp for ControlleeExpectations (golint)
    • pkg/util/k8sutil/client.go
    • Line 29: warning: comment on exported type CRDClient should be of the form "CRDClient ..." (with optional leading article) (golint)
    • Line 43: warning: exported function NewCRDRestClient should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method CRDRestClient.Client should be of the form "Client ..." (golint)
    • Line 69: warning: exported method CRDRestClient.Update should have comment or be unexported (golint)
    • Line 85: warning: exported method CRDRestClient.UpdateStatus should have comment or be unexported (golint)
    • pkg/util/logger.go
    • Line 26: warning: exported function LoggerForReplica should have comment or be unexported (golint)
    • Line 36: warning: exported function LoggerForJob should have comment or be unexported (golint)
    • Line 45: warning: exported function LoggerForPod should have comment or be unexported (golint)
    • Line 61: warning: exported function LoggerForService should have comment or be unexported (golint)
    • Line 77: warning: exported function LoggerForKey should have comment or be unexported (golint)
    • Line 85: warning: exported function LoggerForUnstructured should have comment or be unexported (golint)
    • pkg/controller.v1/common/util.go
    • Line 32: warning: exported type ReplicaPriority should have comment or be unexported (golint)
    • Line 50: warning: exported function GenGeneralName should have comment or be unexported (golint)
    • Line 72: warning: exported function MaxInt should have comment or be unexported (golint)
    • Line 79: warning: exported function AddResourceList should have comment or be unexported (golint)
    • Line 106: warning: exported type PriorityClassGetFunc should have comment or be unexported (golint)
    • Line 108: warning: exported function CalcPGMinResources should have comment or be unexported (golint)
    • pkg/util/train/train_util.go
    • Line 15: warning: package comment should be of the form "Package train ..." (golint)
    • Line 18: warning: exported function IsRetryableExitCode should have comment or be unexported (golint)
    • test_job/test_util/v1/util.go
    • Line 30: warning: exported const LabelGroupName should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported var TestGroupName should have comment or be unexported (golint)
    • Line 42: warning: exported function GenLabels should have comment or be unexported (golint)
    • Line 49: warning: exported function GenOwnerReference should have comment or be unexported (golint)
    • Line 63: warning: exported function GetKey should have comment or be unexported (golint)
    • Line 72: warning: exported function CheckCondition should have comment or be unexported (golint)
    • pkg/controller.v1/control/service_control.go
    • Line 68: warning: exported method RealServiceControl.PatchService should have comment or be unexported (golint)
    • Line 73: warning: exported method RealServiceControl.CreateServices should have comment or be unexported (golint)
    • Line 77: warning: exported method RealServiceControl.CreateServicesWithControllerRef should have comment or be unexported (golint)
    • Line 132: 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 138: warning: exported type FakeServiceControl should have comment or be unexported (golint)
    • Line 151: warning: exported method FakeServiceControl.PatchService should have comment or be unexported (golint)
    • Line 161: warning: exported method FakeServiceControl.CreateServices should have comment or be unexported (golint)
    • Line 175: warning: exported method FakeServiceControl.CreateServicesWithControllerRef should have comment or be unexported (golint)
    • Line 190: warning: exported method FakeServiceControl.DeleteService should have comment or be unexported (golint)
    • Line 200: warning: exported method FakeServiceControl.Clear should have comment or be unexported (golint)
    • pkg/util/counter.go
    • Line 8: warning: exported type Counter should have comment or be unexported (golint)
    • Line 13: warning: exported function NewCounter should have comment or be unexported (golint)
    • Line 20: warning: exported method Counter.Inc should have comment or be unexported (golint)
    • Line 32: warning: exported method Counter.DeleteKey should have comment or be unexported (golint)
    • Line 39: warning: exported method Counter.Counts should have comment or be unexported (golint)
    • Line 54: warning: exported method Counter.Dec should have comment or be unexported (golint)
    • pkg/controller.v1/control/utils.go
    • Line 10: warning: exported function ValidateControllerRef should have comment or be unexported (golint)
    • Line 29: warning: exported function GetServiceFromTemplate should have comment or be unexported (golint)
    • pkg/controller.v1/common/pod.go
    • Line 74: warning: comment on exported method JobController.AddPod should be of the form "AddPod ..." (golint)
    • Line 120: warning: comment on exported method JobController.UpdatePod should be of the form "UpdatePod ..." (golint)
    • Line 166: warning: comment on exported method JobController.DeletePod should be of the form "DeletePod ..." (golint)
    • Line 218: warning: comment on exported method JobController.GetPodsForJob should be of the form "GetPodsForJob ..." (golint)
    • Line 263: warning: comment on exported method JobController.GetPodSlices should be of the form "GetPodSlices ..." (golint)
    • pkg/controller.v1/common/job.go
    • Line 22: warning: exported method JobController.DeletePodsAndServices should have comment or be unexported (golint)
    • Line 113: 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 199: 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 212: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 322: warning: exported method JobController.CleanupJob should have comment or be unexported (golint)
    • Line 340: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pkg/controller.v1/common/job_controller.go
    • Line 150: warning: exported function NewJobController should have comment or be unexported (golint)
    • Line 195: warning: exported method JobController.GenOwnerReference should have comment or be unexported (golint)
    • Line 209: warning: exported method JobController.GenLabels should have comment or be unexported (golint)
    • Line 220: warning: exported method JobController.SyncPodGroup should have comment or be unexported (golint)
    • Line 287: warning: exported method JobController.DeletePodGroup should have comment or be unexported (golint)
    • Line 307: warning: exported method JobController.DeletePdb should have comment or be unexported (golint)
    • test_job/reconciler.v1/test_job/dummy_client.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: exported type DummyClient should have comment or be unexported (golint)
    • Line 23: warning: exported method DummyClient.Scheme should have comment or be unexported (golint)
    • Line 27: warning: exported method DummyClient.RESTMapper should have comment or be unexported (golint)
    • Line 31: warning: exported method DummyClient.Create should have comment or be unexported (golint)
    • Line 36: warning: exported method DummyClient.Delete should have comment or be unexported (golint)
    • Line 49: warning: exported method DummyClient.Update should have comment or be unexported (golint)
    • test_job/reconciler.v1/test_job/test_job_reconciler.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 22: warning: exported type TestReconciler should have comment or be unexported (golint)
    • Line 31: warning: exported function NewTestReconciler should have comment or be unexported (golint)
    • Line 38: warning: don't use underscores in Go names; var dummy_client should be dummyClient (golint)
    • Line 82: warning: exported method TestReconciler.GetReconcilerName should have comment or be unexported (golint)
    • Line 86: warning: exported method TestReconciler.GetJob should have comment or be unexported (golint)
    • Line 90: warning: exported method TestReconciler.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 94: warning: exported method TestReconciler.GetPodGroupForJob should have comment or be unexported (golint)
    • Line 98: warning: exported method TestReconciler.GetPodsForJob should have comment or be unexported (golint)
    • Line 102: warning: exported method TestReconciler.GetServicesForJob should have comment or be unexported (golint)
    • Line 106: warning: exported method TestReconciler.ExtractReplicasSpec should have comment or be unexported (golint)
    • Line 117: warning: exported method TestReconciler.ExtractRunPolicy should have comment or be unexported (golint)
    • Line 123: warning: exported method TestReconciler.ExtractJobStatus should have comment or be unexported (golint)
    • Line 129: warning: exported method TestReconciler.IsMasterRole should have comment or be unexported (golint)
    • test_job/apis/test_job/v1/types.go
    • Line 26: warning: comment on exported type TestJob should be of the form "TestJob ..." (with optional leading article) (golint)
    • Line 53: warning: exported const TestReplicaTypeWorker should have comment (or a comment on this block) or be unexported (golint)
    • test_job/test_util/v1/const.go
    • Line 22: warning: exported const TestImageName should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported var AlwaysReady should have comment or be unexported (golint)
    • test_job/test_util/v1/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/controller.v1/control/pod_control.go
    • Line 95: warning: exported method RealPodControl.CreatePods should have comment or be unexported (golint)
    • Line 99: warning: exported method RealPodControl.CreatePodsWithControllerRef should have comment or be unexported (golint)
    • Line 106: warning: exported method RealPodControl.CreatePodsOnNode should have comment or be unexported (golint)
    • Line 113: warning: exported method RealPodControl.PatchPod should have comment or be unexported (golint)
    • Line 118: warning: exported function GetPodFromTemplate should have comment or be unexported (golint)
    • Line 153: 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 165: warning: exported method RealPodControl.DeletePod should have comment or be unexported (golint)
    • Line 187: 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 193: warning: exported type FakePodControl should have comment or be unexported (golint)
    • Line 206: warning: exported method FakePodControl.PatchPod should have comment or be unexported (golint)
    • Line 216: warning: exported method FakePodControl.CreatePods should have comment or be unexported (golint)
    • Line 230: warning: exported method FakePodControl.CreatePodsWithControllerRef should have comment or be unexported (golint)
    • Line 245: warning: exported method FakePodControl.CreatePodsOnNode should have comment or be unexported (golint)
    • Line 260: warning: exported method FakePodControl.DeletePod should have comment or be unexported (golint)
    • Line 270: warning: exported method FakePodControl.Clear should have comment or be unexported (golint)
    • test_job/controller.v1/test_job/test_job_controller.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: exported type TestJobController should have comment or be unexported (golint)
    • Line 21: warning: exported method TestJobController.ControllerName should have comment or be unexported (golint)
    • Line 25: warning: exported method TestJobController.GetAPIGroupVersionKind should have comment or be unexported (golint)
    • Line 29: warning: exported method TestJobController.GetAPIGroupVersion should have comment or be unexported (golint)
    • Line 33: warning: exported method TestJobController.GetGroupNameLabelValue should have comment or be unexported (golint)
    • Line 37: warning: exported method TestJobController.GetDefaultContainerPortName should have comment or be unexported (golint)
    • Line 41: warning: exported method TestJobController.GetJobFromInformerCache should have comment or be unexported (golint)
    • Line 45: warning: exported method TestJobController.GetJobFromAPIClient should have comment or be unexported (golint)
    • Line 49: warning: exported method TestJobController.DeleteJob should have comment or be unexported (golint)
    • Line 55: warning: exported method TestJobController.UpdateJobStatus should have comment or be unexported (golint)
    • Line 60: warning: exported method TestJobController.UpdateJobStatusInApiServer should have comment or be unexported (golint)
    • Line 64: warning: exported method TestJobController.SetClusterSpec should have comment or be unexported (golint)
    • Line 68: warning: exported method TestJobController.GetDefaultContainerName should have comment or be unexported (golint)
    • Line 72: warning: exported method TestJobController.IsMasterRole should have comment or be unexported (golint)
    • pkg/core/utils.go
    • Line 7: warning: exported function MaxInt should have comment or be unexported (golint)
    • Line 14: warning: exported function GenGeneralName should have comment or be unexported (golint)
    • pkg/util/labels/labels.go
    • Line 26: warning: exported function ReplicaIndex should have comment or be unexported (golint)
    • Line 37: warning: exported function SetReplicaIndex should have comment or be unexported (golint)
    • Line 41: warning: exported function SetReplicaIndexStr should have comment or be unexported (golint)
    • Line 46: warning: exported function ReplicaType should have comment or be unexported (golint)
    • Line 57: warning: exported function SetReplicaType should have comment or be unexported (golint)
    • Line 62: warning: exported function HasKnownLabels should have comment or be unexported (golint)
    • Line 67: warning: exported function SetJobRole should have comment or be unexported (golint)
    • pkg/controller.v1/common/service.go
    • Line 1: warning: package comment should be of the form "Package common ..." (golint)
    • Line 50: warning: comment on exported method JobController.AddService should be of the form "AddService ..." (golint)
    • Line 89: warning: comment on exported method JobController.UpdateService should be of the form "UpdateService ..." (golint)
    • Line 96: warning: comment on exported method JobController.DeleteService should be of the form "DeleteService ..." (golint)
    • Line 102: warning: comment on exported method JobController.GetServicesForJob should be of the form "GetServicesForJob ..." (golint)
    • Line 154: warning: comment on exported method JobController.ReconcileServices should be of the form "ReconcileServices ..." (golint)
    • Line 209: warning: comment on exported method JobController.CreateNewService should be of the form "CreateNewService ..." (golint)
    • pkg/apis/common/v1/types.go
    • Line 1: warning: package comment should be of the form "Package v1 ..." (golint)
    • Line 21: warning: comment on exported type JobStatus should be of the form "JobStatus ..." (with optional leading article) (golint)
    • Line 48: warning: comment on exported type ReplicaType should be of the form "ReplicaType ..." (with optional leading article) (golint)
    • Line 53: warning: comment on exported type ReplicaStatus should be of the form "ReplicaStatus ..." (with optional leading article) (golint)
    • Line 71: warning: comment on exported type ReplicaSpec should be of the form "ReplicaSpec ..." (with optional leading article) (golint)
    • Line 90: warning: comment on exported type JobCondition should be of the form "JobCondition ..." (with optional leading article) (golint)
    • Line 108: warning: comment on exported type JobConditionType should be of the form "JobConditionType ..." (with optional leading article) (golint)
    • Line 140: warning: comment on exported type CleanPodPolicy should be of the form "CleanPodPolicy ..." (with optional leading article) (golint)
    • Line 145: warning: exported const CleanPodPolicyUndefined should have comment (or a comment on this block) or be unexported (golint)
    • Line 151: warning: comment on exported type RestartPolicy should be of the form "RestartPolicy ..." (with optional leading article) (golint)
    • Line 159: warning: exported const RestartPolicyAlways should have comment (or a comment on this block) or be unexported (golint)
    • Line 171: warning: comment on exported type RunPolicy should be of the form "RunPolicy ..." (with optional leading article) (golint)
    • Line 201: warning: comment on exported type SchedulingPolicy should be of the form "SchedulingPolicy ..." (with optional leading article) (golint)
    • test_job/test_util/v1/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)
    • test_job/test_util/v1/test_job_util.go
    • Line 27: warning: exported function NewTestJob should have comment or be unexported (golint)
    • Line 53: warning: exported function NewTestReplicaSpecTemplate should have comment or be unexported (golint)
    • Line 73: warning: exported function SetTestJobCompletionTime should have comment or be unexported (golint)
    • pkg/util/status.go
    • Line 18: warning: comment on exported const JobRestartingReason should be of the form "JobRestartingReason ..." (golint)
    • pkg/util/util.go
    • Line 25: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • pkg/util/k8sutil/k8sutil.go
    • Line 81: warning: comment on exported function CascadeDeleteOptions should be of the form "CascadeDeleteOptions ..." (golint)
    • Line 109: warning: exported function IsPodActive should have comment or be unexported (golint)
    • Line 115: warning: comment on exported function FilterPodCount should be of the form "FilterPodCount ..." (golint)
    • Line 126: warning: exported function GetTotalReplicas should have comment or be unexported (golint)
    • Line 139: warning: exported function GetTotalFailedReplicas should have comment or be unexported (golint)

gocyclo95%

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.

    • pkg/controller.v1/common/pod.go
    • Line 271: warning: cyclomatic complexity 19 of function (*JobController).ReconcilePods() is high (> 15) (gocyclo)
    • Line 370: warning: cyclomatic complexity 16 of function (*JobController).createNewPod() is high (> 15) (gocyclo)

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!


misspell0%

Misspell Finds commonly misspelled English words

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