Preparing report...

Report for github.com/ovh/utask

A+    Excellent!    Found 31 issues across 91 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!


gocyclo83%

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.

    • utask/engine/engine.go
    • Line 379: warning: cyclomatic complexity 37 of function resolve() is high (> 15) (gocyclo)
    • Line 868: warning: cyclomatic complexity 30 of function availableSteps() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 23 of function initialize() is high (> 15) (gocyclo)
    • Line 641: warning: cyclomatic complexity 16 of function runAvailableSteps() is high (> 15) (gocyclo)
    • utask/engine/step/step.go
    • Line 552: warning: cyclomatic complexity 33 of function (*Step).ValidAndNormalize() is high (> 15) (gocyclo)
    • Line 198: warning: cyclomatic complexity 22 of function (*Step).generateExecution() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 22 of function Run() is high (> 15) (gocyclo)
    • utask/api/handler/resolution.go
    • Line 210: warning: cyclomatic complexity 18 of function UpdateResolution() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 16 of function UpdateResolutionStepState() is high (> 15) (gocyclo)
    • utask/api/handler/task.go
    • Line 247: warning: cyclomatic complexity 23 of function UpdateTask() is high (> 15) (gocyclo)
    • Line 102: warning: cyclomatic complexity 17 of function ListTasks() is high (> 15) (gocyclo)

golint84%

Golint is a linter for Go source code.

    • utask/pkg/plugins/builtin/scriptutil/scriptutil.go
    • Line 13: warning: exported const OutputModeAutoResult should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function ValidateExitCodesUnreachable should have comment or be unexported (golint)
    • Line 54: warning: exported function FormatErrorExitCode should have comment or be unexported (golint)
    • Line 91: warning: exported function GenerateOutputDelimitersRegexp should have comment or be unexported (golint)
    • Line 95: warning: exported function ParseOutput should have comment or be unexported (golint)
    • utask/models/task/task.go
    • Line 559: warning: exported method Task.SetTags should have comment or be unexported (golint)
    • Line 646: warning: exported method Task.NotifyValidationRequired should have comment or be unexported (golint)
    • Line 671: warning: exported method Task.NotifyStepState should have comment or be unexported (golint)
    • utask/pkg/metadata/metadata.go
    • Line 6: warning: exported const ActionMetadataKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported function AddActionMetadata should have comment or be unexported (golint)
    • Line 33: warning: exported function GetActionMetadata should have comment or be unexported (golint)
    • Line 46: warning: exported function SetSUDO should have comment or be unexported (golint)
    • Line 50: warning: exported function IsSUDO should have comment or be unexported (golint)
    • utask/examples/plugins/init/auth.go
    • Line 14: warning: exported var Plugin should have comment or be unexported (golint)
    • Line 16: warning: exported type SillyAuth should have comment or be unexported (golint)
    • Line 18: warning: exported function NewSillyAuth should have comment or be unexported (golint)
    • Line 39: warning: exported method SillyAuth.Description should have comment or be unexported (golint)
    • utask/pkg/plugins/builtin/httputil/httputil.go
    • Line 117: warning: exported function GetTransport should have comment or be unexported (golint)
    • Line 129: warning: exported function WithTLSInsecureSkipVerify should have comment or be unexported (golint)
    • Line 140: warning: exported function WithTLSClientAuth should have comment or be unexported (golint)
    • utask/engine/step/executor/executor.go
    • Line 19: warning: exported type InnerExecutor should have comment or be unexported (golint)
    • Line 21: warning: exported method Executor.UnmarshalJSON should have comment or be unexported (golint)
    • Line 41: warning: comment on exported type OutputStrategy should be of the form "OutputStrategy ..." (with optional leading article) (golint)
    • Line 46: warning: exported const OutputStrategynone should have comment (or a comment on this block) or be unexported (golint)
    • Line 51: warning: exported type Output should have comment or be unexported (golint)
    • utask/engine/step/step.go
    • Line 198: warning: context.Context should be the first parameter of a function (golint)
    • Line 327: warning: context.Context should be the first parameter of a function (golint)
    • Line 807: warning: exported method Step.CheckIfValidState should have comment or be unexported (golint)
    • utask/api/server.go
    • Line 89: warning: comment on exported method Server.SetMaxBodyBytes should be of the form "SetMaxBodyBytes ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell96%

Misspell Finds commonly misspelled English words