Preparing report...

Report for github.com/mendersoftware/mender-connect

A+    Excellent!    Found 30 issues across 58 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo89%

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.

    • mender-connect/session/filetransfer.go
    • Line 549: warning: cyclomatic complexity 21 of function (*FileTransferHandler).writeFile() is high (> 15) (gocyclo)
    • Line 247: warning: cyclomatic complexity 20 of function (*FileTransferHandler).DownloadHandler() is high (> 15) (gocyclo)
    • Line 442: warning: cyclomatic complexity 16 of function (*FileTransferHandler).FileUploadHandler() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • mender-connect/procps/procps.go
    • Line 1: warning: package comment should be of the form "Package procps ..." (golint)
    • Line 25: warning: exported function ProcessExists should have comment or be unexported (golint)
    • Line 33: warning: exported function TerminateAndWait should have comment or be unexported (golint)
    • mender-connect/client/dbus/dbus.go
    • Line 23: warning: comment on exported type Handle should be of the form "Handle ..." (with optional leading article) (golint)
    • Line 25: warning: exported type MainLoop should have comment or be unexported (golint)
    • Line 39: warning: exported type SignalParams should have comment or be unexported (golint)
    • mender-connect/utils/fs.go
    • Line 27: warning: exported var ErrUnsupported should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function IsInChroot should be of the form "IsInChroot ..." (golint)
    • Line 36: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 41: warning: exported function IsRegularFile should have comment or be unexported (golint)
    • Line 45: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 50: warning: exported function FileOwnerMatches should have comment or be unexported (golint)
    • Line 57: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 62: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 68: warning: exported function FileGroupMatches should have comment or be unexported (golint)
    • Line 75: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 80: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 86: warning: exported function FileGetUidGid should have comment or be unexported (golint)
    • Line 97: warning: exported function FileExists should have comment or be unexported (golint)
    • Line 101: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 106: warning: exported function FileSize should have comment or be unexported (golint)
    • Line 110: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 115: warning: exported function FileModes should have comment or be unexported (golint)
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mender-connect/connectionmanager/connectionmanager.go
    • Line 43: warning: exported var ErrHandlerNotRegistered should have comment or be unexported (golint)
    • Line 48: warning: exported type ProtocolHandler should have comment or be unexported (golint)
    • Line 57: warning: exported var DefaultPingWait should have comment or be unexported (golint)
    • Line 59: warning: exported function GetWriteTimeout should have comment or be unexported (golint)
    • Line 63: warning: exported function SetReconnectIntervalSeconds should have comment or be unexported (golint)
    • Line 67: warning: context.Context should be the first parameter of a function (golint)
    • Line 100: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 113: warning: context.Context should be the first parameter of a function (golint)
    • Line 113: warning: exported function Connect should have comment or be unexported (golint)
    • Line 124: warning: context.Context should be the first parameter of a function (golint)
    • Line 124: warning: exported function Reconnect should have comment or be unexported (golint)
    • Line 138: warning: exported function Read should have comment or be unexported (golint)
    • Line 150: warning: exported function Write should have comment or be unexported (golint)
    • Line 165: warning: exported function Close should have comment or be unexported (golint)
    • mender-connect/limits/filetransfer/limits.go
    • Line 35: warning: exported var ErrChrootViolation should have comment or be unexported (golint)
    • Line 50: warning: exported type Counters should have comment or be unexported (golint)
    • Line 59: warning: exported type Permit should have comment or be unexported (golint)
    • Line 76: warning: exported function NewPermit should have comment or be unexported (golint)
    • Line 94: warning: exported method Permit.UploadFile should have comment or be unexported (golint)
    • Line 118: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 148: warning: exported method Permit.DownloadFile should have comment or be unexported (golint)
    • Line 193: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 210: warning: exported method Permit.BytesSent should have comment or be unexported (golint)
    • Line 239: warning: exported method Permit.BytesReceived should have comment or be unexported (golint)
    • Line 268: warning: exported method Permit.BelowMaxAllowedFileSize should have comment or be unexported (golint)
    • Line 279: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 284: warning: exported method Permit.PreserveModes should have comment or be unexported (golint)
    • Line 314: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 319: warning: exported method Permit.PreserveOwnerGroup should have comment or be unexported (golint)
    • Line 352: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 396: warning: exported function GetCounters should have comment or be unexported (golint)
    • mender-connect/config/config.go
    • Line 34: warning: exported type TerminalConfig should have comment or be unexported (golint)
    • Line 41: warning: exported type MenderClientConfig should have comment or be unexported (golint)
    • Line 46: warning: exported type FileTransferConfig should have comment or be unexported (golint)
    • Line 51: warning: exported type PortForwardConfig should have comment or be unexported (golint)
    • Line 56: warning: exported type SessionsConfig should have comment or be unexported (golint)
    • Line 67: warning: comment on exported type RateLimits should be of the form "RateLimits ..." (with optional leading article) (golint)
    • Line 79: warning: comment on exported type FileTransferLimits should be of the form "FileTransferLimits ..." (with optional leading article) (golint)
    • Line 113: warning: exported type Limits should have comment or be unexported (golint)
    • mender-connect/session/model/filetransfer.go
    • Line 22: warning: exported type UploadRequest should have comment or be unexported (golint)
    • Line 24: warning: exported method UploadRequest.Validate should have comment or be unexported (golint)
    • Line 30: warning: exported type StatFile should have comment or be unexported (golint)
    • Line 32: warning: exported method StatFile.Validate should have comment or be unexported (golint)
    • Line 38: warning: exported type GetFile should have comment or be unexported (golint)
    • Line 40: warning: exported method GetFile.Validate should have comment or be unexported (golint)
    • mender-connect/session/portforward.go
    • Line 43: warning: exported type MenderPortForwarder should have comment or be unexported (golint)
    • Line 55: warning: exported method MenderPortForwarder.Connect should have comment or be unexported (golint)
    • Line 77: warning: exported method MenderPortForwarder.Close should have comment or be unexported (golint)
    • Line 168: warning: exported type PortForwardHandler should have comment or be unexported (golint)
    • Line 172: warning: exported function PortForward should have comment or be unexported (golint)
    • Line 180: warning: exported method PortForwardHandler.Close should have comment or be unexported (golint)
    • Line 187: warning: exported method PortForwardHandler.ServeProtoMsg should have comment or be unexported (golint)
    • Line 300: 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 324: 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)
    • mender-connect/session/router.go
    • Line 25: warning: exported var ErrNoSession should have comment or be unexported (golint)
    • Line 29: warning: exported const MaxTraceback should have comment or be unexported (golint)
    • Line 31: warning: exported type ProtoRoutes should have comment or be unexported (golint)
    • Line 33: warning: comment on exported type Router should be of the form "Router ..." (with optional leading article) (golint)
    • Line 45: warning: exported function NewRouter should have comment or be unexported (golint)
    • mender-connect/shell/exec.go
    • Line 1: warning: package comment should be of the form "Package shell ..." (golint)
    • Line 30: warning: exported var ErrExecWriteBytesShort should have comment or be unexported (golint)
    • Line 35: warning: exported type MenderShell should have comment or be unexported (golint)
    • Line 42: warning: comment on exported function NewMenderShell should be of the form "NewMenderShell ..." (golint)
    • Line 56: warning: exported method MenderShell.GetWriteTimeout should have comment or be unexported (golint)
    • Line 60: warning: exported method MenderShell.Start should have comment or be unexported (golint)
    • Line 65: warning: exported method MenderShell.Stop should have comment or be unexported (golint)
    • Line 69: warning: exported method MenderShell.IsRunning should have comment or be unexported (golint)
    • mender-connect/connection/connection.go
    • Line 42: warning: exported type Connection should have comment or be unexported (golint)
    • Line 102: warning: comment on exported function NewConnection should be of the form "NewConnection ..." (golint)
    • Line 196: warning: exported method Connection.GetWriteTimeout should have comment or be unexported (golint)
    • Line 200: warning: exported method Connection.WriteMessage should have comment or be unexported (golint)
    • Line 211: warning: exported method Connection.ReadMessage should have comment or be unexported (golint)
    • Line 225: warning: exported method Connection.Close should have comment or be unexported (golint)
    • mender-connect/shell/shell.go
    • Line 1: warning: package comment should be of the form "Package shell ..." (golint)
    • Line 31: warning: exported function ExecuteShell should have comment or be unexported (golint)
    • Line 75: warning: exported function ResizeShell should have comment or be unexported (golint)
    • mender-connect/session/filetransfer.go
    • Line 40: warning: exported const ACKSlidingWindowSend should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported type FileTransferHandler should have comment or be unexported (golint)
    • Line 80: warning: exported method FileTransferHandler.Close should have comment or be unexported (golint)
    • Line 85: warning: exported method FileTransferHandler.ServeProtoMsg should have comment or be unexported (golint)
    • Line 131: warning: exported method FileTransferHandler.StatFile should have comment or be unexported (golint)
    • Line 204: warning: exported method FileTransferHandler.InitFileDownload should have comment or be unexported (golint)
    • Line 247: warning: exported method FileTransferHandler.DownloadHandler should have comment or be unexported (golint)
    • Line 356: warning: exported method FileTransferHandler.InitFileUpload should have comment or be unexported (golint)
    • Line 442: warning: exported method FileTransferHandler.FileUploadHandler should have comment or be unexported (golint)
    • Line 544: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 582: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mender-connect/config/version.go
    • Line 1: warning: package comment should be of the form "Package config ..." (golint)
    • Line 24: warning: exported const VersionUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported function VersionString should have comment or be unexported (golint)
    • Line 39: warning: exported function ShowVersionCLI should have comment or be unexported (golint)
    • Line 44: warning: exported function ShowVersion should have comment or be unexported (golint)
    • mender-connect/app/daemon.go
    • Line 1: warning: package comment should be of the form "Package app ..." (golint)
    • Line 42: warning: exported const EventReconnect should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported type MenderShellDaemonEvent should have comment or be unexported (golint)
    • Line 53: warning: exported type MenderShellDaemon should have comment or be unexported (golint)
    • Line 85: warning: exported function NewDaemon should have comment or be unexported (golint)
    • Line 145: warning: exported method MenderShellDaemon.StopDaemon should have comment or be unexported (golint)
    • Line 150: warning: exported method MenderShellDaemon.PrintStatus should have comment or be unexported (golint)
    • Line 172: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 186: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 396: warning: comment on exported method MenderShellDaemon.Run should be of the form "Run ..." (golint)
    • mender-connect/app/daemon_shell.go
    • Line 1: warning: package comment should be of the form "Package app ..." (golint)
    • Line 133: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 159: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mender-connect/session/session.go
    • Line 50: warning: exported type ResponseWriter should have comment or be unexported (golint)
    • Line 54: warning: exported type ResponseWriterFunc should have comment or be unexported (golint)
    • Line 56: warning: exported method ResponseWriterFunc.WriteProtoMsg should have comment or be unexported (golint)
    • Line 68: warning: exported type HandlerFunc should have comment or be unexported (golint)
    • Line 70: warning: exported method HandlerFunc.ServeProtoMsg should have comment or be unexported (golint)
    • Line 72: warning: exported method HandlerFunc.Close should have comment or be unexported (golint)
    • Line 86: warning: exported type Session should have comment or be unexported (golint)
    • Line 96: warning: exported function New should have comment or be unexported (golint)
    • Line 114: warning: exported method Session.Done should have comment or be unexported (golint)
    • Line 118: warning: exported method Session.MsgChan should have comment or be unexported (golint)
    • Line 147: warning: exported method Session.HandleControl should have comment or be unexported (golint)
    • Line 244: warning: exported method Session.Ping should have comment or be unexported (golint)
    • Line 291: warning: exported method Session.ListenAndServe should have comment or be unexported (golint)
    • Line 314: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mender-connect/session/shell.go
    • Line 34: warning: exported type MenderSessionType should have comment or be unexported (golint)
    • Line 37: warning: exported const ShellInteractiveSession should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported type MenderSessionStatus should have comment or be unexported (golint)
    • Line 46: warning: exported const ActiveSession should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported const NoExpirationTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 59: warning: exported var ErrSessionShellAlreadyRunning should have comment or be unexported (golint)
    • Line 70: warning: exported var MaxUserSessions should have comment or be unexported (golint)
    • Line 75: warning: exported type MenderShellTerminalSettings should have comment or be unexported (golint)
    • Line 85: warning: exported type MenderShellSession should have comment or be unexported (golint)
    • Line 129: warning: exported function NewMenderShellSession should have comment or be unexported (golint)
    • Line 163: warning: exported function MenderShellSessionGetCount should have comment or be unexported (golint)
    • Line 167: warning: exported function MenderShellSessionGetSessionIds should have comment or be unexported (golint)
    • Line 176: warning: exported function MenderShellSessionGetById should have comment or be unexported (golint)
    • Line 179: 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 184: warning: exported function MenderShellDeleteById should have comment or be unexported (golint)
    • Line 195: 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 200: warning: exported function MenderShellSessionsGetByUserId should have comment or be unexported (golint)
    • Line 203: 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 208: warning: exported function MenderShellStopByUserId should have comment or be unexported (golint)
    • Line 232: warning: exported function MenderSessionTerminateAll should have comment or be unexported (golint)
    • Line 255: warning: exported function MenderSessionTerminateExpired should have comment or be unexported (golint)
    • Line 282: warning: exported method MenderShellSession.GetStatus should have comment or be unexported (golint)
    • Line 286: warning: exported method MenderShellSession.GetStartedAtFmt should have comment or be unexported (golint)
    • Line 290: warning: exported method MenderShellSession.GetExpiresAtFmt should have comment or be unexported (golint)
    • Line 294: warning: exported method MenderShellSession.GetActiveAtFmt should have comment or be unexported (golint)
    • Line 298: warning: exported method MenderShellSession.GetShellCommandPath should have comment or be unexported (golint)
    • Line 302: warning: exported method MenderShellSession.StartShell should have comment or be unexported (golint)
    • Line 341: warning: exported method MenderShellSession.GetId should have comment or be unexported (golint)
    • Line 345: warning: exported method MenderShellSession.GetShellPid should have comment or be unexported (golint)
    • Line 349: warning: exported method MenderShellSession.IsExpired should have comment or be unexported (golint)
    • Line 404: warning: exported method MenderShellSession.HealthcheckPong should have comment or be unexported (golint)
    • Line 408: warning: exported method MenderShellSession.ShellCommand should have comment or be unexported (golint)
    • Line 424: warning: exported method MenderShellSession.ResizeShell should have comment or be unexported (golint)
    • Line 428: warning: exported method MenderShellSession.StopShell should have comment or be unexported (golint)
    • mender-connect/cli/cli.go
    • Line 1: warning: package comment should be of the form "Package cli ..." (golint)
    • Line 22: warning: exported function SetupCLI should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words