Preparing report...

Report for github.com/hprose/hprose-golang

A+    Excellent!    Found 32 issues across 144 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!


gocyclo93%

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.

    • hprose-golang/io/ptr_encoder.go
    • Line 88: warning: cyclomatic complexity 28 of function (*Encoder).writePtr() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 22 of function (*Encoder).fastWritePtr() is high (> 15) (gocyclo)
    • hprose-golang/io/encoder.go
    • Line 106: warning: cyclomatic complexity 27 of function (*Encoder).writeValue() is high (> 15) (gocyclo)
    • Line 55: warning: cyclomatic complexity 23 of function (*Encoder).fastWriteValue() is high (> 15) (gocyclo)
    • hprose-golang/io/decoder.go
    • Line 163: warning: cyclomatic complexity 26 of function (*Decoder).fastDecodePtr() is high (> 15) (gocyclo)
    • Line 107: warning: cyclomatic complexity 26 of function (*Decoder).fastDecode() is high (> 15) (gocyclo)
    • hprose-golang/io/slice_encoder.go
    • Line 59: warning: cyclomatic complexity 19 of function (*Encoder).write2dSliceBody() is high (> 15) (gocyclo)
    • Line 100: warning: cyclomatic complexity 18 of function (*Encoder).writeSliceBody() is high (> 15) (gocyclo)
    • hprose-golang/io/map_encoder.go
    • Line 96: warning: cyclomatic complexity 17 of function (*Encoder).writeInterfaceMapBody() is high (> 15) (gocyclo)
    • Line 57: warning: cyclomatic complexity 17 of function (*Encoder).writeStringMapBody() is high (> 15) (gocyclo)
    • Line 330: warning: cyclomatic complexity 17 of function (*Encoder).writeUintMapBody() is high (> 15) (gocyclo)
    • Line 174: warning: cyclomatic complexity 17 of function (*Encoder).writeInt8MapBody() is high (> 15) (gocyclo)
    • Line 135: warning: cyclomatic complexity 17 of function (*Encoder).writeIntMapBody() is high (> 15) (gocyclo)
    • Line 564: warning: cyclomatic complexity 17 of function (*Encoder).writeFloat64MapBody() is high (> 15) (gocyclo)
    • Line 213: warning: cyclomatic complexity 17 of function (*Encoder).writeInt16MapBody() is high (> 15) (gocyclo)
    • Line 525: warning: cyclomatic complexity 17 of function (*Encoder).writeFloat32MapBody() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 17 of function (*Encoder).writeInt32MapBody() is high (> 15) (gocyclo)
    • Line 291: warning: cyclomatic complexity 17 of function (*Encoder).writeInt64MapBody() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 17 of function (*Encoder).writeUint8MapBody() is high (> 15) (gocyclo)
    • Line 486: warning: cyclomatic complexity 17 of function (*Encoder).writeUint64MapBody() is high (> 15) (gocyclo)
    • Line 447: warning: cyclomatic complexity 17 of function (*Encoder).writeUint32MapBody() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 17 of function (*Encoder).writeUint16MapBody() is high (> 15) (gocyclo)

golint84%

Golint is a linter for Go source code.

    • hprose-golang/rpc/http/transport.go
    • Line 28: warning: exported type Transport should have comment or be unexported (golint)
    • Line 33: warning: exported method Transport.Transport should have comment or be unexported (golint)
    • Line 64: warning: exported method Transport.Abort should have comment or be unexported (golint)
    • Line 94: warning: exported function RegisterTransport should have comment or be unexported (golint)
    • hprose-golang/rpc/websocket/transport.go
    • Line 233: warning: exported type Transport should have comment or be unexported (golint)
    • Line 286: warning: exported method Transport.Transport should have comment or be unexported (golint)
    • Line 294: warning: exported method Transport.Abort should have comment or be unexported (golint)
    • Line 319: warning: exported function RegisterTransport should have comment or be unexported (golint)
    • hprose-golang/rpc/socket/handler.go
    • Line 27: warning: exported type Handler should have comment or be unexported (golint)
    • Line 185: warning: exported method Handler.Serve should have comment or be unexported (golint)
    • Line 227: warning: exported function RegisterHandler should have comment or be unexported (golint)
    • hprose-golang/rpc/socket/transport.go
    • Line 223: warning: exported type Transport should have comment or be unexported (golint)
    • Line 276: warning: exported method Transport.Transport should have comment or be unexported (golint)
    • Line 284: warning: exported method Transport.Abort should have comment or be unexported (golint)
    • Line 309: warning: exported function RegisterTransport should have comment or be unexported (golint)
    • hprose-golang/rpc/codec/jsonrpc/common.go
    • Line 18: warning: exported type Codec should have comment or be unexported (golint)
    • Line 33: warning: exported type Request should have comment or be unexported (golint)
    • Line 41: warning: exported type Error should have comment or be unexported (golint)
    • Line 47: warning: exported type Response should have comment or be unexported (golint)
    • hprose-golang/rpc/plugins/push/broker.go
    • Line 25: warning: exported type Broker should have comment or be unexported (golint)
    • Line 36: warning: exported function NewBroker should have comment or be unexported (golint)
    • Line 120: warning: exported method Broker.ID should have comment or be unexported (golint)
    • Line 207: warning: exported method Broker.Unicast should have comment or be unexported (golint)
    • Line 218: warning: exported method Broker.Multicast should have comment or be unexported (golint)
    • Line 226: warning: exported method Broker.Broadcast should have comment or be unexported (golint)
    • Line 243: warning: exported method Broker.Push should have comment or be unexported (golint)
    • Line 257: warning: exported method Broker.Deny should have comment or be unexported (golint)
    • Line 274: warning: exported method Broker.Exists should have comment or be unexported (golint)
    • Line 283: warning: exported method Broker.IdList should have comment or be unexported (golint)
    • hprose-golang/rpc/plugins/reverse/caller.go
    • Line 98: 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 108: 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 158: warning: exported type Caller should have comment or be unexported (golint)
    • Line 170: warning: exported function NewCaller should have comment or be unexported (golint)
    • Line 188: warning: exported method Caller.ID should have comment or be unexported (golint)
    • Line 288: warning: exported method Caller.Invoke should have comment or be unexported (golint)
    • Line 292: warning: exported method Caller.InvokeContext should have comment or be unexported (golint)
    • Line 336: warning: exported method Caller.UseService should have comment or be unexported (golint)
    • Line 344: warning: exported method Caller.Exists should have comment or be unexported (golint)
    • Line 348: warning: exported method Caller.IdList should have comment or be unexported (golint)
    • Line 357: warning: exported function UseService should have comment or be unexported (golint)
    • hprose-golang/rpc/websocket/handler.go
    • Line 30: warning: exported type Handler should have comment or be unexported (golint)
    • Line 212: warning: exported method Handler.Serve should have comment or be unexported (golint)
    • Line 262: warning: exported function RegisterHandler should have comment or be unexported (golint)
    • hprose-golang/rpc/mock/transport.go
    • Line 22: warning: exported type Transport should have comment or be unexported (golint)
    • Line 24: warning: exported method Transport.Transport should have comment or be unexported (golint)
    • Line 50: warning: exported method Transport.Abort should have comment or be unexported (golint)
    • Line 64: warning: exported function RegisterTransport should have comment or be unexported (golint)
    • hprose-golang/rpc/plugins/push/message.go
    • Line 22: warning: exported type Message should have comment or be unexported (golint)
    • Line 27: warning: exported type MessageCache should have comment or be unexported (golint)
    • Line 32: warning: exported method MessageCache.Append should have comment or be unexported (golint)
    • Line 38: warning: exported method MessageCache.Take should have comment or be unexported (golint)
    • hprose-golang/rpc/udp/handler.go
    • Line 24: warning: exported type Handler should have comment or be unexported (golint)
    • Line 158: warning: exported method Handler.Serve should have comment or be unexported (golint)
    • Line 197: warning: exported function RegisterHandler should have comment or be unexported (golint)
    • hprose-golang/rpc/udp/transport.go
    • Line 224: warning: exported type Transport should have comment or be unexported (golint)
    • Line 277: warning: exported method Transport.Transport should have comment or be unexported (golint)
    • Line 285: warning: exported method Transport.Abort should have comment or be unexported (golint)
    • Line 310: warning: exported function RegisterTransport should have comment or be unexported (golint)
    • hprose-golang/io/formatter.go
    • Line 16: warning: exported type Formatter should have comment or be unexported (golint)
    • Line 23: warning: exported method Formatter.Marshal should have comment or be unexported (golint)
    • Line 31: warning: exported method Formatter.Unmarshal should have comment or be unexported (golint)
    • Line 42: warning: exported function Marshal should have comment or be unexported (golint)
    • Line 46: warning: exported function Unmarshal should have comment or be unexported (golint)
    • hprose-golang/hprose.go
    • Line 33: warning: exported type Decoder should have comment or be unexported (golint)
    • Line 34: warning: exported type Encoder should have comment or be unexported (golint)
    • Line 35: warning: exported type Formatter should have comment or be unexported (golint)
    • Line 36: warning: exported type LongType should have comment or be unexported (golint)
    • Line 37: warning: exported type MapType should have comment or be unexported (golint)
    • Line 38: warning: exported type RealType should have comment or be unexported (golint)
    • Line 39: warning: exported type CastError should have comment or be unexported (golint)
    • Line 40: warning: exported type DecodeError should have comment or be unexported (golint)
    • Line 41: warning: exported type UnsupportedTypeError should have comment or be unexported (golint)
    • Line 42: warning: exported type ValueDecoder should have comment or be unexported (golint)
    • Line 43: warning: exported type ValueEncoder should have comment or be unexported (golint)
    • Line 45: warning: exported type Context should have comment or be unexported (golint)
    • Line 46: warning: exported type ClientContext should have comment or be unexported (golint)
    • Line 47: warning: exported type ServiceContext should have comment or be unexported (golint)
    • Line 48: warning: exported type InvalidRequestError should have comment or be unexported (golint)
    • Line 49: warning: exported type InvalidResponseError should have comment or be unexported (golint)
    • Line 50: warning: exported type PanicError should have comment or be unexported (golint)
    • Line 51: warning: exported type UnsupportedProtocolError should have comment or be unexported (golint)
    • Line 52: warning: exported type UnsupportedServerTypeError should have comment or be unexported (golint)
    • Line 53: warning: exported type NextIOHandler should have comment or be unexported (golint)
    • Line 54: warning: exported type NextInvokeHandler should have comment or be unexported (golint)
    • Line 55: warning: exported type Method should have comment or be unexported (golint)
    • Line 56: warning: exported type ClientCodec should have comment or be unexported (golint)
    • Line 57: warning: exported type ServiceCodec should have comment or be unexported (golint)
    • Line 58: warning: exported type CodecOption should have comment or be unexported (golint)
    • Line 59: warning: exported type Client should have comment or be unexported (golint)
    • Line 60: warning: exported type TransportGetter should have comment or be unexported (golint)
    • Line 61: warning: exported type Service should have comment or be unexported (golint)
    • Line 62: warning: exported type HandlerGetter should have comment or be unexported (golint)
    • Line 64: warning: exported type JSONRPCClientCodec should have comment or be unexported (golint)
    • Line 65: warning: exported type JSONRPCServiceCodec should have comment or be unexported (golint)
    • Line 67: warning: exported type CircuitBreaker should have comment or be unexported (golint)
    • Line 69: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 71: warning: exported type Forward should have comment or be unexported (golint)
    • Line 73: warning: exported type ConcurrentLimiter should have comment or be unexported (golint)
    • Line 74: warning: exported type RateLimiter should have comment or be unexported (golint)
    • Line 76: warning: exported type LeastActiveLoadBalance should have comment or be unexported (golint)
    • Line 77: warning: exported type NginxRoundRobinLoadBalance should have comment or be unexported (golint)
    • Line 78: warning: exported type RandomLoadBalance should have comment or be unexported (golint)
    • Line 79: warning: exported type RoundRobinLoadBalance should have comment or be unexported (golint)
    • Line 80: warning: exported type WeightedLeastActiveLoadBalance should have comment or be unexported (golint)
    • Line 81: warning: exported type WeightedRandomLoadBalance should have comment or be unexported (golint)
    • Line 82: warning: exported type WeightedRoundRobinLoadBalance should have comment or be unexported (golint)
    • Line 84: warning: exported type Log should have comment or be unexported (golint)
    • Line 86: warning: exported type Oneway should have comment or be unexported (golint)
    • Line 88: warning: exported type Broker should have comment or be unexported (golint)
    • Line 89: warning: exported type Message should have comment or be unexported (golint)
    • Line 90: warning: exported type Producer should have comment or be unexported (golint)
    • Line 91: warning: exported type Prosumer should have comment or be unexported (golint)
    • Line 93: warning: exported type Caller should have comment or be unexported (golint)
    • Line 94: warning: exported type ProviderContext should have comment or be unexported (golint)
    • Line 95: warning: exported type Provider should have comment or be unexported (golint)
    • Line 97: warning: exported type ExecuteTimeout should have comment or be unexported (golint)
    • Line 101: warning: comment on exported const TagInteger should be of the form "TagInteger ..." (golint)
    • Line 103: warning: exported const TagLong should have comment (or a comment on this block) or be unexported (golint)
    • Line 124: warning: comment on exported const TagPos should be of the form "TagPos ..." (golint)
    • Line 133: warning: comment on exported const TagHeader should be of the form "TagHeader ..." (golint)
    • Line 142: warning: exported var ErrInvalidUTF8 should have comment or be unexported (golint)
    • hprose-golang/rpc/plugins/push/prosumer.go
    • Line 25: warning: exported type Callback should have comment or be unexported (golint)
    • Line 27: warning: exported type Prosumer should have comment or be unexported (golint)
    • Line 48: warning: exported function NewProsumer should have comment or be unexported (golint)
    • Line 78: warning: exported method Prosumer.Client should have comment or be unexported (golint)
    • Line 82: warning: exported method Prosumer.ID should have comment or be unexported (golint)
    • Line 89: warning: exported method Prosumer.SetID should have comment or be unexported (golint)
    • Line 165: warning: exported method Prosumer.Subscribe should have comment or be unexported (golint)
    • Line 175: warning: exported method Prosumer.Unsubscribe should have comment or be unexported (golint)
    • Line 184: warning: exported method Prosumer.Unicast should have comment or be unexported (golint)
    • Line 188: warning: exported method Prosumer.Multicast should have comment or be unexported (golint)
    • Line 192: warning: exported method Prosumer.Broadcast should have comment or be unexported (golint)
    • Line 196: warning: exported method Prosumer.Push should have comment or be unexported (golint)
    • Line 210: warning: exported method Prosumer.Exists should have comment or be unexported (golint)
    • Line 217: warning: exported method Prosumer.IdList should have comment or be unexported (golint)
    • hprose-golang/rpc/plugins/reverse/provider.go
    • Line 30: warning: exported type ProviderContext should have comment or be unexported (golint)
    • Line 36: warning: exported function NewProviderContext should have comment or be unexported (golint)
    • Line 43: warning: exported method ProviderContext.Client should have comment or be unexported (golint)
    • Line 47: warning: exported method ProviderContext.Method should have comment or be unexported (golint)
    • Line 51: warning: exported method ProviderContext.Clone should have comment or be unexported (golint)
    • Line 67: warning: exported type Provider should have comment or be unexported (golint)
    • Line 84: warning: exported function NewProvider should have comment or be unexported (golint)
    • Line 106: warning: exported method Provider.Client should have comment or be unexported (golint)
    • Line 110: warning: exported method Provider.ID should have comment or be unexported (golint)
    • Line 117: warning: exported method Provider.SetID should have comment or be unexported (golint)
    • Line 121: warning: exported method Provider.Execute should have comment or be unexported (golint)
    • Line 191: 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 239: warning: exported method Provider.Listen should have comment or be unexported (golint)
    • Line 261: warning: exported method Provider.Close should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


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!