Preparing report...

Report for github.com/pzl/usb

A+    Excellent!    Found 15 issues across 27 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!


gocyclo88%

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.

    • usb/ids.go
    • Line 24: warning: cyclomatic complexity 22 of function createIDMap() is high (> 15) (gocyclo)

golint51%

Golint is a linter for Go source code.

    • usb/backing.go
    • Line 5: warning: exported var ErrNotImplemented should have comment or be unexported (golint)
    • usb/backing_sysfs.go
    • Line 34: 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 57: 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 121: 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)
    • usb/gusb/ioctl.go
    • Line 12: warning: comment on exported function Ioctl should be of the form "Ioctl ..." (golint)
    • Line 41: warning: comment on exported function Ioctlnum should be of the form "Ioctlnum ..." (golint)
    • usb/gusb/usbDeviceFS.go
    • Line 7: warning: exported type CtrlTransfer should have comment or be unexported (golint)
    • Line 18: warning: exported type BulkTransfer should have comment or be unexported (golint)
    • Line 26: warning: exported type SetInterface should have comment or be unexported (golint)
    • Line 31: warning: comment on exported type DisconnectSignal should be of the form "DisconnectSignal ..." (with optional leading article) (golint)
    • Line 38: warning: exported const MAXDRIVERNAME should have comment or be unexported (golint)
    • Line 40: warning: exported type GetDriverS should have comment or be unexported (golint)
    • Line 45: warning: exported type ConnectInfo should have comment or be unexported (golint)
    • Line 50: warning: comment on exported type URB should be of the form "URB ..." (with optional leading article) (golint)
    • Line 72: warning: exported type IoctlPacket should have comment or be unexported (golint)
    • Line 78: warning: exported type HubPortinfo should have comment or be unexported (golint)
    • Line 83: warning: exported type DisconnectClaim should have comment or be unexported (golint)
    • Line 89: warning: exported type Streams should have comment or be unexported (golint)
    • Line 95: warning: exported type DeviceSpeed should have comment or be unexported (golint)
    • Line 98: warning: exported const SpeedUnknown should have comment (or a comment on this block) or be unexported (golint)
    • usb/gusb/operations.go
    • Line 13: warning: exported function Claim should have comment or be unexported (golint)
    • Line 30: warning: exported function Release should have comment or be unexported (golint)
    • Line 45: warning: exported function GetDriver should have comment or be unexported (golint)
    • Line 60: warning: exported function GetSpeed should have comment or be unexported (golint)
    • usb/gusb/walk.go
    • Line 17: warning: exported type DevicePath should have comment or be unexported (golint)
    • Line 28: warning: exported function Walk should have comment or be unexported (golint)
    • Line 46: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 142: warning: exported function ParseDescriptor should have comment or be unexported (golint)
    • usb/device.go
    • Line 18: warning: exported var ErrDeviceNotFound should have comment or be unexported (golint)
    • Line 21: warning: exported type ID should have comment or be unexported (golint)
    • Line 27: warning: exported method ID.Name should have comment or be unexported (golint)
    • Line 30: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 35: warning: exported type Device should have comment or be unexported (golint)
    • Line 52: warning: exported function List should have comment or be unexported (golint)
    • Line 66: warning: exported function Open should have comment or be unexported (golint)
    • Line 89: warning: exported function VidPid should have comment or be unexported (golint)
    • Line 105: warning: exported method Device.Open should have comment or be unexported (golint)
    • Line 118: warning: exported method Device.Close should have comment or be unexported (golint)
    • Line 127: warning: exported method Device.Interface should have comment or be unexported (golint)
    • Line 139: warning: comment on exported method Device.Endpoint should be of the form "Endpoint ..." (golint)
    • Line 147: warning: exported method Device.SetConfiguration should have comment or be unexported (golint)
    • Line 154: warning: exported method Device.ClaimInterface should have comment or be unexported (golint)
    • Line 161: warning: exported method Device.ReleaseInterface should have comment or be unexported (golint)
    • Line 168: warning: exported method Device.Reset should have comment or be unexported (golint)
    • Line 172: warning: exported method Device.GetDriver should have comment or be unexported (golint)
    • Line 180: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 191: warning: exported type Speed should have comment or be unexported (golint)
    • Line 194: warning: exported const SpeedUnknown should have comment (or a comment on this block) or be unexported (golint)
    • usb/endpoint.go
    • Line 3: warning: exported type Endpoint should have comment or be unexported (golint)
    • Line 14: warning: exported method Endpoint.CtrlTransfer should have comment or be unexported (golint)
    • Line 18: warning: exported method Endpoint.Bulk should have comment or be unexported (golint)
    • Line 22: warning: exported method Endpoint.Interrupt should have comment or be unexported (golint)
    • usb/interface.go
    • Line 3: warning: exported type Interface should have comment or be unexported (golint)
    • Line 12: warning: comment on exported method Interface.Claim should be of the form "Claim ..." (golint)
    • Line 15: warning: comment on exported method Interface.Release should be of the form "Release ..." (golint)
    • Line 18: warning: exported method Interface.SetAlt should have comment or be unexported (golint)
    • Line 22: warning: exported method Interface.GetDriver should have comment or be unexported (golint)
    • usb/gusb/descriptors.go
    • Line 18: warning: exported type DescriptorRange should have comment or be unexported (golint)
    • Line 29: warning: exported type DT should have comment or be unexported (golint)
    • Line 97: warning: exported type USBClass should have comment or be unexported (golint)
    • Line 148: warning: exported type USBSubClass should have comment or be unexported (golint)
    • Line 167: warning: exported type USBProtocolDesc should have comment or be unexported (golint)
    • Line 197: warning: comment on exported type DescHeader should be of the form "DescHeader ..." (with optional leading article) (golint)
    • Line 203: warning: comment on exported type DescClasses should be of the form "DescClasses ..." (with optional leading article) (golint)
    • Line 251: warning: comment on exported type DeviceDescriptor should be of the form "DeviceDescriptor ..." (with optional leading article) (golint)
    • Line 272: warning: exported function NewDevice should have comment or be unexported (golint)
    • Line 313: warning: comment on exported type StringDescriptor should be of the form "StringDescriptor ..." (with optional leading article) (golint)
    • Line 320: warning: exported function NewString should have comment or be unexported (golint)
    • Line 338: warning: comment on exported type EndpointDescriptor should be of the form "EndpointDescriptor ..." (with optional leading article) (golint)
    • Line 353: warning: exported function NewEndpoint should have comment or be unexported (golint)
    • Line 389: warning: exported type TransferType should have comment or be unexported (golint)
    • Line 392: warning: exported const EndpointTypeControl should have comment (or a comment on this block) or be unexported (golint)
    • Line 403: warning: exported type ISOSyncType should have comment or be unexported (golint)
    • Line 406: warning: exported const ISOSyncTypeNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 412: warning: exported type ISOSyncMode should have comment or be unexported (golint)
    • Line 415: warning: exported const ISOUsageData should have comment (or a comment on this block) or be unexported (golint)
    • Line 420: warning: exported type EndpointDirection should have comment or be unexported (golint)
    • Line 423: warning: exported const EndpointDirOUT should have comment (or a comment on this block) or be unexported (golint)
    • Line 430: warning: exported type EndpointAddress should have comment or be unexported (golint)
    • Line 432: warning: exported method EndpointAddress.Dir should have comment or be unexported (golint)
    • Line 433: warning: exported method EndpointAddress.Num should have comment or be unexported (golint)
    • Line 445: warning: comment on exported type InterfaceDescriptor should be of the form "InterfaceDescriptor ..." (with optional leading article) (golint)
    • Line 457: warning: exported function NewInterface should have comment or be unexported (golint)
    • Line 494: warning: comment on exported type ConfigDescriptor should be of the form "ConfigDescriptor ..." (with optional leading article) (golint)
    • Line 510: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 547: warning: comment on exported type DevQualifierDescriptor should be of the form "DevQualifierDescriptor ..." (with optional leading article) (golint)
    • Line 557: warning: exported function NewDevQualifier should have comment or be unexported (golint)
    • Line 583: warning: exported type USBVer should have comment or be unexported (golint)
    • Line 589: warning: exported type USBID 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!