Preparing report...

Report for github.com/yedamao/go_sgip

A+    Excellent!    Found 25 issues across 36 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!


gocyclo100%

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.

No problems detected. Good job!


golint36%

Golint is a linter for Go source code.

    • go_sgip/sgip/protocol/op_response.go
    • Line 8: warning: exported type RespStatus should have comment or be unexported (golint)
    • Line 10: warning: exported method RespStatus.Byte should have comment or be unexported (golint)
    • Line 14: warning: comment on exported type Response should be of the form "Response ..." (with optional leading article) (golint)
    • Line 21: warning: exported function NewResponse should have comment or be unexported (golint)
    • Line 39: warning: exported function ParseResponse should have comment or be unexported (golint)
    • Line 54: warning: exported method Response.GetHeader should have comment or be unexported (golint)
    • Line 58: warning: exported method Response.Serialize should have comment or be unexported (golint)
    • Line 67: warning: exported method Response.Ok should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/types.go
    • Line 10: warning: comment on exported type OctetString should be of the form "OctetString ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported method OctetString.Byte should be of the form "Byte ..." (golint)
    • go_sgip/sgip/errors/errors.go
    • Line 8: warning: error var SgipLenErr should have name of the form ErrFoo (golint)
    • Line 8: warning: exported var SgipLenErr should have comment or be unexported (golint)
    • Line 9: warning: error var SgipSizeErr should have name of the form ErrFoo (golint)
    • Line 10: warning: error var SgipUserCountErr should have name of the form ErrFoo (golint)
    • Line 11: warning: error var SgipBindRespErr should have name of the form ErrFoo (golint)
    • Line 12: warning: error var SgipMsgPartsLenErr should have name of the form ErrFoo (golint)
    • Line 13: warning: error var SgipBindErr should have name of the form ErrFoo (golint)
    • Line 14: warning: error var SgipWrongCmdId should have name of the form ErrFoo (golint)
    • go_sgip/sgip/protocol/op_bind.go
    • Line 8: warning: exported type Bind should have comment or be unexported (golint)
    • Line 17: warning: exported function NewBind should have comment or be unexported (golint)
    • Line 17: warning: don't use underscores in Go names; func parameter login_type should be loginType (golint)
    • Line 42: warning: exported function ParseBind should have comment or be unexported (golint)
    • Line 62: warning: exported method Bind.Serialize should have comment or be unexported (golint)
    • Line 73: warning: exported method Bind.Ok should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/op_deliver.go
    • Line 8: warning: exported type Deliver should have comment or be unexported (golint)
    • Line 14: warning: don't use underscores in Go names; struct field TP_pid should be TPPid (golint)
    • Line 15: warning: don't use underscores in Go names; struct field TP_udhi should be TPUdhi (golint)
    • Line 22: warning: exported function NewDeliver should have comment or be unexported (golint)
    • Line 26: warning: don't use underscores in Go names; func parameter TP_pid should be TPPid (golint)
    • Line 26: warning: don't use underscores in Go names; func parameter TP_udhi should be TPUdhi (golint)
    • Line 69: warning: exported function ParseDeliver should have comment or be unexported (golint)
    • Line 102: warning: exported method Deliver.Serialize should have comment or be unexported (golint)
    • Line 117: warning: exported method Deliver.Ok should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/op_report.go
    • Line 8: warning: exported type Report should have comment or be unexported (golint)
    • Line 20: warning: exported function NewReport should have comment or be unexported (golint)
    • Line 60: warning: exported function ParseReport should have comment or be unexported (golint)
    • Line 92: warning: exported method Report.Serialize should have comment or be unexported (golint)
    • Line 107: warning: exported method Report.Ok should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/utils.go
    • Line 8: warning: comment on exported function NodeId should be of the form "NodeId ..." (golint)
    • Line 40: warning: comment on exported function TimeStamp should be of the form "TimeStamp ..." (golint)
    • go_sgip/sgip/sgiptest/receiver_mock_handler.go
    • Line 11: warning: exported type MockHandler should have comment or be unexported (golint)
    • Line 13: warning: exported method MockHandler.OnBind should have comment or be unexported (golint)
    • Line 13: warning: don't use underscores in Go names; method parameter login_type should be loginType (golint)
    • Line 32: warning: exported method MockHandler.OnDeliver should have comment or be unexported (golint)
    • Line 33: warning: don't use underscores in Go names; method parameter TP_pid should be TPPid (golint)
    • Line 33: warning: don't use underscores in Go names; method parameter TP_udhi should be TPUdhi (golint)
    • Line 66: warning: exported method MockHandler.OnReport should have comment or be unexported (golint)
    • go_sgip/sgip/sgiptest/smg_client.go
    • Line 4: warning: should not use dot imports (golint)
    • Line 19: warning: exported function NewSMGClient should have comment or be unexported (golint)
    • Line 33: warning: exported method SMGClient.Bind should have comment or be unexported (golint)
    • Line 38: warning: exported method SMGClient.Deliver should have comment or be unexported (golint)
    • Line 38: warning: don't use underscores in Go names; method parameter TP_pid should be TPPid (golint)
    • Line 38: warning: don't use underscores in Go names; method parameter TP_udhi should be TPUdhi (golint)
    • Line 50: warning: exported method SMGClient.Report should have comment or be unexported (golint)
    • go_sgip/sgip/sgiptest/smg_server.go
    • Line 9: warning: exported type Server should have comment or be unexported (golint)
    • Line 15: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 33: warning: exported method Server.Run should have comment or be unexported (golint)
    • Line 57: warning: exported method Server.Stop should have comment or be unexported (golint)
    • go_sgip/sgip/session.go
    • Line 28: warning: exported function NewSession should have comment or be unexported (golint)
    • Line 43: warning: exported method Session.Run should have comment or be unexported (golint)
    • go_sgip/sgip/transmitter.go
    • Line 4: warning: should not use dot imports (golint)
    • Line 8: warning: exported type Transmitter should have comment or be unexported (golint)
    • Line 12: warning: exported function NewTransmitter should have comment or be unexported (golint)
    • Line 30: warning: exported method Transmitter.Bind should have comment or be unexported (golint)
    • Line 35: warning: exported method Transmitter.Submit should have comment or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; method parameter TP_udhi should be TPUdhi (golint)
    • go_sgip/sgip/conn/conn.go
    • Line 20: warning: comment on exported function NewConn should be of the form "NewConn ..." (golint)
    • Line 65: warning: exported method Conn.Close should have comment or be unexported (golint)
    • go_sgip/sgip/client/client.go
    • Line 23: warning: exported method Client.NewSeqNum should have comment or be unexported (golint)
    • Line 32: warning: exported method Client.Setup should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.Connect should have comment or be unexported (golint)
    • Line 55: warning: exported method Client.Bind should have comment or be unexported (golint)
    • Line 55: warning: don't use underscores in Go names; method parameter login_type should be loginType (golint)
    • Line 80: warning: exported method Client.Unbind should have comment or be unexported (golint)
    • Line 89: warning: exported method Client.UnbindResp should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/constants.go
    • Line 4: warning: exported const SGIP_VERSION should have comment (or a comment on this block) or be unexported (golint)
    • Line 6: warning: comment on exported const MAX_OP_SIZE should be of the form "MAX_OP_SIZE ..." (golint)
    • Line 9: warning: comment on exported const MAX_USER_COUNT should be of the form "MAX_USER_COUNT ..." (golint)
    • Line 35: warning: exported const SGIP_BIND_REP should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported const STAT_OK should have comment (or a comment on this block) or be unexported (golint)
    • go_sgip/sgip/protocol/header.go
    • Line 8: warning: exported type Header should have comment or be unexported (golint)
    • Line 17: warning: exported method Header.GetHeader should have comment or be unexported (golint)
    • Line 21: warning: exported method Header.Serialize should have comment or be unexported (golint)
    • Line 41: warning: exported method Header.Parse should have comment or be unexported (golint)
    • Line 53: warning: exported function ParseHeader should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/op_submit.go
    • Line 8: warning: exported type Submit should have comment or be unexported (golint)
    • Line 27: warning: don't use underscores in Go names; struct field TP_pid should be TPPid (golint)
    • Line 28: warning: don't use underscores in Go names; struct field TP_udhi should be TPUdhi (golint)
    • Line 36: warning: exported function NewSubmit should have comment or be unexported (golint)
    • Line 44: warning: don't use underscores in Go names; func parameter TP_pid should be TPPid (golint)
    • Line 44: warning: don't use underscores in Go names; func parameter TP_udhi should be TPUdhi (golint)
    • Line 125: warning: exported function ParseSubmit should have comment or be unexported (golint)
    • Line 204: warning: exported method Submit.Serialize should have comment or be unexported (golint)
    • Line 238: warning: exported method Submit.Ok should have comment or be unexported (golint)
    • go_sgip/sgip/receiver.go
    • Line 12: warning: exported type Handler should have comment or be unexported (golint)
    • Line 15: warning: don't use underscores in Go names; interface method parameter login_type should be loginType (golint)
    • Line 18: warning: don't use underscores in Go names; interface method parameter TP_pid should be TPPid (golint)
    • Line 18: warning: don't use underscores in Go names; interface method parameter TP_udhi should be TPUdhi (golint)
    • Line 44: warning: exported function NewReceiver should have comment or be unexported (golint)
    • Line 97: warning: exported method Receiver.Run should have comment or be unexported (golint)
    • Line 107: warning: exported method Receiver.Stop should have comment or be unexported (golint)
    • go_sgip/sgip/protocol/op_unbind.go
    • Line 8: warning: exported function NewUnbind should have comment or be unexported (golint)
    • Line 18: warning: exported function ParseUnbind should have comment or be unexported (golint)
    • Line 23: warning: exported method Unbind.Serialize should have comment or be unexported (golint)
    • Line 28: warning: exported method Unbind.Ok should have comment or be unexported (golint)
    • Line 42: warning: exported function NewUnbindResp should have comment or be unexported (golint)
    • Line 52: warning: exported function ParseUnbindResp should have comment or be unexported (golint)
    • Line 57: warning: exported method UnbindResp.Serialize should have comment or be unexported (golint)
    • Line 62: warning: exported method UnbindResp.Ok should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign83%

IneffAssign detects ineffectual assignments in Go code.


misspell91%

Misspell Finds commonly misspelled English words