Preparing report...

Report for github.com/hashicorp/packer

(v1.10.3)

A+    Excellent!    Found 54 issues across 347 files

Tweet

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!


gofmt92%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo91%

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.

    • provisioner/powershell/provisioner.go
    • Line 131: warning: cyclomatic complexity 31 of function (*Provisioner).Prepare() is high (> 15) (gocyclo)
    • Line 418: warning: cyclomatic complexity 16 of function (*Provisioner).createFlattenedEnvVars() is high (> 15) (gocyclo)
    • Line 273: warning: cyclomatic complexity 16 of function (*Provisioner).Provision() is high (> 15) (gocyclo)
    • main.go
    • Line 130: warning: cyclomatic complexity 17 of function wrappedMain() is high (> 15) (gocyclo)
    • command/build.go
    • Line 88: warning: cyclomatic complexity 36 of function (*BuildCommand).RunContext() is high (> 15) (gocyclo)
    • provisioner/shell/provisioner.go
    • Line 183: warning: cyclomatic complexity 34 of function (*Provisioner).Provision() is high (> 15) (gocyclo)
    • Line 79: warning: cyclomatic complexity 29 of function (*Provisioner).Prepare() is high (> 15) (gocyclo)
    • hcl2template/shim/values.go
    • Line 93: warning: cyclomatic complexity 27 of function WriteUnknownPlaceholderValues() is high (> 15) (gocyclo)
    • Line 21: warning: cyclomatic complexity 17 of function ConfigValueFromHCL2() is high (> 15) (gocyclo)
    • hcl2template/types.variables.go
    • Line 564: warning: cyclomatic complexity 21 of function (*PackerConfig).collectInputVariableValues() is high (> 15) (gocyclo)
    • Line 312: warning: cyclomatic complexity 17 of function (*Variables).decodeVariableBlock() is high (> 15) (gocyclo)
    • packer/core.go
    • Line 347: warning: cyclomatic complexity 24 of function (*Core).Build() is high (> 15) (gocyclo)
    • Line 559: warning: cyclomatic complexity 22 of function (*Core).InspectConfig() is high (> 15) (gocyclo)
    • Line 810: warning: cyclomatic complexity 17 of function (*Core).renderVarsRecursively() is high (> 15) (gocyclo)
    • command/hcl2_upgrade.go
    • Line 680: warning: cyclomatic complexity 19 of function jsonBodyToHCL2Body() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 19 of function transposeTemplatingCalls() is high (> 15) (gocyclo)
    • Line 156: warning: cyclomatic complexity 17 of function (*HCL2UpgradeCommand).RunContext() is high (> 15) (gocyclo)
    • command/build_test.go
    • Line 1119: warning: cyclomatic complexity 22 of function TestProvisionerAndPostProcessorOnlyExcept() is high (> 15) (gocyclo)
    • Line 1250: warning: cyclomatic complexity 16 of function TestBuildCmd() is high (> 15) (gocyclo)
    • packer/build.go
    • Line 224: warning: cyclomatic complexity 32 of function (*CoreBuild).Run() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!