Preparing report...

Report for github.com/fanux/lhttp

A    Great!    Found 13 issues across 22 files

Tweet

gofmt81%

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.

    • lhttp/mq.go
    • Line 12: warning: exported type MqHandler should have comment or be unexported (golint)
    • Line 14: warning: exported type Mq should have comment or be unexported (golint)
    • Line 18: warning: exported method Mq.Publish should have comment or be unexported (golint)
    • Line 22: warning: exported method Mq.Subscribe should have comment or be unexported (golint)
    • Line 32: warning: exported method Mq.Unsubscribe should have comment or be unexported (golint)
    • Line 39: warning: exported function NewMq should have comment or be unexported (golint)
    • lhttp/client.go
    • Line 52: warning: don't use underscores in Go names; func parameter url_ should be url (golint)
    • lhttp/handlerHub.go
    • Line 3: warning: exported type HandlerHub should have comment or be unexported (golint)
    • Line 6: warning: exported method HandlerHub.Get should have comment or be unexported (golint)
    • Line 9: warning: exported method HandlerHub.Add should have comment or be unexported (golint)
    • Line 11: warning: exported method HandlerHub.Delete should have comment or be unexported (golint)
    • lhttp/lhttpDefine.go
    • Line 7: warning: comment on exported var HEADER_KEY_PUBLISH should be of the form "HEADER_KEY_PUBLISH ..." (golint)
    • Line 9: warning: comment on exported var HEADER_KEY_SUBSCRIBE should be of the form "HEADER_KEY_SUBSCRIBE ..." (golint)
    • Line 11: warning: comment on exported var HEADER_KEY_UNSUBSCRIBE should be of the form "HEADER_KEY_UNSUBSCRIBE ..." (golint)
    • Line 13: warning: comment on exported var HEADER_KEY_UPSTREAM should be of the form "HEADER_KEY_UPSTREAM ..." (golint)
    • Line 15: warning: comment on exported var HEADER_KEY_MULTIPART should be of the form "HEADER_KEY_MULTIPART ..." (golint)
    • Line 27: warning: exported var MaxLength should have comment or be unexported (golint)
    • Line 31: warning: comment on exported var UPSTREAM_HTTP_METHOD_GET should be of the form "UPSTREAM_HTTP_METHOD_GET ..." (golint)
    • Line 33: warning: comment on exported var UPSTREAM_HTTP_METHOD_POST should be of the form "UPSTREAM_HTTP_METHOD_POST ..." (golint)
    • Line 38: warning: comment on exported var ProcessorMax should be of the form "ProcessorMax ..." (golint)
    • lhttp/websocket_test.go
    • Line 152: warning: don't use underscores in Go names; var actual_msg should be actualMsg (golint)
    • Line 376: warning: don't use underscores in Go names; var small_msg should be smallMsg (golint)
    • Line 384: warning: don't use underscores in Go names; var second_msg should be secondMsg (golint)
    • lhttp/wsHandler.go
    • Line 10: warning: exported type WsMessage should have comment or be unexported (golint)
    • Line 78: warning: exported type WsHandler should have comment or be unexported (golint)
    • Line 85: warning: don't use underscores in Go names; struct field subscribe_nats_conn should be subscribeNatsConn (golint)
    • Line 105: warning: exported method WsHandler.GetMultipart should have comment or be unexported (golint)
    • Line 114: warning: exported method WsHandler.SetCommand should have comment or be unexported (golint)
    • Line 118: warning: exported method WsHandler.GetCommand should have comment or be unexported (golint)
    • Line 123: warning: exported method WsHandler.SetHeader should have comment or be unexported (golint)
    • Line 127: warning: exported method WsHandler.GetHeader should have comment or be unexported (golint)
    • Line 130: 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 135: warning: comment on exported method WsHandler.AddHeader should be of the form "AddHeader ..." (golint)
    • Line 141: warning: exported method WsHandler.GetBody should have comment or be unexported (golint)
    • Line 158: warning: comment on exported method WsHandler.Send should be of the form "Send ..." (golint)
    • Line 187: warning: exported type HandlerCallbacks should have comment or be unexported (golint)
    • Line 193: warning: exported type BaseProcessor should have comment or be unexported (golint)
    • Line 196: warning: exported method BaseProcessor.OnOpen should have comment or be unexported (golint)
    • Line 199: warning: exported method BaseProcessor.OnMessage should have comment or be unexported (golint)
    • Line 202: warning: exported method BaseProcessor.OnClose should have comment or be unexported (golint)
    • Line 206: warning: exported function StartServer should have comment or be unexported (golint)
    • lhttp/headerFilter.go
    • Line 1: warning: package comment should be of the form "Package lhttp ..." (golint)
    • Line 16: warning: exported type HeadFilterHandler should have comment or be unexported (golint)
    • Line 30: warning: exported type HeadFilterBase should have comment or be unexported (golint)
    • Line 32: warning: exported method HeadFilterBase.BeforeRequestFilterHandle should have comment or be unexported (golint)
    • Line 36: warning: exported method HeadFilterBase.AfterRequestFilterHandle should have comment or be unexported (golint)
    • Line 40: warning: exported method HeadFilterBase.OnOpenFilterHandle should have comment or be unexported (golint)
    • Line 44: warning: exported method HeadFilterBase.OnCloseFilterHandle should have comment or be unexported (golint)
    • Line 48: warning: exported function RegistHeadFilter should have comment or be unexported (golint)
    • lhttp/hybi.go
    • Line 40: warning: exported var ErrBadMaskingKey should have comment or be unexported (golint)
    • lhttp/processor.go
    • Line 5: warning: exported function Regist should have comment or be unexported (golint)
    • Line 15: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • lhttp/websocket.go
    • Line 18: warning: comment on exported const ProtocolVersionHybi13 should be of the form "ProtocolVersionHybi13 ..." (golint)
    • Line 20: warning: comment on exported const ProtocolVersionHybi should be of the form "ProtocolVersionHybi ..." (golint)
    • Line 22: warning: comment on exported const SupportedProtocolVersion should be of the form "SupportedProtocolVersion ..." (golint)
    • Line 25: warning: comment on exported const ContinuationFrame should be of the form "ContinuationFrame ..." (golint)
    • Line 27: warning: comment on exported const TextFrame should be of the form "TextFrame ..." (golint)
    • Line 29: warning: comment on exported const BinaryFrame should be of the form "BinaryFrame ..." (golint)
    • Line 31: warning: comment on exported const CloseFrame should be of the form "CloseFrame ..." (golint)
    • Line 33: warning: comment on exported const PingFrame should be of the form "PingFrame ..." (golint)
    • Line 35: warning: comment on exported const PongFrame should be of the form "PongFrame ..." (golint)
    • Line 37: warning: comment on exported const UnknownFrame should be of the form "UnknownFrame ..." (golint)
    • Line 49: warning: comment on exported var ErrBadProtocolVersion should be of the form "ErrBadProtocolVersion ..." (golint)
    • Line 51: warning: exported var ErrBadScheme should have comment or be unexported (golint)
    • Line 231: warning: comment on exported method Conn.IsClientConn should be of the form "IsClientConn ..." (golint)
    • Line 234: warning: comment on exported method Conn.IsServerConn should be of the form "IsServerConn ..." (golint)

gocyclo95%

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.

    • lhttp/hybi.go
    • Line 404: warning: cyclomatic complexity 17 of function hybiClientHandshake() is high (> 15) (gocyclo)

ineffassign90%

IneffAssign detects ineffectual assignments in Go code.


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!