Preparing report...

Report for github.com/edgexfoundry/device-virtual-go

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


gocyclo58%

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.

    • device-virtual-go/internal/driver/virtualdevice_test.go
    • Line 337: warning: cyclomatic complexity 19 of function ValueIntxArray() is high (> 15) (gocyclo)
    • Line 475: warning: cyclomatic complexity 18 of function ValueUintxArray() is high (> 15) (gocyclo)
    • Line 267: warning: cyclomatic complexity 18 of function ValueIntx() is high (> 15) (gocyclo)
    • Line 608: warning: cyclomatic complexity 18 of function ValueFloatxArray() is high (> 15) (gocyclo)
    • Line 409: warning: cyclomatic complexity 17 of function ValueUintx() is high (> 15) (gocyclo)
    • Line 543: warning: cyclomatic complexity 17 of function ValueFloatx() is high (> 15) (gocyclo)

golint41%

Golint is a linter for Go source code.

    • device-virtual-go/internal/driver/db.go
    • Line 52: 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 71: 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)
    • device-virtual-go/internal/driver/resourcefloat.go
    • Line 76: 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 82: 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)
    • device-virtual-go/internal/driver/resourceint.go
    • Line 96: 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 102: 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 108: 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 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)
    • device-virtual-go/internal/driver/helper.go
    • Line 22: 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 77: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 103: 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 149: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 157: 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)
    • device-virtual-go/internal/driver/resourcebool.go
    • Line 55: 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 61: 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)
    • device-virtual-go/internal/driver/resourceuint.go
    • Line 94: 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 100: 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 106: 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 112: 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)
    • device-virtual-go/internal/driver/virtualdriver.go
    • Line 7: warning: package comment should be of the form "Package driver ..." (golint)
    • Line 22: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 25: warning: exported type VirtualDriver should have comment or be unexported (golint)
    • Line 37: warning: exported function NewVirtualDeviceDriver should have comment or be unexported (golint)
    • Line 54: warning: exported method VirtualDriver.Initialize should have comment or be unexported (golint)
    • Line 81: warning: exported method VirtualDriver.HandleReadCommands should have comment or be unexported (golint)
    • Line 98: 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 109: warning: exported method VirtualDriver.HandleWriteCommands should have comment or be unexported (golint)
    • Line 129: warning: exported method VirtualDriver.Stop should have comment or be unexported (golint)
    • Line 137: warning: exported method VirtualDriver.AddDevice should have comment or be unexported (golint)
    • Line 143: warning: exported method VirtualDriver.UpdateDevice should have comment or be unexported (golint)
    • Line 148: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 153: warning: exported method VirtualDriver.RemoveDevice should have comment or be unexported (golint)
    • Line 223: 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)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!