Preparing report...

Report for github.com/nmaupu/freenas-provisioner

(v0.0.0-20210525101339-abce76666274)

A    Great!    Found 7 issues across 7 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!


gocyclo85%

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.

    • freenas-provisioner/provisioner/provisioner.go
    • Line 61: warning: cyclomatic complexity 36 of function (*freenasProvisioner).GetConfig() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 19 of function (*freenasProvisioner).Delete() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 19 of function (*freenasProvisioner).Provision() is high (> 15) (gocyclo)

golint14%

Golint is a linter for Go source code.

    • freenas-provisioner/main.go
    • Line 8: warning: exported const AppName should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported var AppVersion should have comment or be unexported (golint)
    • freenas-provisioner/provisioner/provisioner.go
    • Line 233: warning: exported function New should have comment or be unexported (golint)
    • Line 516: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 529: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 552: warning: exported function BytesToString should have comment or be unexported (golint)
    • Line 556: warning: exported function TruncateString should have comment or be unexported (golint)
    • freenas-provisioner/freenas/dataset.go
    • Line 16: warning: exported type Dataset should have comment or be unexported (golint)
    • Line 31: warning: exported method Dataset.MarshalJSON should have comment or be unexported (golint)
    • Line 79: warning: exported method Dataset.CopyFrom should have comment or be unexported (golint)
    • Line 99: warning: exported method Dataset.Get should have comment or be unexported (golint)
    • Line 112: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 120: warning: exported method Dataset.Create should have comment or be unexported (golint)
    • Line 142: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 150: warning: exported method Dataset.Delete should have comment or be unexported (golint)
    • Line 162: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • freenas-provisioner/freenas/nfs.go
    • Line 14: warning: exported type NfsShare should have comment or be unexported (golint)
    • Line 30: warning: exported method NfsShare.CopyFrom should have comment or be unexported (golint)
    • Line 51: warning: exported method NfsShare.Get should have comment or be unexported (golint)
    • Line 65: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 86: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 100: warning: receiver name s should be consistent with previous receiver name n for NfsShare (golint)
    • Line 110: warning: exported method NfsShare.Create should have comment or be unexported (golint)
    • Line 123: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 131: warning: exported method NfsShare.Delete should have comment or be unexported (golint)
    • Line 143: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • freenas-provisioner/freenas/permission.go
    • Line 10: warning: exported type Permission should have comment or be unexported (golint)
    • Line 18: warning: exported method Permission.Put should have comment or be unexported (golint)
    • Line 30: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • freenas-provisioner/freenas/server.go
    • Line 10: warning: exported type FreenasResource should have comment or be unexported (golint)
    • Line 17: warning: exported type FreenasServer should have comment or be unexported (golint)
    • Line 25: warning: exported function NewFreenasServer 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!


misspell85%

Misspell Finds commonly misspelled English words