Preparing report...

Report for github.com/kubesphere/s2ioperator

A+    Excellent!    Found 25 issues across 82 files

Tweet

gofmt98%

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!


gocyclo93%

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.

    • s2ioperator/pkg/handler/general/general_webhook.go
    • Line 18: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 24: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 30: warning: exported method Trigger.Serve should have comment or be unexported (golint)
    • Line 60: warning: exported method Trigger.Authentication should have comment or be unexported (golint)
    • Line 73: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 78: warning: comment on exported method Trigger.Action should be of the form "Action ..." (golint)
    • Line 92: warning: comment on exported method Trigger.GenerateNewS2Irun should be of the form "GenerateNewS2Irun ..." (golint)
    • s2ioperator/pkg/handler/github/github_hook.go
    • Line 40: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 46: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 52: warning: exported method Trigger.Serve should have comment or be unexported (golint)
    • Line 86: warning: exported method Trigger.ValidateTrigger should have comment or be unexported (golint)
    • Line 124: warning: comment on exported method Trigger.Action should be of the form "Action ..." (golint)
    • Line 153: warning: exported method Trigger.GenerateNewS2Irun should have comment or be unexported (golint)
    • s2ioperator/pkg/handler/gitlab/gitlab_hook.go
    • Line 8: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 14: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 20: warning: exported method Trigger.Serve should have comment or be unexported (golint)
    • Line 24: warning: exported method Trigger.ValidateTrigger should have comment or be unexported (golint)
    • Line 28: warning: exported method Trigger.Action should have comment or be unexported (golint)
    • s2ioperator/pkg/controller/s2irun/s2irun_controller.go
    • Line 50: warning: exported const S2iRunBuilderLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 118: warning: comment on exported method ReconcileS2iRun.Reconcile should be of the form "Reconcile ..." (golint)
    • Line 281: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 380: warning: exported method ReconcileS2iRun.GetLogURL should have comment or be unexported (golint)
    • Line 396: warning: exported function GetNewImageName should have comment or be unexported (golint)
    • Line 399: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 404: warning: exported function GetNewRevisionId should have comment or be unexported (golint)
    • Line 407: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 412: warning: exported function GetNewSourceURL should have comment or be unexported (golint)
    • Line 415: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 587: 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)
    • s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_types.go
    • Line 29: warning: exported type RunState should have comment or be unexported (golint)
    • Line 32: warning: exported const ResourceKindS2iBuilder should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported const NotRunning should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported const AutoScaleAnnotations should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported const KindDeployment should have comment (or a comment on this block) or be unexported (golint)
    • Line 127: warning: exported type PullPolicy should have comment or be unexported (golint)
    • Line 164: warning: exported type TriggerSource should have comment or be unexported (golint)
    • Line 167: warning: exported const Default should have comment (or a comment on this block) or be unexported (golint)
    • Line 212: warning: exported type S2iConfig should have comment or be unexported (golint)
    • Line 433: warning: exported type UserDefineTemplate should have comment or be unexported (golint)
    • Line 491: warning: exported type S2iAutoScale should have comment or be unexported (golint)
    • Line 498: warning: exported type DockerConfigJson should have comment or be unexported (golint)
    • Line 502: warning: comment on exported type DockerConfigMap should be of the form "DockerConfigMap ..." (with optional leading article) (golint)
    • Line 507: warning: exported type DockerConfigEntry should have comment or be unexported (golint)
    • s2ioperator/pkg/apis/devops/v1alpha1/s2irun_types.go
    • Line 27: warning: exported const ResourceKindS2iRun should have comment (or a comment on this block) or be unexported (golint)
    • Line 71: warning: exported type S2iBuildResult should have comment or be unexported (golint)
    • Line 86: warning: exported type S2iBuildSource should have comment or be unexported (golint)
    • s2ioperator/pkg/controller/s2irun/ksbuilder_jobs.go
    • Line 20: warning: exported const ConfigDataKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported method ReconcileS2iRun.NewRegularRole should have comment or be unexported (golint)
    • Line 44: warning: exported method ReconcileS2iRun.NewServiceAccount should have comment or be unexported (golint)
    • Line 54: warning: exported method ReconcileS2iRun.NewRoleBinding should have comment or be unexported (golint)
    • Line 77: warning: exported method ReconcileS2iRun.NewConfigMap should have comment or be unexported (golint)
    • Line 130: warning: exported method ReconcileS2iRun.GenerateNewJob should have comment or be unexported (golint)
    • s2ioperator/pkg/apis/devops/v1alpha1/s2ibuilder_webhook.go
    • Line 36: warning: exported const DefaultRevisionId should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported method S2iBuilder.SetupWebhookWithManager should have comment or be unexported (golint)
    • Line 114: 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 159: 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)
    • s2ioperator/pkg/apis/devops/v1alpha1/s2ibuildertemplate_types.go
    • Line 24: warning: exported const ResourceKindS2iBuilderTemplate should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type Parameter should have comment or be unexported (golint)
    • Line 39: warning: exported method Parameter.ToEnvonment should have comment or be unexported (golint)
    • Line 72: warning: exported type ContainerInfo should have comment or be unexported (golint)
    • s2ioperator/pkg/metrics/metrics.go
    • Line 17: warning: exported var S2iRunActive should have comment or be unexported (golint)
    • Line 57: warning: exported function CollectS2iMetrics should have comment or be unexported (golint)
    • Line 87: warning: comment on exported function SetS2iBuilderMetrics should be of the form "SetS2iBuilderMetrics ..." (golint)
    • Line 99: warning: comment on exported function SetS2iRunMetrics should be of the form "SetS2iRunMetrics ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words