Preparing report...

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

A+    Excellent!    Found 41 issues across 74 files

Tweet

gofmt95%

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!


gocyclo97%

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.


golint48%

Golint is a linter for Go source code.

    • device-sdk-go/internal/cache/devices.go
    • Line 21: warning: exported type DeviceCache should have comment or be unexported (golint)
    • Line 142: warning: exported function CheckProfileNotUsed should have comment or be unexported (golint)
    • Line 152: warning: exported function Devices should have comment or be unexported (golint)
    • device-sdk-go/pkg/service/service.go
    • Line 9: warning: package comment should be of the form "Package service ..." (golint)
    • Line 60: warning: exported type DeviceService should have comment or be unexported (golint)
    • Line 82: warning: exported method DeviceService.Initialize should have comment or be unexported (golint)
    • Line 112: warning: exported method DeviceService.UpdateFromContainer should have comment or be unexported (golint)
    • Line 141: warning: exported method DeviceService.DeviceDiscovery should have comment or be unexported (golint)
    • device-sdk-go/internal/common/utils.go
    • Line 27: warning: exported function UpdateLastConnected should have comment or be unexported (golint)
    • Line 41: warning: exported function UpdateOperatingState should have comment or be unexported (golint)
    • Line 54: warning: exported function SendEvent should have comment or be unexported (golint)
    • device-sdk-go/internal/controller/http/restrouter.go
    • Line 29: warning: exported type RestController should have comment or be unexported (golint)
    • Line 36: warning: exported function NewRestController should have comment or be unexported (golint)
    • Line 46: warning: exported method RestController.InitRestRoutes should have comment or be unexported (golint)
    • Line 79: warning: exported method RestController.AddRoute should have comment or be unexported (golint)
    • Line 90: warning: exported method RestController.Router should have comment or be unexported (golint)
    • device-sdk-go/internal/telemetry/telemetry.go
    • Line 26: warning: comment on exported type SystemUsage should be of the form "SystemUsage ..." (with optional leading article) (golint)
    • Line 43: warning: exported type CpuUsage should have comment or be unexported (golint)
    • Line 53: warning: exported function NewSystemUsage should have comment or be unexported (golint)
    • Line 76: warning: context.Context should be the first parameter of a function (golint)
    • Line 76: warning: exported function StartCpuUsageAverage should have comment or be unexported (golint)
    • device-sdk-go/internal/application/command.go
    • Line 33: warning: exported type CommandProcessor should have comment or be unexported (golint)
    • Line 42: warning: exported function NewCommandProcessor should have comment or be unexported (golint)
    • Line 56: warning: exported function CommandHandler should have comment or be unexported (golint)
    • Line 102: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 108: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 114: warning: exported method CommandProcessor.ReadDeviceResource should have comment or be unexported (golint)
    • Line 161: warning: exported method CommandProcessor.ReadDeviceCommand should have comment or be unexported (golint)
    • Line 221: warning: exported method CommandProcessor.WriteDeviceResource should have comment or be unexported (golint)
    • Line 285: warning: exported method CommandProcessor.WriteDeviceCommand should have comment or be unexported (golint)
    • device-sdk-go/internal/controller/http/callback.go
    • Line 22: warning: exported method RestController.DeleteDevice should have comment or be unexported (golint)
    • Line 35: warning: exported method RestController.AddDevice should have comment or be unexported (golint)
    • Line 56: warning: exported method RestController.UpdateDevice should have comment or be unexported (golint)
    • Line 77: warning: exported method RestController.UpdateProfile should have comment or be unexported (golint)
    • Line 99: warning: exported method RestController.DeleteProvisionWatcher should have comment or be unexported (golint)
    • Line 112: warning: exported method RestController.AddProvisionWatcher should have comment or be unexported (golint)
    • Line 133: warning: exported method RestController.UpdateProvisionWatcher should have comment or be unexported (golint)
    • Line 154: warning: exported method RestController.UpdateDeviceService should have comment or be unexported (golint)
    • device-sdk-go/internal/application/callback.go
    • Line 25: warning: exported function UpdateProfile should have comment or be unexported (golint)
    • Line 42: warning: exported function AddDevice should have comment or be unexported (golint)
    • Line 72: warning: exported function UpdateDevice should have comment or be unexported (golint)
    • Line 84: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 121: warning: exported function DeleteDevice should have comment or be unexported (golint)
    • Line 165: warning: exported function AddProvisionWatcher should have comment or be unexported (golint)
    • Line 178: warning: exported function UpdateProvisionWatcher should have comment or be unexported (golint)
    • Line 189: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 210: warning: exported function DeleteProvisionWatcher should have comment or be unexported (golint)
    • Line 221: warning: exported function UpdateDeviceService 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!


misspell98%

Misspell Finds commonly misspelled English words

    • device-sdk-go/pkg/models/commandvalue.go
    • Line 81: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 96: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 111: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 126: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 141: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 156: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 171: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 186: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 201: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 216: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 231: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 246: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 261: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 276: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 291: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 306: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 321: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 336: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 351: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 366: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 381: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 396: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 411: warning: "transfrom" is a misspelling of "transform" (misspell)
    • Line 426: warning: "transfrom" is a misspelling of "transform" (misspell)