Preparing report...

Report for github.com/bigwhite/gocmpp

A+    Excellent!    Found 15 issues across 30 files

Tweet

gofmt93%

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!


gocyclo90%

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.

    • gocmpp/conn.go
    • Line 140: warning: cyclomatic complexity 44 of function (*Conn).RecvAndUnpackPkt() is high (> 15) (gocyclo)

golint63%

Golint is a linter for Go source code.

    • gocmpp/activetest.go
    • Line 24: warning: exported type CmppActiveTestReqPkt should have comment or be unexported (golint)
    • Line 28: warning: exported type CmppActiveTestRspPkt should have comment or be unexported (golint)
    • gocmpp/deliver.go
    • Line 33: warning: exported var ErrnoDeliverInvalidStruct should have comment or be unexported (golint)
    • Line 66: warning: exported type Cmpp2DeliverReqPkt should have comment or be unexported (golint)
    • Line 83: warning: exported type Cmpp2DeliverRspPkt should have comment or be unexported (golint)
    • Line 90: warning: exported type Cmpp3DeliverReqPkt should have comment or be unexported (golint)
    • Line 107: warning: exported type Cmpp3DeliverRspPkt should have comment or be unexported (golint)
    • gocmpp/fwd.go
    • Line 65: warning: exported type Cmpp2FwdReqPkt should have comment or be unexported (golint)
    • Line 97: warning: exported type Cmpp2FwdRspPkt should have comment or be unexported (golint)
    • Line 106: warning: exported type Cmpp3FwdReqPkt should have comment or be unexported (golint)
    • Line 145: warning: exported type Cmpp3FwdRspPkt should have comment or be unexported (golint)
    • gocmpp/packet.go
    • Line 24: warning: exported type Type should have comment or be unexported (golint)
    • Line 27: warning: exported const V30 should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported const CMPP_HEADER_LEN should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: comment on exported var ErrMethodParamsInvalid should be of the form "ErrMethodParamsInvalid ..." (golint)
    • Line 56: warning: comment on exported var ErrTotalLengthInvalid should be of the form "ErrTotalLengthInvalid ..." (golint)
    • Line 58: warning: exported var ErrCommandIdInvalid should have comment or be unexported (golint)
    • Line 59: warning: exported var ErrCommandIdNotSupported should have comment or be unexported (golint)
    • Line 61: warning: exported type CommandId should have comment or be unexported (golint)
    • Line 64: warning: exported const CMPP_RESPONSE_MIN should have its own declaration (golint)
    • Line 65: warning: exported const CMPP_CONNECT_RESP should have its own declaration (golint)
    • Line 66: warning: exported const CMPP_TERMINATE_RESP should have its own declaration (golint)
    • Line 68: warning: exported const CMPP_SUBMIT_RESP should have its own declaration (golint)
    • Line 69: warning: exported const CMPP_DELIVER_RESP should have its own declaration (golint)
    • Line 70: warning: exported const CMPP_QUERY_RESP should have its own declaration (golint)
    • Line 71: warning: exported const CMPP_CANCEL_RESP should have its own declaration (golint)
    • Line 72: warning: exported const CMPP_ACTIVE_TEST_RESP should have its own declaration (golint)
    • Line 73: warning: exported const CMPP_FWD_RESP should have its own declaration (golint)
    • Line 74: warning: exported const CMPP_MT_ROUTE_RESP should have its own declaration (golint)
    • Line 75: warning: exported const CMPP_MO_ROUTE_RESP should have its own declaration (golint)
    • Line 76: warning: exported const CMPP_GET_MT_ROUTE_RESP should have its own declaration (golint)
    • Line 77: warning: exported const CMPP_MT_ROUTE_UPDATE_RESP should have its own declaration (golint)
    • Line 78: warning: exported const CMPP_MO_ROUTE_UPDATE_RESP should have its own declaration (golint)
    • Line 79: warning: exported const CMPP_PUSH_MT_ROUTE_UPDATE_RESP should have its own declaration (golint)
    • Line 80: warning: exported const CMPP_PUSH_MO_ROUTE_UPDATE_RESP should have its own declaration (golint)
    • Line 81: warning: exported const CMPP_GET_MO_ROUTE_RESP should have its own declaration (golint)
    • Line 82: warning: exported const CMPP_RESPONSE_MAX should have its own declaration (golint)
    • Line 138: warning: exported type Packer should have comment or be unexported (golint)
    • Line 155: warning: exported function NewOpError should have comment or be unexported (golint)
    • Line 169: warning: exported method OpError.Cause should have comment or be unexported (golint)
    • Line 173: warning: exported method OpError.Op should have comment or be unexported (golint)
    • Line 373: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gocmpp/submit.go
    • Line 77: warning: exported type Cmpp2SubmitReqPkt should have comment or be unexported (golint)
    • Line 105: warning: exported type Cmpp2SubmitRspPkt should have comment or be unexported (golint)
    • Line 113: warning: exported type Cmpp3SubmitReqPkt should have comment or be unexported (golint)
    • Line 143: warning: exported type Cmpp3SubmitRspPkt should have comment or be unexported (golint)
    • gocmpp/utils/utils.go
    • Line 30: warning: exported var ErrInvalidUtf8Rune should have comment or be unexported (golint)
    • Line 32: warning: exported function IsBigEndian should have comment or be unexported (golint)
    • Line 46: warning: exported function Utf8ToUcs2 should have comment or be unexported (golint)
    • Line 60: warning: exported function Ucs2ToUtf8 should have comment or be unexported (golint)
    • Line 70: warning: exported function Utf8ToGB18030 should have comment or be unexported (golint)
    • Line 84: warning: exported function GB18030ToUtf8 should have comment or be unexported (golint)
    • Line 94: warning: exported function OctetString should have comment or be unexported (golint)
    • gocmpp/client.go
    • Line 22: warning: exported var ErrNotCompleted should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrRespNotMatch should have comment or be unexported (golint)
    • Line 32: warning: comment on exported function NewClient should be of the form "NewClient ..." (golint)
    • Line 107: warning: exported method Client.Disconnect should have comment or be unexported (golint)
    • gocmpp/conn.go
    • Line 25: warning: exported type State should have comment or be unexported (golint)
    • Line 43: warning: exported type Conn should have comment or be unexported (golint)
    • Line 72: warning: comment on exported function NewConn should be of the form "NewConn ..." (golint)
    • Line 87: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 98: warning: exported method Conn.SetState should have comment or be unexported (golint)
    • gocmpp/server.go
    • Line 34: warning: exported type Packet should have comment or be unexported (golint)
    • Line 39: warning: exported type Response should have comment or be unexported (golint)
    • Line 45: warning: exported type Handler should have comment or be unexported (golint)
    • Line 67: warning: exported type Server should have comment or be unexported (golint)
    • gocmpp/terminate.go
    • Line 24: warning: exported type CmppTerminateReqPkt should have comment or be unexported (golint)
    • Line 28: warning: exported type CmppTerminateRspPkt 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!