Preparing report...

Report for github.com/rlj1202/go-wpd

A    Great!    Found 13 issues across 13 files

Tweet

gofmt92%

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!


gocyclo69%

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.

    • go-wpd/consts.go
    • Line 65: warning: cyclomatic complexity 34 of function (GUID).toCGUID() is high (> 15) (gocyclo)
    • Line 136: warning: cyclomatic complexity 28 of function (PropertyKey).toCPropertyKey() is high (> 15) (gocyclo)
    • Line 11: warning: cyclomatic complexity 16 of function (HRESULT).String() is high (> 15) (gocyclo)

golint61%

Golint is a linter for Go source code.

    • go-wpd/gen/genconst.go
    • Line 14: warning: comment on exported type Consts should be of the form "Consts ..." (with optional leading article) (golint)
    • go-wpd/file.go
    • Line 12: warning: exported function SHCreateStreamOnFile should have comment or be unexported (golint)
    • go-wpd/gowpd.go
    • Line 1: warning: package comment should be of the form "Package gowpd ..." (golint)
    • Line 52: warning: exported const CLSCTX_INPROC_SERVER should have comment (or a comment on this block) or be unexported (golint)
    • Line 79: warning: don't use underscores in Go names; const S_OK should be SOK (golint)
    • Line 79: warning: exported const S_OK should have comment (or a comment on this block) or be unexported (golint)
    • Line 101: warning: don't use underscores in Go names; const CLSID_PortableDevice should be CLSIDPortableDevice (golint)
    • Line 101: warning: exported const CLSID_PortableDevice should have comment (or a comment on this block) or be unexported (golint)
    • Line 102: warning: don't use underscores in Go names; const CLSID_PortableDeviceFTM should be CLSIDPortableDeviceFTM (golint)
    • Line 103: warning: don't use underscores in Go names; const CLSID_PortableDeviceManager should be CLSIDPortableDeviceManager (golint)
    • Line 104: warning: don't use underscores in Go names; const CLSID_PortableDeviceKeyCollection should be CLSIDPortableDeviceKeyCollection (golint)
    • Line 105: warning: don't use underscores in Go names; const CLSID_PortableDeviceValues should be CLSIDPortableDeviceValues (golint)
    • Line 106: warning: don't use underscores in Go names; const CLSID_PortableDevicePropVariantCollection should be CLSIDPortableDevicePropVariantCollection (golint)
    • Line 110: warning: don't use underscores in Go names; const IID_IPortableDevice should be IIDIPortableDevice (golint)
    • Line 110: warning: exported const IID_IPortableDevice should have comment (or a comment on this block) or be unexported (golint)
    • Line 111: warning: don't use underscores in Go names; const IID_IPortableDeviceManager should be IIDIPortableDeviceManager (golint)
    • Line 112: warning: don't use underscores in Go names; const IID_IPortableDeviceKeyCollection should be IIDIPortableDeviceKeyCollection (golint)
    • Line 113: warning: don't use underscores in Go names; const IID_IPortableDeviceContent should be IIDIPortableDeviceContent (golint)
    • Line 114: warning: don't use underscores in Go names; const IID_IPortableDeviceProperties should be IIDIPortableDeviceProperties (golint)
    • Line 115: warning: don't use underscores in Go names; const IID_IPortableDeviceValues should be IIDIPortableDeviceValues (golint)
    • Line 116: warning: don't use underscores in Go names; const IID_IPortableDeviceDataStream should be IIDIPortableDeviceDataStream (golint)
    • Line 117: warning: don't use underscores in Go names; const IID_IPortableDevicePropVariantCollection should be IIDIPortableDevicePropVariantCollection (golint)
    • Line 121: warning: exported const WPD_CLIENT_NAME should have comment (or a comment on this block) or be unexported (golint)
    • Line 153: warning: exported const WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT should have comment (or a comment on this block) or be unexported (golint)
    • Line 189: warning: exported const WPD_DEVICE_OBJECT_ID should have comment (or a comment on this block) or be unexported (golint)
    • Line 193: warning: exported const GENERIC_READ should have comment (or a comment on this block) or be unexported (golint)
    • Line 200: warning: exported const STATFLAG_DEFAULT should have comment (or a comment on this block) or be unexported (golint)
    • Line 206: warning: exported const STGM_READ should have comment (or a comment on this block) or be unexported (golint)
    • Line 212: warning: exported const VT_EMPTY should have comment (or a comment on this block) or be unexported (golint)
    • Line 267: warning: exported const PORTABLE_DEVICE_DELETE_NO_RECURSION should have comment (or a comment on this block) or be unexported (golint)
    • Line 271: warning: comment on exported type WCHAR should be of the form "WCHAR ..." (with optional leading article) (golint)
    • Line 275: warning: comment on exported type HRESULT should be of the form "HRESULT ..." (with optional leading article) (golint)
    • Line 278: warning: comment on exported type DWORD should be of the form "DWORD ..." (with optional leading article) (golint)
    • Line 281: warning: comment on exported type ULONG should be of the form "ULONG ..." (with optional leading article) (golint)
    • Line 284: warning: comment on exported type PnPDeviceID should be of the form "PnPDeviceID ..." (with optional leading article) (golint)
    • Line 287: warning: comment on exported type CLSCTX should be of the form "CLSCTX ..." (with optional leading article) (golint)
    • Line 290: warning: comment on exported type CLSID should be of the form "CLSID ..." (with optional leading article) (golint)
    • Line 293: warning: comment on exported type IID should be of the form "IID ..." (with optional leading article) (golint)
    • Line 296: warning: comment on exported type PropertyKey should be of the form "PropertyKey ..." (with optional leading article) (golint)
    • Line 299: warning: comment on exported type GUID should be of the form "GUID ..." (with optional leading article) (golint)
    • Line 302: warning: comment on exported type VARTYPE should be of the form "VARTYPE ..." (with optional leading article) (golint)
    • Line 305: warning: exported type IPortableDevice should have comment or be unexported (golint)
    • Line 306: warning: exported type IPortableDeviceValues should have comment or be unexported (golint)
    • Line 307: warning: exported type IPortableDeviceManager should have comment or be unexported (golint)
    • Line 308: warning: exported type IPortableDeviceContent should have comment or be unexported (golint)
    • Line 309: warning: exported type IPortableDeviceKeyCollection should have comment or be unexported (golint)
    • Line 310: warning: exported type IPortableDeviceProperties should have comment or be unexported (golint)
    • Line 311: warning: exported type IPortableDeviceDataStream should have comment or be unexported (golint)
    • Line 312: warning: exported type IPortableDeviceCapabilities should have comment or be unexported (golint)
    • Line 313: warning: exported type IPortableDevicePropVariantCollection should have comment or be unexported (golint)
    • Line 314: warning: exported type IPortableDeviceEventCallback should have comment or be unexported (golint)
    • Line 315: warning: exported type IPortableDeviceResources should have comment or be unexported (golint)
    • Line 316: warning: exported type IStream should have comment or be unexported (golint)
    • Line 317: warning: exported type ISequentialStream should have comment or be unexported (golint)
    • Line 318: warning: exported type IPropertyStore should have comment or be unexported (golint)
    • Line 319: warning: exported type IUnknown should have comment or be unexported (golint)
    • Line 321: warning: exported type IEnumPortableDeviceObjectIDs should have comment or be unexported (golint)
    • Line 323: warning: exported type StatStg should have comment or be unexported (golint)
    • Line 341: warning: exported function Initialize should have comment or be unexported (golint)
    • Line 352: warning: exported function Uninitialize should have comment or be unexported (golint)
    • Line 358: warning: exported function FreeDeviceID should have comment or be unexported (golint)
    • Line 362: warning: exported function CoCreateInstance should have comment or be unexported (golint)
    • Line 376: warning: exported function CreatePortableDevice should have comment or be unexported (golint)
    • Line 384: warning: exported function CreatePortableDeviceValues should have comment or be unexported (golint)
    • Line 392: warning: exported function CreatePortableDeviceManager should have comment or be unexported (golint)
    • Line 400: warning: exported function CreatePortableDeviceKeyCollection should have comment or be unexported (golint)
    • Line 408: warning: exported function CreatePortableDevicePropVariantCollection should have comment or be unexported (golint)
    • Line 416: warning: exported method IPortableDevice.Content should have comment or be unexported (golint)
    • Line 432: warning: exported method IPortableDevice.Open should have comment or be unexported (golint)
    • Line 444: warning: exported method IPortableDevice.Release should have comment or be unexported (golint)
    • Line 454: warning: exported method IPortableDeviceValues.GetBoolValue should have comment or be unexported (golint)
    • Line 468: warning: exported method IPortableDeviceValues.GetStringValue should have comment or be unexported (golint)
    • Line 490: warning: exported method IPortableDeviceValues.GetUnsignedIntegerValue should have comment or be unexported (golint)
    • Line 508: warning: exported method IPortableDeviceValues.SetGuidValue should have comment or be unexported (golint)
    • Line 518: warning: exported method IPortableDeviceValues.SetStringValue should have comment or be unexported (golint)
    • Line 550: warning: exported method IPortableDeviceValues.SetUnsignedIntegerValue should have comment or be unexported (golint)
    • Line 562: warning: exported method IPortableDeviceValues.SetUnsignedLargeIntegerValue should have comment or be unexported (golint)
    • Line 562: warning: receiver name pPortableDeviceValeus should be consistent with previous receiver name pPortableDeviceValues for IPortableDeviceValues (golint)
    • Line 572: warning: exported method IPortableDeviceValues.QueryInterface should have comment or be unexported (golint)
    • Line 578: warning: exported method IPortableDeviceValues.Release should have comment or be unexported (golint)
    • Line 588: warning: exported method IPortableDeviceManager.GetDevices should have comment or be unexported (golint)
    • Line 614: warning: exported method IPortableDeviceManager.GetDeviceFriendlyName should have comment or be unexported (golint)
    • Line 636: warning: exported method IPortableDeviceManager.GetDeviceManufacturer should have comment or be unexported (golint)
    • Line 656: warning: exported method IPortableDeviceManager.GetDeviceDescription should have comment or be unexported (golint)
    • Line 676: warning: exported method IPortableDeviceManager.Release should have comment or be unexported (golint)
    • Line 680: warning: comment on exported method IPortableDeviceContent.CreateObjectWithPropertiesAndData should be of the form "CreateObjectWithPropertiesAndData ..." (golint)
    • Line 699: warning: comment on exported method IPortableDeviceContent.EnumObjects should be of the form "EnumObjects ..." (golint)
    • Line 723: warning: exported method IPortableDeviceContent.Properties should have comment or be unexported (golint)
    • Line 739: warning: exported method IPortableDeviceContent.Transfer should have comment or be unexported (golint)
    • Line 753: warning: exported method IPortableDeviceContent.Delete should have comment or be unexported (golint)
    • Line 772: warning: exported method IPortableDeviceKeyCollection.Add should have comment or be unexported (golint)
    • Line 784: warning: exported method IPortableDeviceProperties.GetValues should have comment or be unexported (golint)
    • Line 804: warning: exported method IPortableDeviceProperties.GetPropertyAttributes should have comment or be unexported (golint)
    • Line 824: warning: comment on exported method IPortableDeviceProperties.SetValues should be of the form "SetValues ..." (golint)
    • Line 851: warning: exported method IPortableDeviceDataStream.Commit should have comment or be unexported (golint)
    • Line 865: warning: exported method IPortableDeviceDataStream.GetObjectID should have comment or be unexported (golint)
    • Line 882: warning: comment on exported method IEnumPortableDeviceObjectIDs.Next should be of the form "Next ..." (golint)
    • Line 922: warning: exported method IPortableDevicePropVariantCollection.Add should have comment or be unexported (golint)
    • Line 932: warning: exported method IPortableDevicePropVariantCollection.GetAt should have comment or be unexported (golint)
    • Line 950: warning: exported method IPortableDevicePropVariantCollection.GetCount should have comment or be unexported (golint)
    • Line 968: warning: exported method IPortableDeviceResources.GetStream should have comment or be unexported (golint)
    • Line 989: warning: exported method IStream.Commit should have comment or be unexported (golint)
    • Line 999: warning: exported method IStream.Stat should have comment or be unexported (golint)
    • Line 1031: warning: exported method IStream.QueryInterface should have comment or be unexported (golint)
    • Line 1097: warning: exported method IUnknown.QueryInterface should have comment or be unexported (golint)
    • go-wpd/utils.go
    • Line 8: warning: comment on exported function GetRequiredPropertiesForAllContentTypes should be of the form "GetRequiredPropertiesForAllContentTypes ..." (golint)
    • Line 38: warning: comment on exported function GetRequiredPropertiesForContentType should be of the form "GetRequiredPropertiesForContentType ..." (golint)
    • Line 79: warning: comment on exported function GetRequiredPropertiesForImageContentTypes should be of the form "GetRequiredPropertiesForImageContentTypes ..." (golint)
    • Line 94: warning: comment on exported function GetRequiredPropertiesForMusicContentTypes should be of the form "GetRequiredPropertiesForMusicContentTypes ..." (golint)
    • Line 109: warning: comment on exported function GetRequiredPropertiesForContactContentTypes should be of the form "GetRequiredPropertiesForContactContentTypes ..." (golint)
    • Line 124: warning: comment on exported function StreamCopy should be of the form "StreamCopy ..." (golint)
    • Line 153: warning: comment on exported function GetStringValue should be of the form "GetStringValue ..." (golint)
    • go-wpd/win.go
    • Line 11: warning: exported type PropVariant should have comment or be unexported (golint)
    • Line 13: warning: exported method PropVariant.GetType should have comment or be unexported (golint)
    • Line 17: warning: exported method PropVariant.GetError should have comment or be unexported (golint)
    • Line 21: warning: exported method PropVariant.Set should have comment or be unexported (golint)
    • Line 39: warning: exported method PropVariant.Init should have comment or be unexported (golint)
    • Line 43: warning: exported method PropVariant.Clear should have comment or be unexported (golint)
    • Line 47: warning: exported function PropTest should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign38%

IneffAssign detects ineffectual assignments in Go code.

    • go-wpd/example_transfer_to_pc_test.go
    • Line 9: warning: undeclared name: gowpd (ineffassign)
    • Line 11: warning: undeclared name: gowpd (ineffassign)
    • Line 21: warning: undeclared name: gowpd (ineffassign)
    • Line 25: warning: undeclared name: gowpd (ineffassign)
    • Line 26: warning: undeclared name: gowpd (ineffassign)
    • Line 27: warning: undeclared name: gowpd (ineffassign)
    • Line 28: warning: undeclared name: gowpd (ineffassign)
    • Line 36: warning: undeclared name: gowpd (ineffassign)
    • Line 52: warning: undeclared name: gowpd (ineffassign)
    • Line 52: warning: undeclared name: gowpd (ineffassign)
    • Line 57: warning: undeclared name: gowpd (ineffassign)
    • Line 57: warning: undeclared name: gowpd (ineffassign)
    • Line 57: warning: undeclared name: gowpd (ineffassign)
    • Line 62: warning: undeclared name: gowpd (ineffassign)
    • Line 74: warning: undeclared name: gowpd (ineffassign)
    • Line 79: warning: undeclared name: gowpd (ineffassign)
    • Line 4: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)
    • go-wpd/gowpd_test.go
    • Line 11: warning: undeclared name: gowpd (ineffassign)
    • Line 13: warning: undeclared name: gowpd (ineffassign)
    • Line 23: warning: undeclared name: gowpd (ineffassign)
    • Line 27: warning: undeclared name: gowpd (ineffassign)
    • Line 28: warning: undeclared name: gowpd (ineffassign)
    • Line 29: warning: undeclared name: gowpd (ineffassign)
    • Line 30: warning: undeclared name: gowpd (ineffassign)
    • Line 52: warning: undeclared name: gowpd (ineffassign)
    • Line 56: warning: undeclared name: gowpd (ineffassign)
    • Line 75: warning: undeclared name: gowpd (ineffassign)
    • Line 81: warning: undeclared name: gowpd (ineffassign)
    • Line 81: warning: undeclared name: gowpd (ineffassign)
    • Line 97: warning: undeclared name: gowpd (ineffassign)
    • Line 101: warning: undeclared name: gowpd (ineffassign)
    • Line 104: warning: undeclared name: gowpd (ineffassign)
    • Line 104: warning: undeclared name: gowpd (ineffassign)
    • Line 121: warning: undeclared name: gowpd (ineffassign)
    • Line 127: warning: undeclared name: gowpd (ineffassign)
    • Line 5: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)
    • go-wpd/win_test.go
    • Line 9: warning: undeclared name: gowpd (ineffassign)
    • Line 4: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)
    • go-wpd/example_content_enumerate_test.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import github.com/rlj1202/go-wpd (invalid package name: "") (ineffassign)
    • Line 8: warning: undeclared name: gowpd (ineffassign)
    • Line 36: warning: undeclared name: gowpd (ineffassign)
    • Line 38: warning: undeclared name: gowpd (ineffassign)
    • Line 43: warning: undeclared name: gowpd (ineffassign)
    • Line 47: warning: undeclared name: gowpd (ineffassign)
    • Line 48: warning: undeclared name: gowpd (ineffassign)
    • Line 49: warning: undeclared name: gowpd (ineffassign)
    • Line 50: warning: undeclared name: gowpd (ineffassign)
    • Line 58: warning: undeclared name: gowpd (ineffassign)
    • Line 73: warning: undeclared name: gowpd (ineffassign)
    • Line 75: warning: undeclared name: gowpd (ineffassign)
    • Line 78: warning: undeclared name: gowpd (ineffassign)
    • Line 4: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)
    • go-wpd/example_delete_from_device_test.go
    • Line 9: warning: undeclared name: gowpd (ineffassign)
    • Line 11: warning: undeclared name: gowpd (ineffassign)
    • Line 21: warning: undeclared name: gowpd (ineffassign)
    • Line 25: warning: undeclared name: gowpd (ineffassign)
    • Line 26: warning: undeclared name: gowpd (ineffassign)
    • Line 27: warning: undeclared name: gowpd (ineffassign)
    • Line 28: warning: undeclared name: gowpd (ineffassign)
    • Line 34: warning: undeclared name: gowpd (ineffassign)
    • Line 49: warning: undeclared name: gowpd (ineffassign)
    • Line 51: warning: undeclared name: gowpd (ineffassign)
    • Line 58: warning: undeclared name: gowpd (ineffassign)
    • Line 70: warning: undeclared name: gowpd (ineffassign)
    • Line 78: warning: undeclared name: gowpd (ineffassign)
    • Line 82: warning: undeclared name: gowpd (ineffassign)
    • Line 4: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)
    • go-wpd/example_transfer_to_device_test.go
    • Line 9: warning: undeclared name: gowpd (ineffassign)
    • Line 11: warning: undeclared name: gowpd (ineffassign)
    • Line 21: warning: undeclared name: gowpd (ineffassign)
    • Line 25: warning: undeclared name: gowpd (ineffassign)
    • Line 26: warning: undeclared name: gowpd (ineffassign)
    • Line 27: warning: undeclared name: gowpd (ineffassign)
    • Line 28: warning: undeclared name: gowpd (ineffassign)
    • Line 41: warning: undeclared name: gowpd (ineffassign)
    • Line 45: warning: undeclared name: gowpd (ineffassign)
    • Line 61: warning: undeclared name: gowpd (ineffassign)
    • Line 67: warning: undeclared name: gowpd (ineffassign)
    • Line 67: warning: undeclared name: gowpd (ineffassign)
    • Line 83: warning: undeclared name: gowpd (ineffassign)
    • Line 87: warning: undeclared name: gowpd (ineffassign)
    • Line 90: warning: undeclared name: gowpd (ineffassign)
    • Line 90: warning: undeclared name: gowpd (ineffassign)
    • Line 107: warning: undeclared name: gowpd (ineffassign)
    • Line 113: warning: undeclared name: gowpd (ineffassign)
    • Line 116: warning: undeclared name: gowpd (ineffassign)
    • Line 4: warning: "github.com/rlj1202/go-wpd" imported but not used (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!