Preparing report...

Report for github.com/kubeflow/caffe2-operator

A+    Excellent!    Found 26 issues across 46 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!


gocyclo100%

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.

No problems detected. Good job!


golint43%

Golint is a linter for Go source code.

    • caffe2-operator/pkg/apis/caffe2/v1alpha1/types.go
    • Line 23: warning: exported const CRDKind should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: comment on exported const AppLabel should be of the form "AppLabel ..." (golint)
    • Line 29: warning: comment on exported const Caffe2Port should be of the form "Caffe2Port ..." (golint)
    • Line 55: warning: exported type Caffe2JobSpec should have comment or be unexported (golint)
    • Line 69: warning: comment on exported type Caffe2BackendSpec should be of the form "Caffe2BackendSpec ..." (with optional leading article) (golint)
    • Line 81: warning: exported var NoneBackendType should have comment or be unexported (golint)
    • Line 86: warning: comment on exported type TerminationPolicySpec should be of the form "TerminationPolicySpec ..." (with optional leading article) (golint)
    • Line 92: warning: exported type ChiefSpec should have comment or be unexported (golint)
    • Line 97: warning: exported type Caffe2ReplicaSpec should have comment or be unexported (golint)
    • Line 110: warning: exported type Caffe2JobStatus should have comment or be unexported (golint)
    • caffe2-operator/pkg/apis/caffe2/v1alpha1/zz_generated.defaults.go
    • Line 36: warning: exported function SetObjectDefaults_Caffe2Job should have comment or be unexported (golint)
    • Line 36: warning: don't use underscores in Go names; func SetObjectDefaults_Caffe2Job should be SetObjectDefaultsCaffe2Job (golint)
    • Line 40: warning: exported function SetObjectDefaults_Caffe2JobList should have comment or be unexported (golint)
    • Line 40: warning: don't use underscores in Go names; func SetObjectDefaults_Caffe2JobList should be SetObjectDefaultsCaffe2JobList (golint)
    • caffe2-operator/version/version.go
    • Line 22: warning: exported var Version should have comment or be unexported (golint)
    • Line 26: warning: exported function PrintVersionAndExit should have comment or be unexported (golint)
    • Line 33: warning: exported function Info should have comment or be unexported (golint)
    • caffe2-operator/pkg/controller/controller_utils.go
    • Line 116: warning: exported method RealPodControl.CreatePods should have comment or be unexported (golint)
    • Line 120: warning: exported method RealPodControl.CreatePodsWithControllerRef should have comment or be unexported (golint)
    • Line 127: warning: exported method RealPodControl.CreatePodsOnNode should have comment or be unexported (golint)
    • Line 134: warning: exported method RealPodControl.PatchPod should have comment or be unexported (golint)
    • Line 139: warning: exported function GetPodFromTemplate should have comment or be unexported (golint)
    • Line 178: 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 190: warning: exported method RealPodControl.DeletePod should have comment or be unexported (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 222: warning: exported method RealServiceControl.PatchService should have comment or be unexported (golint)
    • Line 227: warning: exported method RealServiceControl.CreateServices should have comment or be unexported (golint)
    • Line 231: warning: exported method RealServiceControl.CreateServicesWithControllerRef should have comment or be unexported (golint)
    • Line 260: warning: exported type FakeServiceControl should have comment or be unexported (golint)
    • Line 273: warning: exported method FakeServiceControl.PatchService should have comment or be unexported (golint)
    • Line 283: warning: exported method FakeServiceControl.CreateServices should have comment or be unexported (golint)
    • Line 297: warning: exported method FakeServiceControl.CreateServicesWithControllerRef should have comment or be unexported (golint)
    • caffe2-operator/pkg/util/k8sutil/k8sutil.go
    • Line 34: warning: exported const RecommendedConfigPathEnvVar should have comment or be unexported (golint)
    • Line 42: warning: exported function MustNewKubeClient should have comment or be unexported (golint)
    • Line 50: warning: exported function MustNewApiExtensionsClient should have comment or be unexported (golint)
    • Line 58: warning: comment on exported function GetClusterConfig should be of the form "GetClusterConfig ..." (golint)
    • Line 88: warning: exported function IsKubernetesResourceAlreadyExistError should have comment or be unexported (golint)
    • Line 92: warning: exported function IsKubernetesResourceNotFoundError should have comment or be unexported (golint)
    • Line 96: warning: comment on exported function JobListOpt should be of the form "JobListOpt ..." (golint)
    • Line 103: warning: exported function LabelsForJob should have comment or be unexported (golint)
    • Line 110: warning: comment on exported function CascadeDeleteOptions should be of the form "CascadeDeleteOptions ..." (golint)
    • caffe2-operator/pkg/controller/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)
    • caffe2-operator/pkg/apis/caffe2/v1alpha1/zz_generated.deepcopy.go
    • Line 125: 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 177: 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)
    • caffe2-operator/pkg/controller/controller.go
    • Line 59: warning: exported var ErrVersionOutdated should have comment or be unexported (golint)
    • Line 80: warning: exported type ControllerConfiguration should have comment or be unexported (golint)
    • Line 89: warning: exported type Controller should have comment or be unexported (golint)
    • Line 135: warning: exported function New should have comment or be unexported (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!