Preparing report...

Report for github.com/mendersoftware/deviceconnect

A+    Excellent!    Found 32 issues across 59 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!


golint50%

Golint is a linter for Go source code.

    • deviceconnect/model/inventory.go
    • Line 22: warning: exported const InventoryGroupScope should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type DeviceAttribute should have comment or be unexported (golint)
    • Line 33: warning: comment on exported type InvDevice should be of the form "InvDevice ..." (with optional leading article) (golint)
    • Line 49: warning: exported type DeviceIds should have comment or be unexported (golint)
    • Line 53: warning: exported type SearchParams should have comment or be unexported (golint)
    • Line 60: warning: exported type FilterPredicate should have comment or be unexported (golint)
    • deviceconnect/app/app.go
    • Line 67: warning: exported type Config should have comment or be unexported (golint)
    • Line 71: warning: comment on exported function New should be of the form "New ..." (golint)
    • deviceconnect/app/playback.go
    • Line 23: warning: exported const DefaultPlaybackSleepIntervalMs should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported type Playback should have comment or be unexported (golint)
    • Line 32: warning: exported function NewPlayback should have comment or be unexported (golint)
    • deviceconnect/store/mongo/control_reader.go
    • Line 37: warning: exported type ControlMessageReader should have comment or be unexported (golint)
    • Line 46: warning: exported function NewControlMessageReader should have comment or be unexported (golint)
    • Line 83: warning: exported method ControlMessageReader.Pop should have comment or be unexported (golint)
    • deviceconnect/api/http/management_filetransfer.go
    • Line 66: warning: exported const PropertyOffset should have comment (or a comment on this block) or be unexported (golint)
    • Line 380: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 456: warning: exported method ManagementController.DownloadFile should have comment or be unexported (golint)
    • Line 866: warning: exported method ManagementController.UploadFile should have comment or be unexported (golint)
    • deviceconnect/model/session.go
    • Line 37: warning: exported function GetSessionSubject should have comment or be unexported (golint)
    • Line 50: warning: exported function GetDeviceSubject should have comment or be unexported (golint)
    • Line 76: warning: exported method Session.Subject should have comment or be unexported (golint)
    • Line 80: warning: exported method Session.Validate should have comment or be unexported (golint)
    • deviceconnect/client/workflows/models.go
    • Line 24: warning: exported type AuditWorkflow should have comment or be unexported (golint)
    • Line 30: warning: exported type Action should have comment or be unexported (golint)
    • Line 33: warning: exported const ActionTerminalOpen should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported type ActorType should have comment or be unexported (golint)
    • Line 44: warning: exported const ActorUser should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported type Actor should have comment or be unexported (golint)
    • Line 54: warning: exported method Actor.Validate should have comment or be unexported (golint)
    • Line 76: warning: exported type ObjectType should have comment or be unexported (golint)
    • Line 78: warning: exported const ObjectDevice should have comment or be unexported (golint)
    • Line 80: warning: exported type Object should have comment or be unexported (golint)
    • Line 85: warning: exported method Object.Validate should have comment or be unexported (golint)
    • Line 96: warning: exported type AuditLog should have comment or be unexported (golint)
    • Line 105: warning: exported method AuditLog.Validate should have comment or be unexported (golint)
    • deviceconnect/store/mongo/datastore_mongo.go
    • Line 51: warning: exported var ErrUnknownControlMessageType should have comment or be unexported (golint)
    • Line 312: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 378: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 383: warning: comment on exported method DataStoreMongo.WriteSessionRecords should be of the form "WriteSessionRecords ..." (golint)
    • Line 531: warning: comment on exported method DataStoreMongo.InsertSessionRecording should be of the form "InsertSessionRecording ..." (golint)
    • Line 553: warning: comment on exported method DataStoreMongo.InsertControlRecording should be of the form "InsertControlRecording ..." (golint)
    • Line 583: warning: comment on exported method DataStoreMongo.DropDatabase should be of the form "DropDatabase ..." (golint)
    • deviceconnect/api/http/management.go
    • Line 78: warning: exported const PropertyUserID should have comment (or a comment on this block) or be unexported (golint)
    • Line 240: warning: exported method ManagementController.Playback should have comment or be unexported (golint)
    • Line 825: warning: exported method ManagementController.CheckUpdate should have comment or be unexported (golint)
    • Line 829: warning: exported method ManagementController.SendInventory should have comment or be unexported (golint)
    • deviceconnect/client/inventory/client.go
    • Line 1: warning: package comment should be of the form "Package inventory ..." (golint)
    • Line 34: warning: comment on exported type Client should be of the form "Client ..." (with optional leading article) (golint)
    • Line 47: warning: exported function NewClient should have comment or be unexported (golint)
    • deviceconnect/app/control.go
    • Line 24: warning: exported const ResizeMessage should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported var ErrUnknownMessage should have comment or be unexported (golint)
    • Line 32: warning: exported type Control should have comment or be unexported (golint)
    • Line 40: warning: exported method Control.MarshalBinary should have comment or be unexported (golint)
    • Line 66: warning: exported method Control.UnmarshalBinary should have comment or be unexported (golint)
    • deviceconnect/store/mongo/recording_writer.go
    • Line 24: warning: exported type RecordingWriter should have comment or be unexported (golint)
    • Line 29: warning: exported function NewRecordingWriter should have comment or be unexported (golint)
    • Line 49: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • deviceconnect/api/http/internal.go
    • Line 77: warning: exported method InternalController.CheckUpdate should have comment or be unexported (golint)
    • Line 81: warning: exported method InternalController.SendInventory should have comment or be unexported (golint)
    • deviceconnect/config/config.go
    • Line 83: warning: comment on exported const SettingRecordingExpireSec should be of the form "SettingRecordingExpireSec ..." (golint)
    • Line 86: warning: exported const SettingRecordingExpireDefault should have comment (or a comment on this block) or be unexported (golint)
    • deviceconnect/model/recording.go
    • Line 24: warning: exported const ResizeMessageTermHeightField should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type Recording should have comment or be unexported (golint)
    • deviceconnect/app/control_recorder.go
    • Line 26: warning: exported type ControlRecorder should have comment or be unexported (golint)
    • Line 36: warning: comment on exported const ControlRecorderBufferSize should be of the form "ControlRecorderBufferSize ..." (golint)
    • Line 40: warning: exported function NewControlRecorder should have comment or be unexported (golint)
    • Line 82: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • deviceconnect/app/recorder.go
    • Line 25: warning: exported type Recorder should have comment or be unexported (golint)
    • Line 34: warning: comment on exported const RecorderBufferSize should be of the form "RecorderBufferSize ..." (golint)
    • Line 41: warning: exported function NewRecorder should have comment or be unexported (golint)
    • Line 76: warning: if block ends with a return statement, so drop this else and outdent its block (golint)

gocyclo86%

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.

    • deviceconnect/api/http/management.go
    • Line 365: warning: cyclomatic complexity 19 of function (ManagementController).websocketWriter() is high (> 15) (gocyclo)
    • Line 698: warning: cyclomatic complexity 18 of function (ManagementController).connectServeWSProcessMessages() is high (> 15) (gocyclo)
    • deviceconnect/api/http/management_filetransfer.go
    • Line 362: warning: cyclomatic complexity 18 of function (ManagementController).downloadFileResponseProcessMessage() is high (> 15) (gocyclo)
    • Line 800: warning: cyclomatic complexity 17 of function (ManagementController).parseUploadFileRequest() is high (> 15) (gocyclo)
    • Line 713: warning: cyclomatic complexity 17 of function (ManagementController).uploadFileResponseWriter() is high (> 15) (gocyclo)

ineffassign94%

IneffAssign detects ineffectual assignments in Go code.

    • deviceconnect/api/http/management_filetransfer_test.go
    • Line 141: warning: ineffectual assignment to err (ineffassign)
    • Line 264: warning: ineffectual assignment to err (ineffassign)
    • Line 399: warning: ineffectual assignment to err (ineffassign)
    • Line 491: warning: ineffectual assignment to err (ineffassign)
    • Line 580: warning: ineffectual assignment to err (ineffassign)
    • Line 614: warning: ineffectual assignment to err (ineffassign)
    • Line 775: warning: ineffectual assignment to err (ineffassign)
    • Line 881: warning: ineffectual assignment to err (ineffassign)
    • Line 1352: warning: ineffectual assignment to msg (ineffassign)
    • Line 1618: warning: ineffectual assignment to err (ineffassign)
    • Line 1721: warning: ineffectual assignment to err (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!