Preparing report...

Report for github.com/go-ocf/go-coap

(v0.0.0-20200511140640-db6048acfdd3)

A+    Excellent!    Found 20 issues across 56 files

Tweet

gofmt91%

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!


gocyclo91%

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.

    • message.go
    • Line 230: warning: cyclomatic complexity 25 of function (MediaType).String() is high (> 15) (gocyclo)
    • Line 152: warning: cyclomatic complexity 21 of function (OptionID).String() is high (> 15) (gocyclo)
    • server.go
    • Line 412: warning: cyclomatic complexity 23 of function (*Server).activateAndServe() is high (> 15) (gocyclo)
    • Line 253: warning: cyclomatic complexity 21 of function (*Server).ListenAndServe() is high (> 15) (gocyclo)
    • blockwise.go
    • Line 571: warning: cyclomatic complexity 21 of function (*blockWiseReceiver).processResp() is high (> 15) (gocyclo)
    • Line 207: warning: cyclomatic complexity 18 of function (*blockWiseSender).processResp() is high (> 15) (gocyclo)
    • clientcommander.go
    • Line 230: warning: cyclomatic complexity 20 of function (*ClientCommander).ObserveWithContext() is high (> 15) (gocyclo)
    • client.go
    • Line 105: warning: cyclomatic complexity 39 of function (*Client).DialWithContext() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • client.go
    • Line 82: warning: exported method Client.Dial should have comment or be unexported (golint)
    • Line 331: warning: exported method ClientConn.Exchange should have comment or be unexported (golint)
    • Line 335: warning: comment on exported method ClientConn.ExchangeWithContext should be of the form "ExchangeWithContext ..." (golint)
    • Line 374: warning: exported method ClientConn.WriteMsg should have comment or be unexported (golint)
    • Line 378: warning: comment on exported method ClientConn.WriteMsgWithContext should be of the form "WriteMsgWithContext ..." (golint)
    • Line 390: warning: comment on exported method ClientConn.PingWithContext should be of the form "PingWithContext ..." (golint)
    • Line 395: warning: comment on exported method ClientConn.Get should be of the form "Get ..." (golint)
    • Line 400: warning: exported method ClientConn.GetWithContext should have comment or be unexported (golint)
    • Line 407: warning: exported method ClientConn.Post should have comment or be unexported (golint)
    • Line 411: warning: comment on exported method ClientConn.PostWithContext should be of the form "PostWithContext ..." (golint)
    • Line 419: warning: exported method ClientConn.Put should have comment or be unexported (golint)
    • Line 423: warning: comment on exported method ClientConn.PutWithContext should be of the form "PutWithContext ..." (golint)
    • Line 431: warning: exported method ClientConn.Delete should have comment or be unexported (golint)
    • Line 435: warning: comment on exported method ClientConn.DeleteWithContext should be of the form "DeleteWithContext ..." (golint)
    • Line 443: warning: exported method ClientConn.Observe should have comment or be unexported (golint)
    • Line 447: warning: exported method ClientConn.ObserveWithContext should have comment or be unexported (golint)
    • net/conn.go
    • Line 52: warning: comment on exported method Conn.WriteWithContext should be of the form "WriteWithContext ..." (golint)
    • Line 80: warning: comment on exported method Conn.ReadFullWithContext should be of the form "ReadFullWithContext ..." (golint)
    • Line 93: warning: comment on exported method Conn.ReadWithContext should be of the form "ReadWithContext ..." (golint)
    • clientcommander.go
    • Line 107: warning: comment on exported method ClientCommander.ExchangeWithContext should be of the form "ExchangeWithContext ..." (golint)
    • Line 121: warning: comment on exported method ClientCommander.WriteMsgWithContext should be of the form "WriteMsgWithContext ..." (golint)
    • Line 133: warning: comment on exported method ClientCommander.PingWithContext should be of the form "PingWithContext ..." (golint)
    • Line 143: warning: comment on exported method ClientCommander.GetWithContext should be of the form "GetWithContext ..." (golint)
    • Line 157: warning: comment on exported method ClientCommander.PostWithContext should be of the form "PostWithContext ..." (golint)
    • Line 171: warning: comment on exported method ClientCommander.PutWithContext should be of the form "PutWithContext ..." (golint)
    • Line 185: warning: comment on exported method ClientCommander.DeleteWithContext should be of the form "DeleteWithContext ..." (golint)
    • Line 202: warning: exported method Observation.Cancel should have comment or be unexported (golint)
    • Line 206: warning: comment on exported method Observation.CancelWithContext should be of the form "CancelWithContext ..." (golint)
    • Line 224: warning: exported method ClientCommander.Observe should have comment or be unexported (golint)
    • Line 228: warning: comment on exported method ClientCommander.ObserveWithContext should be of the form "ObserveWithContext ..." (golint)
    • net/connUDP.go
    • Line 28: warning: exported type ControlMessage should have comment or be unexported (golint)
    • net/tlslistener.go
    • Line 35: warning: comment on exported method TLSListener.AcceptWithContext should be of the form "AcceptWithContext ..." (golint)
    • keepalive.go
    • Line 13: warning: exported type RetryFunc should have comment or be unexported (golint)
    • Line 14: warning: exported type RetryFuncFactory should have comment or be unexported (golint)
    • message_test.go
    • Line 34: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • messagedgram.go
    • Line 18: warning: exported function NewDgramMessage should have comment or be unexported (golint)
    • Line 30: warning: exported method DgramMessage.MessageID should have comment or be unexported (golint)
    • Line 34: warning: comment on exported method DgramMessage.SetMessageID should be of the form "SetMessageID ..." (golint)
    • messagetcp.go
    • Line 15: warning: exported const TCP_MESSAGE_LEN13_BASE should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported const MaxMessageSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported const Custody should have comment (or a comment on this block) or be unexported (golint)
    • Line 103: warning: exported function NewTcpMessage should have comment or be unexported (golint)
    • Line 115: warning: exported method TcpMessage.MessageID should have comment or be unexported (golint)
    • Line 119: warning: comment on exported method TcpMessage.SetMessageID should be of the form "SetMessageID ..." (golint)
    • Line 124: warning: exported method TcpMessage.MarshalBinary should have comment or be unexported (golint)
    • Line 341: warning: exported method TcpMessage.ToBytesLength should have comment or be unexported (golint)
    • Line 359: warning: exported method TcpMessage.UnmarshalBinary should have comment or be unexported (golint)
    • Line 407: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • multicastClient.go
    • Line 14: warning: comment on exported type MulticastClientConn should be of the form "MulticastClientConn ..." (with optional leading article) (golint)
    • Line 71: warning: exported method MulticastClient.Dial should have comment or be unexported (golint)
    • Line 126: warning: comment on exported method MulticastClientConn.WriteMsgWithContext should be of the form "WriteMsgWithContext ..." (golint)
    • Line 154: warning: comment on exported method MulticastClientConn.PublishWithContext should be of the form "PublishWithContext ..." (golint)
    • request.go
    • Line 7: warning: exported type Request should have comment or be unexported (golint)
    • net/error.go
    • Line 3: warning: exported type Error should have comment or be unexported (golint)
    • Line 7: warning: exported const ErrServerClosed should have comment or be unexported (golint)
    • net/tcplistener.go
    • Line 41: warning: comment on exported method TCPListener.AcceptWithContext should be of the form "AcceptWithContext ..." (golint)
    • blockwise.go
    • Line 54: warning: exported function MarshalBlockOption should have comment or be unexported (golint)
    • Line 71: warning: exported function UnmarshalBlockOption should have comment or be unexported (golint)
    • message.go
    • Line 492: warning: exported method MessageBase.Type should have comment or be unexported (golint)
    • Line 496: warning: exported method MessageBase.SetType should have comment or be unexported (golint)
    • Line 500: warning: exported method MessageBase.Code should have comment or be unexported (golint)
    • Line 504: warning: exported method MessageBase.Token should have comment or be unexported (golint)
    • Line 508: warning: exported method MessageBase.Payload should have comment or be unexported (golint)
    • Line 512: warning: exported method MessageBase.AllOptions should have comment or be unexported (golint)
    • Line 601: warning: comment on exported method MessageBase.SetURIQuery should be of the form "SetURIQuery ..." (golint)
    • Line 606: warning: comment on exported method MessageBase.SetObserve should be of the form "SetObserve ..." (golint)
    • Line 611: warning: comment on exported method MessageBase.SetPayload should be of the form "SetPayload ..." (golint)
    • Line 616: warning: comment on exported method MessageBase.SetToken should be of the form "SetToken ..." (golint)
    • utils.go
    • Line 29: warning: comment on exported function CalcETag should be of the form "CalcETag ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.

    • server.go
    • Line 210: warning: ineffectual assignment to inUse (ineffassign)
    • Line 216: warning: ineffectual assignment to inUse (ineffassign)
    • Line 210: warning: ineffectual assignment to inUse (ineffassign)
    • Line 216: warning: ineffectual assignment to inUse (ineffassign)
    • messagetcp.go
    • Line 206: warning: ineffectual assignment to hdrOff (ineffassign)
    • Line 209: warning: ineffectual assignment to bufLen (ineffassign)
    • Line 206: warning: ineffectual assignment to hdrOff (ineffassign)
    • Line 209: warning: ineffectual assignment to bufLen (ineffassign)

misspell96%

Misspell Finds commonly misspelled English words