Preparing report...

Report for github.com/spotify/flink-on-k8s-operator

A+    Excellent!    Found 18 issues across 35 files

Tweet

gofmt97%

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!


gocyclo80%

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.

    • flink-on-k8s-operator/controllers/flinkcluster_updater.go
    • Line 190: warning: cyclomatic complexity 147 of function (*ClusterStatusUpdater).deriveClusterStatus() is high (> 15) (gocyclo)
    • Line 699: warning: cyclomatic complexity 32 of function (*ClusterStatusUpdater).deriveJobStatus() is high (> 15) (gocyclo)
    • Line 802: warning: cyclomatic complexity 21 of function (*ClusterStatusUpdater).isStatusChanged() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 20 of function (*ClusterStatusUpdater).createStatusChangeEvents() is high (> 15) (gocyclo)
    • flink-on-k8s-operator/api/v1beta1/zz_generated.deepcopy.go
    • Line 577: warning: cyclomatic complexity 25 of function (*JobSpec).DeepCopyInto() is high (> 15) (gocyclo)
    • Line 466: warning: cyclomatic complexity 25 of function (*JobManagerSpec).DeepCopyInto() is high (> 15) (gocyclo)
    • Line 782: warning: cyclomatic complexity 23 of function (*TaskManagerSpec).DeepCopyInto() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 16 of function (*FlinkClusterSpec).DeepCopyInto() is high (> 15) (gocyclo)

golint68%

Golint is a linter for Go source code.

    • flink-on-k8s-operator/controllers/flink/client.go
    • Line 79: warning: exported type JobException should have comment or be unexported (golint)
    • Line 84: warning: exported type JobExceptions should have comment or be unexported (golint)
    • Line 103: warning: exported type JobByStartTime should have comment or be unexported (golint)
    • Line 139: warning: exported method SavepointStatus.IsSuccessful should have comment or be unexported (golint)
    • Line 143: warning: exported method SavepointStatus.IsFailed should have comment or be unexported (golint)
    • Line 147: warning: exported method Client.GetJobsOverview should have comment or be unexported (golint)
    • Line 292: warning: exported method Client.TakeSavepointAsync should have comment or be unexported (golint)
    • Line 301: warning: exported method Client.GetJobExceptions should have comment or be unexported (golint)
    • Line 316: warning: exported function NewDefaultClient should have comment or be unexported (golint)
    • Line 320: warning: exported function NewClient should have comment or be unexported (golint)
    • flink-on-k8s-operator/controllers/flinkcluster_util.go
    • Line 41: warning: exported const ControlSavepointTriggerID should have comment (or a comment on this block) or be unexported (golint)
    • Line 50: warning: comment on exported const SavepointAgeForJobUpdateSec should be of the form "SavepointAgeForJobUpdateSec ..." (golint)
    • Line 55: warning: exported type UpdateState should have comment or be unexported (golint)
    • Line 58: warning: exported const UpdateStatePreparing should have comment (or a comment on this block) or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign85%

IneffAssign detects ineffectual assignments in Go code.

    • flink-on-k8s-operator/api/v1alpha1/flinkcluster_webhook.go
    • Line 52: warning: cannot use &(FlinkCluster literal) (value of type *FlinkCluster) as admission.Defaulter value in variable declaration: missing method DeepCopyObject (ineffassign)
    • Line 68: warning: cannot use &(FlinkCluster literal) (value of type *FlinkCluster) as admission.Validator value in variable declaration: missing method DeepCopyObject (ineffassign)
    • Line 34: warning: cannot use cluster (variable of type *FlinkCluster) as runtime.Object value in argument to ctrl.NewWebhookManagedBy(mgr).For: missing method DeepCopyObject (ineffassign)
    • Line 82: warning: old (variable of type runtime.Object) cannot have dynamic type *FlinkCluster (missing method DeepCopyObject) (ineffassign)
    • flink-on-k8s-operator/api/v1alpha1/flinkcluster_types.go
    • Line 474: warning: cannot use &(FlinkCluster literal) (value of type *FlinkCluster) as runtime.Object value in argument to SchemeBuilder.Register: missing method DeepCopyObject (ineffassign)
    • Line 474: warning: cannot use &(FlinkClusterList literal) (value of type *FlinkClusterList) as runtime.Object value in argument to SchemeBuilder.Register: missing method DeepCopyObject (ineffassign)
    • flink-on-k8s-operator/api/v1alpha1/flinkcluster_validate.go
    • Line 109: warning: oldCopy.Spec undefined (type *"k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta has no field or method Spec) (ineffassign)
    • Line 110: warning: oldCopy.Spec undefined (type *"k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta has no field or method Spec) (ineffassign)
    • Line 140: warning: oldCopy.Spec undefined (type *"k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta has no field or method Spec) (ineffassign)
    • Line 141: warning: oldCopy.Spec undefined (type *"k8s.io/apimachinery/pkg/apis/meta/v1".ObjectMeta has no field or method Spec) (ineffassign)

misspell91%

Misspell Finds commonly misspelled English words