Preparing report...

Report for github.com/chrislonng/starx

A    Great!    Found 36 issues across 55 files

Tweet

gofmt94%

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.

    • starx/cluster/rpc/proto_gen.go
    • Line 201: warning: cyclomatic complexity 20 of function (*Response).DecodeMsg() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 20 of function (*Response).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 140: warning: cyclomatic complexity 16 of function (*Request).UnmarshalMsg() is high (> 15) (gocyclo)
    • Line 12: warning: cyclomatic complexity 16 of function (*Request).DecodeMsg() is high (> 15) (gocyclo)
    • starx/remote.go
    • Line 132: warning: cyclomatic complexity 21 of function (*remoteService).processRequest() is high (> 15) (gocyclo)
    • starx/handler.go
    • Line 84: warning: cyclomatic complexity 16 of function (*handlerService).handle() is high (> 15) (gocyclo)

golint45%

Golint is a linter for Go source code.

    • starx/agent.go
    • Line 38: warning: exported var ErrRPCLocal should have comment or be unexported (golint)
    • starx/message/message.go
    • Line 12: warning: exported type MessageType should have comment or be unexported (golint)
    • Line 15: warning: exported const Request should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported var ErrWrongMessageType should have comment or be unexported (golint)
    • Line 46: warning: exported type Message should have comment or be unexported (golint)
    • Line 54: warning: exported function New should have comment or be unexported (golint)
    • Line 67: warning: exported method Message.Encode should have comment or be unexported (golint)
    • Line 134: warning: exported function Decode should have comment or be unexported (golint)
    • Line 189: warning: comment on exported function SetDict should be of the form "SetDict ..." (golint)
    • starx/cluster/rpc/client.go
    • Line 22: warning: exported var ErrShutdown should have comment or be unexported (golint)
    • Line 245: warning: comment on exported method Client.OnShutdown should be of the form "OnShutdown ..." (golint)
    • Line 250: warning: exported method Client.Close should have comment or be unexported (golint)
    • starx/cluster/rpc/server.go
    • Line 15: warning: exported var ErrNilResponse should have comment or be unexported (golint)
    • Line 64: warning: exported function WriteResponse should have comment or be unexported (golint)
    • starx/component/service.go
    • Line 9: warning: exported type HandlerMethod should have comment or be unexported (golint)
    • Line 17: warning: exported type RemoteMethod should have comment or be unexported (golint)
    • Line 24: warning: exported type Service should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method Service.ScanHandler should be of the form "ScanHandler ..." (golint)
    • Line 64: warning: comment on exported method Service.ScanRemote should be of the form "ScanRemote ..." (golint)
    • Line 93: warning: exported method HandlerMethod.NumCalls should have comment or be unexported (golint)
    • Line 100: warning: exported method RemoteMethod.NumCalls should have comment or be unexported (golint)
    • starx/packet/packet.go
    • Line 9: warning: exported type PacketType should have comment or be unexported (golint)
    • Line 13: warning: exported const Handshake should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported const HeadLength should have comment or be unexported (golint)
    • Line 22: warning: exported var ErrWrongPacketType should have comment or be unexported (golint)
    • Line 24: warning: exported type Packet should have comment or be unexported (golint)
    • Line 30: warning: exported function New should have comment or be unexported (golint)
    • Line 34: warning: exported method Packet.Pack should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function Pack should be of the form "Pack ..." (golint)
    • starx/serialize/json/json.go
    • Line 5: warning: exported type Serializer should have comment or be unexported (golint)
    • Line 7: warning: exported function NewSerializer should have comment or be unexported (golint)
    • Line 11: warning: exported method Serializer.Serialize should have comment or be unexported (golint)
    • Line 15: warning: exported method Serializer.Deserialize should have comment or be unexported (golint)
    • starx/log/log.go
    • Line 13: warning: exported type LogLevel should have comment or be unexported (golint)
    • Line 17: warning: exported const LevelDebug should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported const LogDebug should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported var ErrWrongLogLevel should have comment or be unexported (golint)
    • Line 72: warning: exported function Tracef should have comment or be unexported (golint)
    • Line 83: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 90: warning: exported function Infof should have comment or be unexported (golint)
    • Line 97: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 104: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 111: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 119: warning: exported function Trace should have comment or be unexported (golint)
    • Line 130: warning: exported function Debug should have comment or be unexported (golint)
    • Line 137: warning: exported function Info should have comment or be unexported (golint)
    • Line 144: warning: exported function Warn should have comment or be unexported (golint)
    • Line 151: warning: exported function Error should have comment or be unexported (golint)
    • Line 158: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 166: warning: exported function SetLevel should have comment or be unexported (golint)
    • Line 174: warning: exported function SetLevelByName should have comment or be unexported (golint)
    • starx/timer/timer.go
    • Line 7: warning: exported type Timer should have comment or be unexported (golint)
    • Line 14: warning: exported method Timer.Stop should have comment or be unexported (golint)
    • Line 18: warning: exported function Register should have comment or be unexported (golint)
    • Line 38: warning: exported function RegisterCount should have comment or be unexported (golint)
    • starx/cluster/manager.go
    • Line 10: warning: exported type Manager should have comment or be unexported (golint)
    • Line 15: warning: comment on exported method Manager.Init should be of the form "Init ..." (golint)
    • Line 20: warning: exported method Manager.AfterInit should have comment or be unexported (golint)
    • Line 21: warning: exported method Manager.BeforeShutdown should have comment or be unexported (golint)
    • Line 22: warning: exported method Manager.Shutdown should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method Manager.UpdateServer should be of the form "UpdateServer ..." (golint)
    • Line 35: warning: exported method Manager.RegisterServer should have comment or be unexported (golint)
    • Line 46: warning: exported method Manager.RemoveServer should have comment or be unexported (golint)
    • starx/route/route.go
    • Line 12: warning: exported var ErrRouteFieldCantEmpty should have comment or be unexported (golint)
    • Line 16: warning: exported type Route should have comment or be unexported (golint)
    • Line 22: warning: exported function NewRoute should have comment or be unexported (golint)
    • Line 30: warning: exported function Decode should have comment or be unexported (golint)
    • starx/cluster/call.go
    • Line 17: warning: comment on exported function Call should be of the form "Call ..." (golint)
    • Line 33: warning: exported function SessionClosed should have comment or be unexported (golint)
    • starx/session/session.go
    • Line 13: warning: exported type NetworkEntity should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrIllegalUID should have comment or be unexported (golint)
    • Line 29: warning: comment on exported type Session should be of the form "Session ..." (with optional leading article) (golint)
    • Line 45: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 56: warning: exported method Session.ServerID should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method Session.SetServerID should be of the form "SetServerID ..." (golint)
    • Line 81: warning: comment on exported method Session.Send should be of the form "Send ..." (golint)
    • Line 96: warning: exported method Session.Bind should have comment or be unexported (golint)
    • Line 105: warning: exported method Session.Call should have comment or be unexported (golint)
    • Line 112: warning: exported method Session.Close should have comment or be unexported (golint)
    • Line 116: warning: exported method Session.Remove should have comment or be unexported (golint)
    • Line 120: warning: exported method Session.Set should have comment or be unexported (golint)
    • Line 124: warning: exported method Session.HasKey should have comment or be unexported (golint)
    • Line 129: warning: exported method Session.Int should have comment or be unexported (golint)
    • Line 142: warning: exported method Session.Int8 should have comment or be unexported (golint)
    • Line 155: warning: exported method Session.Int16 should have comment or be unexported (golint)
    • Line 168: warning: exported method Session.Int32 should have comment or be unexported (golint)
    • Line 181: warning: exported method Session.Int64 should have comment or be unexported (golint)
    • Line 194: warning: exported method Session.Uint should have comment or be unexported (golint)
    • Line 207: warning: exported method Session.Uint8 should have comment or be unexported (golint)
    • Line 220: warning: exported method Session.Uint16 should have comment or be unexported (golint)
    • Line 233: warning: exported method Session.Uint32 should have comment or be unexported (golint)
    • Line 246: warning: exported method Session.Uint64 should have comment or be unexported (golint)
    • Line 259: warning: exported method Session.Float32 should have comment or be unexported (golint)
    • Line 272: warning: exported method Session.Float64 should have comment or be unexported (golint)
    • Line 298: warning: exported method Session.Value should have comment or be unexported (golint)
    • Line 302: warning: comment on exported method Session.State should be of the form "State ..." (golint)
    • Line 312: warning: exported method Session.Clear should have comment or be unexported (golint)
    • starx/examples/demo/chat/main.go
    • Line 13: warning: exported type Room should have comment or be unexported (golint)
    • Line 18: warning: exported type UserMessage should have comment or be unexported (golint)
    • Line 23: warning: exported type JoinResponse should have comment or be unexported (golint)
    • Line 28: warning: exported function NewRoom should have comment or be unexported (golint)
    • Line 34: warning: exported method Room.Join should have comment or be unexported (golint)
    • Line 40: warning: exported method Room.Message should have comment or be unexported (golint)
    • starx/cluster/rpc/proto.go
    • Line 3: warning: comment on exported type ResponseKind should be of the form "ResponseKind ..." (with optional leading article) (golint)
    • Line 7: warning: exported const HandlerResponse should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported type RpcKind should have comment or be unexported (golint)
    • Line 17: warning: exported const Sys should have comment (or a comment on this block) or be unexported (golint)
    • starx/channel.go
    • Line 10: warning: exported type Channel should have comment or be unexported (golint)
    • Line 23: warning: exported method Channel.Member should have comment or be unexported (golint)
    • Line 30: warning: exported method Channel.Members should have comment or be unexported (golint)
    • Line 37: warning: comment on exported method Channel.Multicast should be of the form "Multicast ..." (golint)
    • Line 62: warning: comment on exported method Channel.Broadcast should be of the form "Broadcast ..." (golint)
    • Line 84: warning: exported method Channel.IsContain should have comment or be unexported (golint)
    • Line 95: warning: exported method Channel.Add should have comment or be unexported (golint)
    • Line 103: warning: exported method Channel.Leave should have comment or be unexported (golint)
    • Line 122: warning: exported method Channel.LeaveAll should have comment or be unexported (golint)
    • Line 130: warning: exported method Channel.Count should have comment or be unexported (golint)
    • Line 137: warning: exported method Channel.Destroy should have comment or be unexported (golint)
    • starx/serialize/protobuf/protobuf.go
    • Line 9: warning: exported var ErrWrongValueType should have comment or be unexported (golint)
    • Line 11: warning: exported type Serializer should have comment or be unexported (golint)
    • Line 13: warning: exported function NewSerializer should have comment or be unexported (golint)
    • Line 17: warning: exported method Serializer.Serialize should have comment or be unexported (golint)
    • Line 25: warning: exported method Serializer.Deserialize should have comment or be unexported (golint)
    • starx/cluster/cluster.go
    • Line 28: warning: exported var ErrServerNotFound should have comment or be unexported (golint)
    • Line 31: warning: exported type SessionManager should have comment or be unexported (golint)
    • Line 41: warning: exported function DumpSvrIdMaps should have comment or be unexported (golint)
    • Line 50: warning: exported function DumpServers should have comment or be unexported (golint)
    • Line 65: warning: exported function Register should have comment or be unexported (golint)
    • Line 96: warning: exported function RemoveServer should have comment or be unexported (golint)
    • Line 134: warning: exported function Server should have comment or be unexported (golint)
    • Line 146: warning: exported function UpdateServer should have comment or be unexported (golint)
    • Line 159: warning: exported function CloseClient should have comment or be unexported (golint)
    • Line 176: warning: exported function ClientByType should have comment or be unexported (golint)
    • Line 178: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 206: warning: comment on exported function Client should be of the form "Client ..." (golint)
    • Line 221: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 273: warning: comment on exported function DumpClientIdMaps should be of the form "DumpClientIdMaps ..." (golint)
    • Line 278: warning: should omit 2nd value from range; this loop is equivalent to `for id := range ...` (golint)
    • Line 283: warning: exported function Close should have comment or be unexported (golint)
    • Line 295: warning: exported function SetAppConfig should have comment or be unexported (golint)
    • Line 299: warning: exported function SetSessionManager should have comment or be unexported (golint)
    • starx/component/base.go
    • Line 3: warning: exported type Base should have comment or be unexported (golint)
    • Line 5: warning: exported method Base.Init should have comment or be unexported (golint)
    • Line 6: warning: exported method Base.AfterInit should have comment or be unexported (golint)
    • Line 7: warning: exported method Base.BeforeShutdown should have comment or be unexported (golint)
    • Line 8: warning: exported method Base.Shutdown should have comment or be unexported (golint)
    • starx/group.go
    • Line 37: warning: exported type SessionFilter should have comment or be unexported (golint)
    • Line 40: warning: exported var ErrCloseClosedGroup should have comment or be unexported (golint)
    • Line 55: warning: exported function NewGroup should have comment or be unexported (golint)
    • Line 63: warning: exported method Group.Member should have comment or be unexported (golint)
    • Line 70: warning: exported method Group.Members should have comment or be unexported (golint)
    • Line 77: warning: comment on exported method Group.Multicast should be of the form "Multicast ..." (golint)
    • Line 106: warning: comment on exported method Group.Broadcast should be of the form "Broadcast ..." (golint)
    • Line 132: warning: exported method Group.IsContain should have comment or be unexported (golint)
    • Line 143: warning: exported method Group.Add should have comment or be unexported (golint)
    • Line 157: warning: exported method Group.Leave should have comment or be unexported (golint)
    • Line 182: warning: exported method Group.LeaveAll should have comment or be unexported (golint)
    • starx/cluster/rpc/proto_gen.go
    • Line 195: warning: exported method Request.Msgsize should have comment or be unexported (golint)
    • Line 428: warning: exported method Response.Msgsize should have comment or be unexported (golint)
    • Line 476: warning: exported method ResponseKind.Msgsize should have comment or be unexported (golint)
    • Line 524: warning: exported method RpcKind.Msgsize should have comment or be unexported (golint)
    • starx/serialize.go
    • Line 31: warning: comment on exported function SetSerializer should be of the form "SetSerializer ..." (golint)
    • starx/config.go
    • Line 38: warning: exported var VERSION should have comment or be unexported (golint)
    • Line 65: warning: exported type ServerInitFunc should have comment or be unexported (golint)
    • starx/transporter.go
    • Line 40: warning: exported var ErrSessionOnNotify should have comment or be unexported (golint)
    • Line 319: warning: comment on exported function OnSessionClosed should be of the form "OnSessionClosed ..." (golint)
    • starx/interface.go
    • Line 62: warning: exported function SetRouter should have comment or be unexported (golint)
    • Line 66: warning: exported function Register should have comment or be unexported (golint)
    • Line 70: warning: exported function SetServerID should have comment or be unexported (golint)
    • Line 78: warning: comment on exported function SetServersConfig should be of the form "SetServersConfig ..." (golint)
    • Line 87: warning: comment on exported function SetHeartbeatInternal should be of the form "SetHeartbeatInternal ..." (golint)
    • Line 113: warning: exported function Shutdown should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words