Preparing report...

Report for github.com/edgexfoundry/go-mod-core-contracts

A+    Excellent!    Found 101 issues across 304 files

Tweet

gofmt99%

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!


gocyclo99%

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.


golint67%

Golint is a linter for Go source code.

    • go-mod-core-contracts/v2/clients/http/provisionwatcher.go
    • Line 24: warning: exported type ProvisionWatcherClient should have comment or be unexported (golint)
    • Line 35: warning: exported method ProvisionWatcherClient.Add should have comment or be unexported (golint)
    • Line 44: warning: exported method ProvisionWatcherClient.Update should have comment or be unexported (golint)
    • Line 53: warning: exported method ProvisionWatcherClient.AllProvisionWatchers should have comment or be unexported (golint)
    • Line 68: warning: exported method ProvisionWatcherClient.ProvisionWatcherByName should have comment or be unexported (golint)
    • Line 78: warning: exported method ProvisionWatcherClient.DeleteProvisionWatcherByName should have comment or be unexported (golint)
    • Line 88: warning: exported method ProvisionWatcherClient.ProvisionWatchersByProfileName should have comment or be unexported (golint)
    • Line 101: warning: exported method ProvisionWatcherClient.ProvisionWatchersByServiceName should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/models/address.go
    • Line 15: warning: exported type Address should have comment or be unexported (golint)
    • Line 77: warning: exported method RESTAddress.GetBaseAddress should have comment or be unexported (golint)
    • Line 91: warning: exported method MQTTPubAddress.GetBaseAddress should have comment or be unexported (golint)
    • Line 99: warning: exported method EmailAddress.GetBaseAddress should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/dtos/requests/event.go
    • Line 58: warning: exported method AddEventRequest.UnmarshalJSON should have comment or be unexported (golint)
    • Line 62: warning: exported method AddEventRequest.UnmarshalCBOR should have comment or be unexported (golint)
    • Line 66: warning: exported method AddEventRequest.Unmarshal should have comment or be unexported (golint)
    • Line 94: warning: exported method AddEventRequest.Encode should have comment or be unexported (golint)
    • go-mod-core-contracts/models/transmission_status.go
    • Line 24: warning: exported type TransmissionStatus should have comment or be unexported (golint)
    • Line 27: warning: exported const Failed should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: comment on exported method TransmissionStatus.UnmarshalJSON should be of the form "UnmarshalJSON ..." (golint)
    • Line 48: warning: exported method TransmissionStatus.Validate should have comment or be unexported (golint)
    • Line 56: warning: exported function IsTransmissionStatus should have comment or be unexported (golint)
    • go-mod-core-contracts/models/get.go
    • Line 19: warning: exported type Get should have comment or be unexported (golint)
    • Line 34: warning: comment on exported method Get.AllAssociatedValueDescriptors should be of the form "AllAssociatedValueDescriptors ..." (golint)
    • go-mod-core-contracts/models/sma_operation.go
    • Line 22: warning: comment on exported type Operation should be of the form "Operation ..." (with optional leading article) (golint)
    • Line 33: warning: comment on exported method Operation.UnmarshalJSON should be of the form "UnmarshalJSON ..." (golint)
    • go-mod-core-contracts/errors/types.go
    • Line 19: warning: comment on exported const KindUnknown should be of the form "KindUnknown ..." (golint)
    • Line 21: warning: exported const KindDatabaseError should have comment (or a comment on this block) or be unexported (golint)
    • Line 101: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 114: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 124: 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)
    • go-mod-core-contracts/v2/dtos/requests/intervalaction.go
    • Line 18: warning: comment on exported type AddIntervalActionRequest should be of the form "AddIntervalActionRequest ..." (with optional leading article) (golint)
    • Line 128: warning: exported function NewAddIntervalActionRequest should have comment or be unexported (golint)
    • Line 135: warning: exported function NewUpdateIntervalActionRequest should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/clients/http/device.go
    • Line 19: warning: exported type DeviceClient should have comment or be unexported (golint)
    • Line 30: warning: exported method DeviceClient.Add should have comment or be unexported (golint)
    • Line 38: warning: exported method DeviceClient.Update should have comment or be unexported (golint)
    • Line 46: warning: exported method DeviceClient.AllDevices should have comment or be unexported (golint)
    • Line 60: warning: exported method DeviceClient.DeviceNameExists should have comment or be unexported (golint)
    • Line 69: warning: exported method DeviceClient.DeviceByName should have comment or be unexported (golint)
    • Line 78: warning: exported method DeviceClient.DeleteDeviceByName should have comment or be unexported (golint)
    • Line 87: warning: exported method DeviceClient.DevicesByProfileName should have comment or be unexported (golint)
    • Line 99: warning: exported method DeviceClient.DevicesByServiceName should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/clients/http/deviceservice.go
    • Line 19: warning: exported type DeviceServiceClient should have comment or be unexported (golint)
    • Line 30: warning: exported method DeviceServiceClient.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method DeviceServiceClient.Update should have comment or be unexported (golint)
    • Line 48: warning: exported method DeviceServiceClient.AllDeviceServices should have comment or be unexported (golint)
    • Line 63: warning: exported method DeviceServiceClient.DeviceServiceByName should have comment or be unexported (golint)
    • Line 73: warning: exported method DeviceServiceClient.DeleteByName should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/dtos/address.go
    • Line 14: warning: exported type Address should have comment or be unexported (golint)
    • Line 55: warning: exported type RESTAddress should have comment or be unexported (golint)
    • Line 60: warning: exported function NewRESTAddress should have comment or be unexported (golint)
    • Line 71: warning: exported type MQTTPubAddress should have comment or be unexported (golint)
    • Line 81: warning: exported function NewMQTTAddress should have comment or be unexported (golint)
    • Line 93: warning: exported type EmailAddress should have comment or be unexported (golint)
    • Line 97: warning: exported function NewEmailAddress should have comment or be unexported (golint)
    • Line 106: warning: exported function ToAddressModel should have comment or be unexported (golint)
    • Line 144: warning: exported function FromAddressModelToDTO should have comment or be unexported (golint)
    • Line 178: warning: exported function ToAddressModels should have comment or be unexported (golint)
    • Line 186: warning: exported function FromAddressModelsToDTOs should have comment or be unexported (golint)
    • go-mod-core-contracts/clients/notifications/client.go
    • Line 15: warning: package comment should be of the form "Package notifications ..." (golint)
    • Line 25: warning: exported type CategoryEnum should have comment or be unexported (golint)
    • Line 28: warning: exported const SECURITY should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type SeverityEnum should have comment or be unexported (golint)
    • Line 36: warning: exported const CRITICAL should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported type StatusEnum should have comment or be unexported (golint)
    • Line 43: warning: exported const NEW should have comment (or a comment on this block) or be unexported (golint)
    • go-mod-core-contracts/models/severity.go
    • Line 23: warning: exported type NotificationsSeverity should have comment or be unexported (golint)
    • Line 26: warning: exported const Critical should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported method NotificationsSeverity.UnmarshalJSON should have comment or be unexported (golint)
    • Line 45: warning: exported function IsNotificationsSeverity should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/dtos/common/metrics.go
    • Line 9: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 35: warning: exported type MultiMetricsResponse should have comment or be unexported (golint)
    • Line 40: warning: exported function NewMultiMetricsResponse should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/dtos/responses/event.go
    • Line 36: warning: exported function NewEventResponse should have comment or be unexported (golint)
    • Line 43: warning: exported function NewMultiEventsResponse should have comment or be unexported (golint)
    • Line 50: warning: exported method EventResponse.Encode should have comment or be unexported (golint)
    • go-mod-core-contracts/models/status.go
    • Line 23: warning: exported type NotificationsStatus should have comment or be unexported (golint)
    • Line 26: warning: exported const New should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported method NotificationsStatus.UnmarshalJSON should have comment or be unexported (golint)
    • Line 46: warning: exported function IsNotificationsStatus should have comment or be unexported (golint)
    • go-mod-core-contracts/v2/constants.go
    • Line 235: warning: don't use underscores in Go names; const ReadWrite_R should be ReadWriteR (golint)
    • Line 236: warning: don't use underscores in Go names; const ReadWrite_W should be ReadWriteW (golint)
    • Line 237: warning: don't use underscores in Go names; const ReadWrite_RW should be ReadWriteRW (golint)
    • go-mod-core-contracts/clients/request.go
    • Line 89: warning: comment on exported function CountRequest should be of the form "CountRequest ..." (golint)
    • Line 104: warning: comment on exported function PostJSONRequest should be of the form "PostJSONRequest ..." (golint)
    • Line 116: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 131: warning: should not use basic type string as key in context.WithValue (golint)
    • Line 136: warning: comment on exported function PostRequest should be of the form "PostRequest ..." (golint)
    • Line 183: warning: comment on exported function UploadFileRequest should be of the form "UploadFileRequest ..." (golint)
    • Line 242: warning: comment on exported function UpdateRequest should be of the form "UpdateRequest ..." (golint)
    • Line 254: warning: comment on exported function PutRequest should be of the form "PutRequest ..." (golint)
    • Line 304: warning: comment on exported function DeleteRequest should be of the form "DeleteRequest ..." (golint)
    • go-mod-core-contracts/v2/dtos/common/base.go
    • Line 14: warning: comment on exported type BaseRequest should be of the form "BaseRequest ..." (with optional leading article) (golint)
    • Line 22: warning: exported function NewBaseRequest should have comment or be unexported (golint)
    • Line 52: warning: exported function NewBaseResponse should have comment or be unexported (golint)
    • Line 61: warning: exported function NewVersionable should have comment or be unexported (golint)
    • Line 65: warning: exported function NewBaseWithIdResponse 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!


misspell99%

Misspell Finds commonly misspelled English words