Preparing report...

Report for github.com/plgd-dev/device

A+    Excellent!    Found 54 issues across 88 files

Tweet

gofmt96%

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!


gocyclo98%

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/cmd/ocfclient/main.go
    • Line 44: warning: cyclomatic complexity 53 of function ReadCommandOptions() is high (> 15) (gocyclo)
    • Line 570: warning: cyclomatic complexity 19 of function scanner() is high (> 15) (gocyclo)

golint39%

Golint is a linter for Go source code.

    • device/client/core/updateResource.go
    • Line 12: warning: exported method Device.UpdateResource should have comment or be unexported (golint)
    • Line 23: warning: exported method Device.UpdateResourceWithCodec should have comment or be unexported (golint)
    • device/client/core/observeResource.go
    • Line 15: warning: exported method Device.ObserveResourceWithCodec should have comment or be unexported (golint)
    • Line 25: warning: exported type ObservationHandler should have comment or be unexported (golint)
    • Line 31: warning: exported method Device.ObserveResource should have comment or be unexported (golint)
    • Line 41: warning: exported method Device.StopObservingResource should have comment or be unexported (golint)
    • device/cmd/ocfclient/ocfclient.go
    • Line 16: warning: exported const Timeout should have comment or be unexported (golint)
    • Line 19: warning: comment on exported type OCFClient should be of the form "OCFClient ..." (with optional leading article) (golint)
    • Line 26: warning: exported type SetupSecureClient should have comment or be unexported (golint)
    • Line 32: warning: exported method SetupSecureClient.GetManufacturerCertificate should have comment or be unexported (golint)
    • Line 39: warning: exported method SetupSecureClient.GetManufacturerCertificateAuthorities should have comment or be unexported (golint)
    • Line 46: warning: exported method SetupSecureClient.GetRootCertificateAuthorities should have comment or be unexported (golint)
    • Line 88: warning: comment on exported method OCFClient.GetResources should be of the form "GetResources ..." (golint)
    • Line 107: warning: comment on exported method OCFClient.GetResource should be of the form "GetResource ..." (golint)
    • Line 128: warning: comment on exported method OCFClient.UpdateResource should be of the form "UpdateResource ..." (golint)
    • device/client/core/deleteResource.go
    • Line 12: warning: exported method Device.DeleteResource should have comment or be unexported (golint)
    • Line 22: warning: exported method Device.DeleteResourceWithCodec should have comment or be unexported (golint)
    • device/client/observeDeviceResources.go
    • Line 13: warning: don't use underscores in Go names; type DeviceResourcesObservationEvent_type should be DeviceResourcesObservationEventType (golint)
    • Line 13: warning: exported type DeviceResourcesObservationEvent_type should have comment or be unexported (golint)
    • Line 15: warning: don't use underscores in Go names; const DeviceResourcesObservationEvent_ADDED should be DeviceResourcesObservationEventADDED (golint)
    • Line 15: warning: exported const DeviceResourcesObservationEvent_ADDED should have comment or be unexported (golint)
    • Line 16: warning: don't use underscores in Go names; const DeviceResourcesObservationEvent_REMOVED should be DeviceResourcesObservationEventREMOVED (golint)
    • Line 16: warning: exported const DeviceResourcesObservationEvent_REMOVED should have comment or be unexported (golint)
    • Line 18: warning: exported type DeviceResourcesObservationEvent should have comment or be unexported (golint)
    • Line 23: warning: exported type DeviceResourcesObservationHandler should have comment or be unexported (golint)
    • Line 200: warning: exported method Client.ObserveDeviceResources should have comment or be unexported (golint)
    • Line 216: warning: exported method Client.StopObservingDeviceResources should have comment or be unexported (golint)
    • device/schema/certificateSigningRequest.go
    • Line 3: warning: exported type CertificateSigningRequestResponse should have comment or be unexported (golint)
    • Line 12: warning: exported method CertificateSigningRequestResponse.CSR should have comment or be unexported (golint)
    • Line 25: warning: exported type CertificateEncoding should have comment or be unexported (golint)
    • Line 28: warning: don't use underscores in Go names; const CertificateEncoding_PEM should be CertificateEncodingPEM (golint)
    • Line 28: warning: exported const CertificateEncoding_PEM should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: don't use underscores in Go names; const CertificateEncoding_DER should be CertificateEncodingDER (golint)
    • device/schema/ownership.go
    • Line 5: warning: exported const DoxmHref should have comment or be unexported (golint)
    • Line 9: warning: exported type Doxm should have comment or be unexported (golint)
    • Line 23: warning: exported type DoxmUpdate should have comment or be unexported (golint)
    • Line 31: warning: exported type OwnerTransferMethod should have comment or be unexported (golint)
    • Line 34: warning: exported const JustWorks should have comment (or a comment on this block) or be unexported (golint)
    • device/schema/link.go
    • Line 29: warning: exported type Endpoints should have comment or be unexported (golint)
    • Line 31: warning: exported type ResourceLinks should have comment or be unexported (golint)
    • Line 154: warning: exported method ResourceLink.GetSecureEndpoints should have comment or be unexported (golint)
    • Line 174: warning: exported method ResourceLink.GetUnsecureEndpoints should have comment or be unexported (golint)
    • Line 195: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 205: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 241: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 272: warning: exported method Endpoints.GetAddr should have comment or be unexported (golint)
    • Line 289: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 294: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 299: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 304: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • Line 308: warning: exported type Scheme should have comment or be unexported (golint)
    • Line 311: warning: exported const TCPSecureScheme should have comment (or a comment on this block) or be unexported (golint)
    • Line 338: warning: receiver name r should be consistent with previous receiver name d for ResourceLink (golint)
    • device/client/core/device.go
    • Line 25: warning: exported type Device should have comment or be unexported (golint)
    • Line 42: warning: exported type TLSConfig should have comment or be unexported (golint)
    • Line 48: warning: exported function NewDevice should have comment or be unexported (golint)
    • Line 220: warning: exported method Device.DeviceID should have comment or be unexported (golint)
    • Line 232: warning: exported method Device.DeviceTypes should have comment or be unexported (golint)
    • device/client/core/otm/manufacturer/client.go
    • Line 18: warning: comment on exported type SignFunc should be of the form "SignFunc ..." (with optional leading article) (golint)
    • Line 21: warning: exported type DialDTLS should have comment or be unexported (golint)
    • Line 22: warning: exported type DialTLS should have comment or be unexported (golint)
    • Line 24: warning: exported type Client should have comment or be unexported (golint)
    • Line 33: warning: exported type OptionFunc should have comment or be unexported (golint)
    • Line 35: warning: exported function WithDialDTLS should have comment or be unexported (golint)
    • Line 44: warning: exported function WithDialTLS should have comment or be unexported (golint)
    • Line 53: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 72: warning: exported method Client.Type should have comment or be unexported (golint)
    • Line 76: warning: exported method Client.Dial should have comment or be unexported (golint)
    • Line 113: warning: exported method Client.ProvisionOwnerCredentials should have comment or be unexported (golint)
    • device/pkg/net/coap/client.go
    • Line 31: warning: exported type Observation should have comment or be unexported (golint)
    • Line 35: warning: exported type ClientConn should have comment or be unexported (golint)
    • Line 46: warning: exported type Client should have comment or be unexported (golint)
    • Line 67: warning: don't use underscores in Go names; var ExtendedKeyUsage_IDENTITY_CERTIFICATE should be ExtendedKeyUsageIDENTITYCERTIFICATE (golint)
    • Line 67: warning: exported var ExtendedKeyUsage_IDENTITY_CERTIFICATE should have comment or be unexported (golint)
    • Line 69: warning: exported function GetDeviceIDFromIndetityCertificate should have comment or be unexported (golint)
    • Line 105: warning: exported function VerifyIndetityCertificate should have comment or be unexported (golint)
    • Line 131: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 135: warning: exported type OptionFunc should have comment or be unexported (golint)
    • Line 137: warning: exported function WithInterface should have comment or be unexported (golint)
    • Line 146: warning: exported function WithResourceType should have comment or be unexported (golint)
    • Line 155: warning: exported function WithInstanceID should have comment or be unexported (golint)
    • Line 164: warning: exported function WithDeviceID should have comment or be unexported (golint)
    • Line 173: warning: exported function WithCredentialId should have comment or be unexported (golint)
    • Line 182: warning: exported function WithCredentialSubject should have comment or be unexported (golint)
    • Line 191: warning: exported function WithAccept should have comment or be unexported (golint)
    • Line 199: warning: exported method Client.UpdateResource should have comment or be unexported (golint)
    • Line 209: warning: exported method Client.UpdateResourceWithCodec should have comment or be unexported (golint)
    • Line 242: warning: exported method Client.GetResource should have comment or be unexported (golint)
    • Line 251: warning: exported method Client.GetResourceWithCodec should have comment or be unexported (golint)
    • Line 275: warning: exported method Client.DeleteResourceWithCodec should have comment or be unexported (golint)
    • Line 299: warning: exported method Client.DeleteResource should have comment or be unexported (golint)
    • Line 308: warning: exported method Client.Close should have comment or be unexported (golint)
    • Line 358: warning: exported method Client.RemoteAddr should have comment or be unexported (golint)
    • Line 362: warning: exported method Client.Context should have comment or be unexported (golint)
    • Line 366: warning: exported method Client.Done should have comment or be unexported (golint)
    • Line 370: warning: exported type CloseHandlerFunc should have comment or be unexported (golint)
    • Line 372: warning: exported type OnCloseHandler should have comment or be unexported (golint)
    • Line 378: warning: exported function NewOnCloseHandler should have comment or be unexported (golint)
    • Line 384: warning: exported method OnCloseHandler.Add should have comment or be unexported (golint)
    • Line 393: warning: exported method OnCloseHandler.Remove should have comment or be unexported (golint)
    • Line 411: warning: exported method OnCloseHandler.OnClose should have comment or be unexported (golint)
    • Line 418: warning: exported type ClientCloseHandler should have comment or be unexported (golint)
    • Line 423: warning: exported method ClientCloseHandler.RegisterCloseHandler should have comment or be unexported (golint)
    • Line 427: warning: exported method ClientCloseHandler.UnregisterCloseHandler should have comment or be unexported (golint)
    • Line 452: warning: exported type DialOptionFunc should have comment or be unexported (golint)
    • Line 454: warning: exported function WithDialDisableTCPSignalMessageCSM should have comment or be unexported (golint)
    • Line 463: warning: exported function WithDialDisablePeerTCPSignalMessageCSMs should have comment or be unexported (golint)
    • Line 480: warning: exported function WithErrors should have comment or be unexported (golint)
    • Line 487: warning: exported function WithMaxMessageSize should have comment or be unexported (golint)
    • Line 494: warning: exported function WithDialer should have comment or be unexported (golint)
    • Line 501: warning: exported function WithHeartBeat should have comment or be unexported (golint)
    • Line 508: warning: exported function WithBlockwise should have comment or be unexported (golint)
    • Line 519: warning: exported function DialUDP should have comment or be unexported (golint)
    • Line 564: warning: exported function DialTCP should have comment or be unexported (golint)
    • Line 615: warning: exported function NewVerifyPeerCertificate should have comment or be unexported (golint)
    • Line 651: warning: exported function DialTCPSecure should have comment or be unexported (golint)
    • Line 703: warning: exported function DialUDPSecure should have comment or be unexported (golint)
    • device/cmd/ocfclient/main.go
    • Line 28: warning: exported type Options should have comment or be unexported (golint)
    • Line 44: warning: exported function ReadCommandOptions should have comment or be unexported (golint)
    • Line 403: warning: exported function WriteCertOut should have comment or be unexported (golint)
    • Line 418: warning: exported function WritePrivateKey should have comment or be unexported (golint)
    • Line 446: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 461: warning: exported function NewSecureClient should have comment or be unexported (golint)
    • Line 541: warning: exported method OCFClient.Close should have comment or be unexported (golint)
    • Line 721: warning: exported var CertIdentity should have comment or be unexported (golint)
    • device/client/observeResource.go
    • Line 147: warning: exported method Client.ObserveResource should have comment or be unexported (golint)
    • Line 227: warning: exported method Client.StopObservingResource should have comment or be unexported (golint)
    • device/schema/cloud/status.go
    • Line 3: warning: exported const StatusResourceType should have comment or be unexported (golint)
    • Line 5: warning: exported var StatusInterfaces should have comment or be unexported (golint)
    • Line 6: warning: exported var StatusResourceTypes should have comment or be unexported (golint)
    • Line 8: warning: exported const StatusHref should have comment or be unexported (golint)
    • device/schema/acl/acl.go
    • Line 1: warning: package comment should be of the form "Package acl ..." (golint)
    • Line 10: warning: exported type Response should have comment or be unexported (golint)
    • Line 18: warning: exported type UpdateRequest should have comment or be unexported (golint)
    • Line 23: warning: exported type AccessControl should have comment or be unexported (golint)
    • Line 31: warning: exported type Permission should have comment or be unexported (golint)
    • Line 34: warning: don't use underscores in Go names; const Permission_CREATE should be PermissionCREATE (golint)
    • Line 34: warning: exported const Permission_CREATE should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; const Permission_READ should be PermissionREAD (golint)
    • Line 36: warning: don't use underscores in Go names; const Permission_WRITE should be PermissionWRITE (golint)
    • Line 37: warning: don't use underscores in Go names; const Permission_DELETE should be PermissionDELETE (golint)
    • Line 38: warning: don't use underscores in Go names; const Permission_NOTIFY should be PermissionNOTIFY (golint)
    • Line 72: warning: receiver name b should be consistent with previous receiver name s for Permission (golint)
    • Line 76: warning: exported type Resource should have comment or be unexported (golint)
    • Line 83: warning: exported var AllResources should have comment or be unexported (golint)
    • Line 88: warning: exported type ResourceWildcard should have comment or be unexported (golint)
    • Line 91: warning: don't use underscores in Go names; const ResourceWildcard_NONCFG_SEC_ENDPOINT should be ResourceWildcardNONCFGSECENDPOINT (golint)
    • Line 91: warning: exported const ResourceWildcard_NONCFG_SEC_ENDPOINT should have comment (or a comment on this block) or be unexported (golint)
    • Line 92: warning: don't use underscores in Go names; const ResourceWildcard_NONCFG_NONSEC_ENDPOINT should be ResourceWildcardNONCFGNONSECENDPOINT (golint)
    • Line 93: warning: don't use underscores in Go names; const ResourceWildcard_NONCFG_ALL should be ResourceWildcardNONCFGALL (golint)
    • Line 96: warning: don't use underscores in Go names; type Subject_Device should be SubjectDevice (golint)
    • Line 96: warning: exported type Subject_Device should have comment or be unexported (golint)
    • Line 100: warning: don't use underscores in Go names; type Subject_Role should be SubjectRole (golint)
    • Line 100: warning: exported type Subject_Role should have comment or be unexported (golint)
    • Line 105: warning: don't use underscores in Go names; type Subject_Connection should be SubjectConnection (golint)
    • Line 105: warning: exported type Subject_Connection should have comment or be unexported (golint)
    • Line 109: warning: exported type ConnectionType should have comment or be unexported (golint)
    • Line 112: warning: comment on exported const ConnectionType_AUTH_CRYPT should be of the form "ConnectionType_AUTH_CRYPT ..." (golint)
    • Line 113: warning: don't use underscores in Go names; const ConnectionType_AUTH_CRYPT should be ConnectionTypeAUTHCRYPT (golint)
    • Line 114: warning: comment on exported const ConnectionType_ANON_CLEAR should be of the form "ConnectionType_ANON_CLEAR ..." (golint)
    • Line 115: warning: don't use underscores in Go names; const ConnectionType_ANON_CLEAR should be ConnectionTypeANONCLEAR (golint)
    • Line 118: warning: comment on exported type Subject should be of the form "Subject ..." (with optional leading article) (golint)
    • Line 125: warning: exported var TLSConnection should have comment or be unexported (golint)
    • Line 131: warning: exported type TimePattern should have comment or be unexported (golint)
    • device/client/maitenance.go
    • Line 5: warning: exported method Client.FactoryReset should have comment or be unexported (golint)
    • Line 15: warning: exported method Client.Reboot should have comment or be unexported (golint)
    • device/client/client.go
    • Line 20: warning: exported type ApplicationCallback should have comment or be unexported (golint)
    • Line 31: warning: exported type Config should have comment or be unexported (golint)
    • Line 170: warning: exported type DeviceOwner should have comment or be unexported (golint)
    • Line 222: warning: exported method Client.CoreClient should have comment or be unexported (golint)
    • Line 234: warning: exported function NewDeviceOwnerFromConfig should have comment or be unexported (golint)
    • device/client/core/provisionDevice.go
    • Line 15: warning: exported method Device.Provision should have comment or be unexported (golint)
    • Line 27: warning: exported type ProvisioningClient should have comment or be unexported (golint)
    • Line 52: warning: exported method ProvisioningClient.Close should have comment or be unexported (golint)
    • Line 72: warning: exported method ProvisioningClient.AddCredentials should have comment or be unexported (golint)
    • Line 86: warning: exported method ProvisioningClient.AddCertificateAuthority should have comment or be unexported (golint)
    • Line 103: warning: exported method ProvisioningClient.SetCloudResource should have comment or be unexported (golint)
    • Line 131: warning: comment on exported method ProvisioningClient.SetAccessControl should be of the form "SetAccessControl ..." (golint)
    • device/client/refDevice.go
    • Line 12: warning: exported type RefDevice should have comment or be unexported (golint)
    • Line 16: warning: exported function NewRefDevice should have comment or be unexported (golint)
    • Line 25: warning: exported method RefDevice.Acquire should have comment or be unexported (golint)
    • Line 29: warning: exported method RefDevice.Release should have comment or be unexported (golint)
    • Line 33: warning: exported method RefDevice.DeviceID should have comment or be unexported (golint)
    • Line 37: warning: exported method RefDevice.Device should have comment or be unexported (golint)
    • Line 41: warning: exported method RefDevice.GetDeviceDetails should have comment or be unexported (golint)
    • Line 45: warning: exported method RefDevice.GetResourceWithCodec should have comment or be unexported (golint)
    • Line 54: warning: exported method RefDevice.ObserveResourceWithCodec should have comment or be unexported (golint)
    • Line 64: warning: exported method RefDevice.ObserveResource should have comment or be unexported (golint)
    • Line 73: warning: exported method RefDevice.StopObservingResource should have comment or be unexported (golint)
    • Line 80: warning: exported method RefDevice.IsSecured should have comment or be unexported (golint)
    • Line 84: warning: exported method RefDevice.UpdateResource should have comment or be unexported (golint)
    • Line 94: warning: exported method RefDevice.UpdateResourceWithCodec should have comment or be unexported (golint)
    • Line 105: warning: exported method RefDevice.Own should have comment or be unexported (golint)
    • Line 114: warning: exported method RefDevice.Disown should have comment or be unexported (golint)
    • Line 121: warning: exported method RefDevice.Provision should have comment or be unexported (golint)
    • Line 125: warning: exported method RefDevice.GetEndpoints should have comment or be unexported (golint)
    • Line 129: warning: exported method RefDevice.GetResourceLinks should have comment or be unexported (golint)
    • Line 133: warning: exported method RefDevice.FactoryReset should have comment or be unexported (golint)
    • Line 137: warning: exported method RefDevice.Reboot should have comment or be unexported (golint)
    • Line 141: warning: exported method RefDevice.GetOwnership should have comment or be unexported (golint)
    • device/client/observeDevices.go
    • Line 17: warning: don't use underscores in Go names; type DevicesObservationEvent_type should be DevicesObservationEventType (golint)
    • Line 17: warning: exported type DevicesObservationEvent_type should have comment or be unexported (golint)
    • Line 19: warning: don't use underscores in Go names; const DevicesObservationEvent_ONLINE should be DevicesObservationEventONLINE (golint)
    • Line 19: warning: exported const DevicesObservationEvent_ONLINE should have comment or be unexported (golint)
    • Line 20: warning: don't use underscores in Go names; const DevicesObservationEvent_OFFLINE should be DevicesObservationEventOFFLINE (golint)
    • Line 20: warning: exported const DevicesObservationEvent_OFFLINE should have comment or be unexported (golint)
    • Line 22: warning: exported type DevicesObservationEvent should have comment or be unexported (golint)
    • Line 27: warning: exported type DevicesObservationHandler should have comment or be unexported (golint)
    • Line 241: warning: exported method Client.ObserveDevices should have comment or be unexported (golint)
    • Line 265: warning: exported method Client.StopObservingDevices should have comment or be unexported (golint)
    • device/client/core/ownDevice.go
    • Line 16: warning: exported type OTMClient should have comment or be unexported (golint)
    • Line 22: warning: exported type ActionDuringOwnFunc should have comment or be unexported (golint)
    • Line 28: warning: exported type OwnOption should have comment or be unexported (golint)
    • device/app/app.go
    • Line 11: warning: exported type AppConfig should have comment or be unexported (golint)
    • Line 16: warning: exported type ManufacturerCerts should have comment or be unexported (golint)
    • Line 20: warning: exported type App should have comment or be unexported (golint)
    • Line 25: warning: exported function NewApp should have comment or be unexported (golint)
    • Line 58: warning: exported method App.GetRootCertificateAuthorities should have comment or be unexported (golint)
    • Line 65: warning: exported method App.GetManufacturerCertificateAuthorities should have comment or be unexported (golint)
    • Line 72: warning: exported method App.GetManufacturerCertificate should have comment or be unexported (golint)
    • device/schema/credential.go
    • Line 10: warning: exported type Credential should have comment or be unexported (golint)
    • Line 23: warning: exported type CredentialType should have comment or be unexported (golint)
    • Line 26: warning: don't use underscores in Go names; const CredentialType_EMPTY should be CredentialTypeEMPTY (golint)
    • Line 26: warning: exported const CredentialType_EMPTY should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: don't use underscores in Go names; const CredentialType_SYMMETRIC_PAIR_WISE should be CredentialTypeSYMMETRICPAIRWISE (golint)
    • Line 28: warning: don't use underscores in Go names; const CredentialType_SYMMETRIC_GROUP should be CredentialTypeSYMMETRICGROUP (golint)
    • Line 29: warning: don't use underscores in Go names; const CredentialType_ASYMMETRIC_SIGNING should be CredentialTypeASYMMETRICSIGNING (golint)
    • Line 30: warning: don't use underscores in Go names; const CredentialType_ASYMMETRIC_SIGNING_WITH_CERTIFICATE should be CredentialTypeASYMMETRICSIGNINGWITHCERTIFICATE (golint)
    • Line 31: warning: don't use underscores in Go names; const CredentialType_PIN_OR_PASSWORD should be CredentialTypePINORPASSWORD (golint)
    • Line 32: warning: don't use underscores in Go names; const CredentialType_ASYMMETRIC_ENCRYPTION_KEY should be CredentialTypeASYMMETRICENCRYPTIONKEY (golint)
    • Line 72: warning: receiver name b should be consistent with previous receiver name s for CredentialType (golint)
    • Line 76: warning: exported type CredentialUsage should have comment or be unexported (golint)
    • Line 79: warning: don't use underscores in Go names; const CredentialUsage_TRUST_CA should be CredentialUsageTRUSTCA (golint)
    • Line 79: warning: exported const CredentialUsage_TRUST_CA should have comment (or a comment on this block) or be unexported (golint)
    • Line 80: warning: don't use underscores in Go names; const CredentialUsage_CERT should be CredentialUsageCERT (golint)
    • Line 81: warning: don't use underscores in Go names; const CredentialUsage_ROLE_CERT should be CredentialUsageROLECERT (golint)
    • Line 82: warning: don't use underscores in Go names; const CredentialUsage_MFG_TRUST_CA should be CredentialUsageMFGTRUSTCA (golint)
    • Line 83: warning: don't use underscores in Go names; const CredentialUsage_MFG_CERT should be CredentialUsageMFGCERT (golint)
    • Line 86: warning: exported type CredentialRefreshMethod should have comment or be unexported (golint)
    • Line 89: warning: don't use underscores in Go names; const CredentialRefreshMethod_PROVISION_SERVICE should be CredentialRefreshMethodPROVISIONSERVICE (golint)
    • Line 89: warning: exported const CredentialRefreshMethod_PROVISION_SERVICE should have comment (or a comment on this block) or be unexported (golint)
    • Line 90: warning: don't use underscores in Go names; const CredentialRefreshMethod_KEY_AGREEMENT_PROTOCOL_AND_RANDOM_PIN should be CredentialRefreshMethodKEYAGREEMENTPROTOCOLANDRANDOMPIN (golint)
    • Line 91: warning: don't use underscores in Go names; const CredentialRefreshMethod_KEY_AGREEMENT_PROTOCOL should be CredentialRefreshMethodKEYAGREEMENTPROTOCOL (golint)
    • Line 92: warning: don't use underscores in Go names; const CredentialRefreshMethod_KEY_DISTRIBUTION_SERVICE should be CredentialRefreshMethodKEYDISTRIBUTIONSERVICE (golint)
    • Line 93: warning: don't use underscores in Go names; const CredentialRefreshMethod_PKCS10_REQUEST_TO_CA should be CredentialRefreshMethodPKCS10REQUESTTOCA (golint)
    • Line 96: warning: exported type CredentialOptionalData should have comment or be unexported (golint)
    • Line 102: warning: exported method CredentialOptionalData.Data should have comment or be unexported (golint)
    • Line 115: warning: exported type CredentialOptionalDataEncoding should have comment or be unexported (golint)
    • Line 118: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_JWT should be CredentialOptionalDataEncodingJWT (golint)
    • Line 118: warning: exported const CredentialOptionalDataEncoding_JWT should have comment (or a comment on this block) or be unexported (golint)
    • Line 119: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_CWT should be CredentialOptionalDataEncodingCWT (golint)
    • Line 120: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_BASE64 should be CredentialOptionalDataEncodingBASE64 (golint)
    • Line 121: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_PEM should be CredentialOptionalDataEncodingPEM (golint)
    • Line 122: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_DER should be CredentialOptionalDataEncodingDER (golint)
    • Line 123: warning: don't use underscores in Go names; const CredentialOptionalDataEncoding_RAW should be CredentialOptionalDataEncodingRAW (golint)
    • Line 126: warning: exported type CredentialPrivateData should have comment or be unexported (golint)
    • Line 132: warning: exported method CredentialPrivateData.Data should have comment or be unexported (golint)
    • Line 145: warning: exported type CredentialPrivateDataEncoding should have comment or be unexported (golint)
    • Line 148: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_JWT should be CredentialPrivateDataEncodingJWT (golint)
    • Line 148: warning: exported const CredentialPrivateDataEncoding_JWT should have comment (or a comment on this block) or be unexported (golint)
    • Line 149: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_CWT should be CredentialPrivateDataEncodingCWT (golint)
    • Line 150: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_BASE64 should be CredentialPrivateDataEncodingBASE64 (golint)
    • Line 151: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_URI should be CredentialPrivateDataEncodingURI (golint)
    • Line 152: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_HANDLE should be CredentialPrivateDataEncodingHANDLE (golint)
    • Line 153: warning: don't use underscores in Go names; const CredentialPrivateDataEncoding_RAW should be CredentialPrivateDataEncodingRAW (golint)
    • Line 156: warning: exported type CredentialPublicData should have comment or be unexported (golint)
    • Line 161: warning: exported method CredentialPublicData.Data should have comment or be unexported (golint)
    • Line 174: warning: exported type CredentialPublicDataEncoding should have comment or be unexported (golint)
    • Line 177: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_JWT should be CredentialPublicDataEncodingJWT (golint)
    • Line 177: warning: exported const CredentialPublicDataEncoding_JWT should have comment (or a comment on this block) or be unexported (golint)
    • Line 178: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_CWT should be CredentialPublicDataEncodingCWT (golint)
    • Line 179: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_BASE64 should be CredentialPublicDataEncodingBASE64 (golint)
    • Line 180: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_URI should be CredentialPublicDataEncodingURI (golint)
    • Line 181: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_PEM should be CredentialPublicDataEncodingPEM (golint)
    • Line 182: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_DER should be CredentialPublicDataEncodingDER (golint)
    • Line 183: warning: don't use underscores in Go names; const CredentialPublicDataEncoding_RAW should be CredentialPublicDataEncodingRAW (golint)
    • Line 186: warning: exported type CredentialRoleID should have comment or be unexported (golint)
    • Line 191: warning: exported type CredentialResponse should have comment or be unexported (golint)
    • Line 199: warning: exported type CredentialUpdateRequest should have comment or be unexported (golint)
    • device/client/deviceOwnershipBackend.go
    • Line 21: warning: exported type SignFunc should have comment or be unexported (golint)
    • Line 33: warning: exported type DeviceOwnershipBackendConfig should have comment or be unexported (golint)
    • Line 38: warning: exported function NewDeviceOwnershipBackendFromConfig should have comment or be unexported (golint)
    • device/client/core/discover.go
    • Line 27: warning: exported type DiscoveryHandler should have comment or be unexported (golint)
    • Line 29: warning: exported type DiscoveryClient should have comment or be unexported (golint)
    • Line 60: warning: exported method DiscoveryClient.PublishMsgWithContext should have comment or be unexported (golint)
    • Line 66: warning: exported method DiscoveryClient.Close should have comment or be unexported (golint)
    • device/client/core/getDevice.go
    • Line 51: warning: comment on exported method Client.GetDeviceByMulticast should be of the form "GetDeviceByMulticast ..." (golint)
    • Line 80: warning: exported const ANY_DEVICE should have comment or be unexported (golint)
    • device/client/core/getDevices.go
    • Line 49: warning: comment on exported type DeviceHandlerV2 should be of the form "DeviceHandlerV2 ..." (with optional leading article) (golint)
    • Line 57: warning: comment on exported method Client.GetDevicesV2 should be of the form "GetDevicesV2 ..." (golint)
    • device/schema/cloud/configuration.go
    • Line 6: warning: exported const ConfigurationResourceHref should have comment or be unexported (golint)
    • Line 8: warning: exported const ConfigurationResourceType should have comment or be unexported (golint)
    • Line 10: warning: exported var ConfigurationResourceTypes should have comment or be unexported (golint)
    • Line 16: warning: don't use underscores in Go names; const ProvisioningStatus_UNINITIALIZED should be ProvisioningStatusUNINITIALIZED (golint)
    • Line 16: warning: exported const ProvisioningStatus_UNINITIALIZED should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: don't use underscores in Go names; const ProvisioningStatus_READY_TO_REGISTER should be ProvisioningStatusREADYTOREGISTER (golint)
    • Line 18: warning: don't use underscores in Go names; const ProvisioningStatus_REGISTERING should be ProvisioningStatusREGISTERING (golint)
    • Line 19: warning: don't use underscores in Go names; const ProvisioningStatus_REGISTERED should be ProvisioningStatusREGISTERED (golint)
    • Line 20: warning: don't use underscores in Go names; const ProvisioningStatus_FAILED should be ProvisioningStatusFAILED (golint)
    • Line 23: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 34: warning: exported type ConfigurationUpdateRequest should have comment or be unexported (golint)
    • device/client/options.go
    • Line 18: warning: exported function WithError should have comment or be unexported (golint)
    • Line 24: warning: exported function WithGetDetails should have comment or be unexported (golint)
    • Line 30: warning: exported function WithCodec should have comment or be unexported (golint)
    • Line 36: warning: exported function WithResourceTypes should have comment or be unexported (golint)
    • Line 56: warning: exported type ResourceInterfaceOption should have comment or be unexported (golint)
    • Line 74: warning: exported type DiscoveryConfigrationOption should have comment or be unexported (golint)
    • Line 140: warning: exported type GetDevicesWithHandlerOption should have comment or be unexported (golint)
    • Line 144: warning: exported type ObserveDevicesOption should have comment or be unexported (golint)
    • Line 148: warning: exported type ErrorOption should have comment or be unexported (golint)
    • Line 157: warning: exported type GetDetailsFunc should have comment or be unexported (golint)
    • Line 159: warning: exported type GetDetailsOption should have comment or be unexported (golint)
    • Line 202: warning: exported type ResourceTypesOption should have comment or be unexported (golint)
    • Line 211: warning: exported type CodecOption should have comment or be unexported (golint)
    • Line 239: warning: exported type OTMType should have comment or be unexported (golint)
    • Line 242: warning: don't use underscores in Go names; const OTMType_Manufacturer should be OTMTypeManufacturer (golint)
    • Line 242: warning: exported const OTMType_Manufacturer should have comment (or a comment on this block) or be unexported (golint)
    • Line 243: warning: don't use underscores in Go names; const OTMType_JustWorks should be OTMTypeJustWorks (golint)
    • device/client/getDevices.go
    • Line 99: warning: don't use underscores in Go names; const OwnershipStatus_ReadyToBeOwned should be OwnershipStatusReadyToBeOwned (golint)
    • Line 101: warning: don't use underscores in Go names; const OwnershipStatus_Owned should be OwnershipStatusOwned (golint)
    • Line 103: warning: don't use underscores in Go names; const OwnershipStatus_OwnedByOther should be OwnershipStatusOwnedByOther (golint)
    • Line 105: warning: don't use underscores in Go names; const OwnershipStatus_Unknown should be OwnershipStatusUnknown (golint)
    • device/client/deviceOwnershipSDK.go
    • Line 20: warning: exported type Signer should have comment or be unexported (golint)
    • Line 24: warning: exported type DeviceOwnershipSDKConfig should have comment or be unexported (golint)
    • Line 42: warning: exported function NewDeviceOwnershipSDKFromConfig should have comment or be unexported (golint)
    • Line 64: warning: exported function NewDeviceOwnershipSDK should have comment or be unexported (golint)
    • device/client/initialization.go
    • Line 17: warning: exported function GenerateSDKIdentityCertificate should have comment or be unexported (golint)
    • Line 49: warning: exported function GenerateSDKManufacturerCertificate should have comment or be unexported (golint)
    • Line 84: warning: exported method Client.Initialization should have comment or be unexported (golint)
    • Line 93: warning: exported method Client.GetIdentityCACerts should have comment or be unexported (golint)
    • device/client/core/client.go
    • Line 54: warning: exported type OptionFunc should have comment or be unexported (golint)
    • Line 56: warning: exported function WithTLS should have comment or be unexported (golint)
    • Line 72: warning: exported function WithErr should have comment or be unexported (golint)
    • Line 81: warning: exported type DialDTLS should have comment or be unexported (golint)
    • Line 82: warning: exported type DialTLS should have comment or be unexported (golint)
    • Line 83: warning: exported type DialUDP should have comment or be unexported (golint)
    • Line 84: warning: exported type DialTCP should have comment or be unexported (golint)
    • Line 86: warning: exported function WithDialDTLS should have comment or be unexported (golint)
    • Line 95: warning: exported function WithDialTLS should have comment or be unexported (golint)
    • Line 104: warning: exported function WithDialTCP should have comment or be unexported (golint)
    • Line 113: warning: exported function WithDialUDP should have comment or be unexported (golint)
    • Line 133: warning: exported function DefaultDiscoveryConfiguration should have comment or be unexported (golint)
    • Line 141: warning: exported function NewClient should have comment or be unexported (golint)
    • device/schema/maintenance/maintenance.go
    • Line 3: warning: comment on exported const MaintenanceResourceType should be of the form "MaintenanceResourceType ..." (golint)
    • Line 7: warning: exported type Maintenance should have comment or be unexported (golint)
    • Line 16: warning: exported type MaintenanceUpdateRequest should have comment or be unexported (golint)
    • device/test/test.go
    • Line 23: warning: exported function MustGetHostname should have comment or be unexported (golint)
    • Line 31: warning: exported function MustFindDeviceByName should have comment or be unexported (golint)
    • Line 69: warning: exported function FindDeviceByName should have comment or be unexported (golint)
    • Line 91: warning: exported type IdentityCertificateSigner should have comment or be unexported (golint)
    • Line 98: warning: exported function NewIdentityCertificateSigner should have comment or be unexported (golint)
    • Line 102: warning: exported method IdentityCertificateSigner.Sign should have comment or be unexported (golint)
    • Line 149: warning: exported type IPType should have comment or be unexported (golint)
    • Line 152: warning: exported const ANY should have comment (or a comment on this block) or be unexported (golint)
    • Line 157: warning: exported function FindDeviceIP should have comment or be unexported (golint)
    • Line 204: warning: exported function MustFindDeviceIP should have comment or be unexported (golint)
    • device/client/core/otm/just-works/client.go
    • Line 17: warning: comment on exported type SignFunc should be of the form "SignFunc ..." (with optional leading article) (golint)
    • Line 20: warning: exported type Client should have comment or be unexported (golint)
    • Line 25: warning: exported type DialDTLS should have comment or be unexported (golint)
    • Line 27: warning: exported type OptionFunc should have comment or be unexported (golint)
    • Line 29: warning: exported function WithDialDTLS should have comment or be unexported (golint)
    • Line 38: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 49: warning: exported method Client.Type should have comment or be unexported (golint)
    • Line 53: warning: exported method Client.Dial should have comment or be unexported (golint)
    • Line 77: warning: exported method Client.ProvisionOwnerCredentials should have comment or be unexported (golint)
    • device/schema/provisionStatus.go
    • Line 10: warning: exported type DeviceOnboardingState should have comment or be unexported (golint)
    • Line 15: warning: exported type ProvisionStatusResponse should have comment or be unexported (golint)
    • Line 29: warning: exported type ProvisionStatusUpdateRequest should have comment or be unexported (golint)
    • Line 36: warning: exported type OperationalState should have comment or be unexported (golint)
    • Line 40: warning: don't use underscores in Go names; const OperationalState_RESET should be OperationalStateRESET (golint)
    • Line 42: warning: don't use underscores in Go names; const OperationalState_RFOTM should be OperationalStateRFOTM (golint)
    • Line 44: warning: don't use underscores in Go names; const OperationalState_RFPRO should be OperationalStateRFPRO (golint)
    • Line 46: warning: don't use underscores in Go names; const OperationalState_RFNOP should be OperationalStateRFNOP (golint)
    • Line 48: warning: don't use underscores in Go names; const OperationalState_SRESET should be OperationalStateSRESET (golint)
    • Line 68: warning: exported type OperationalMode should have comment or be unexported (golint)
    • Line 71: warning: don't use underscores in Go names; const OperationalMode_SERVER_DIRECTED_UTILIZING_MULTIPE_SERVICES should be OperationalModeSERVERDIRECTEDUTILIZINGMULTIPESERVICES (golint)
    • Line 71: warning: exported const OperationalMode_SERVER_DIRECTED_UTILIZING_MULTIPE_SERVICES should have comment (or a comment on this block) or be unexported (golint)
    • Line 72: warning: don't use underscores in Go names; const OperationalMode_SERVER_DIRECTED_UTILIZING_SINGLE_SERVICE should be OperationalModeSERVERDIRECTEDUTILIZINGSINGLESERVICE (golint)
    • Line 73: warning: don't use underscores in Go names; const OperationalMode_CLIENT_DIRECTED should be OperationalModeCLIENTDIRECTED (golint)
    • Line 97: warning: receiver name b should be consistent with previous receiver name s for OperationalMode (golint)
    • Line 101: warning: exported type ProvisioningMode should have comment or be unexported (golint)
    • Line 105: warning: don't use underscores in Go names; const ProvisioningMode_INIT_SOFT_VER_VALIDATION should be ProvisioningModeINITSOFTVERVALIDATION (golint)
    • Line 107: warning: don't use underscores in Go names; const ProvisioningMode_INIT_SEC_SOFT_UPDATE should be ProvisioningModeINITSECSOFTUPDATE (golint)
    • Line 127: warning: receiver name b should be consistent with previous receiver name s for ProvisioningMode (golint)
    • device/client/core/sdkError.go
    • Line 10: warning: exported type SdkError should have comment or be unexported (golint)
    • Line 21: warning: exported method SdkError.GetCode should have comment or be unexported (golint)
    • Line 25: warning: exported function MakeSdkError should have comment or be unexported (golint)
    • Line 29: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 37: warning: exported function MakeCanceled should have comment or be unexported (golint)
    • Line 42: warning: exported function MakeUnknown should have comment or be unexported (golint)
    • Line 46: warning: exported function MakeInvalidArgument should have comment or be unexported (golint)
    • Line 50: warning: exported function MakeDeadlineExceeded should have comment or be unexported (golint)
    • Line 54: warning: exported function MakeNotFound should have comment or be unexported (golint)
    • Line 58: warning: exported function MakeAlreadyExists should have comment or be unexported (golint)
    • Line 62: warning: exported function MakePermissionDenied should have comment or be unexported (golint)
    • Line 67: warning: exported function MakeResourceExhausted should have comment or be unexported (golint)
    • Line 71: warning: exported function MakeFailedPrecondition should have comment or be unexported (golint)
    • Line 75: warning: exported function MakeAborted should have comment or be unexported (golint)
    • Line 79: warning: exported function MakeOutOfRange should have comment or be unexported (golint)
    • Line 83: warning: exported function MakeUnimplemented should have comment or be unexported (golint)
    • Line 87: warning: exported function MakeInternal should have comment or be unexported (golint)
    • Line 91: warning: exported function MakeInternalStr should have comment or be unexported (golint)
    • Line 95: warning: exported function MakeUnavailable should have comment or be unexported (golint)
    • Line 99: warning: exported function MakeDataLoss should have comment or be unexported (golint)
    • Line 103: warning: exported function MakeUnauthenticated should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell96%

Misspell Finds commonly misspelled English words

    • device/schema/provisionStatus.go
    • Line 71: warning: "MULTIPE" is a misspelling of "MULTIPLE" (misspell)
    • Line 78: warning: "MULTIPE" is a misspelling of "MULTIPLE" (misspell)
    • Line 79: warning: "MULTIPE" is a misspelling of "MULTIPLE" (misspell)
    • Line 80: warning: "MULTIPE" is a misspelling of "MULTIPLE" (misspell)