Preparing report...

Report for github.com/werunclub/rpcx

A+    Excellent!    Found 35 issues across 65 files

Tweet

gofmt96%

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!


gocyclo84%

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.

    • rpcx/client/xclient.go
    • Line 339: warning: cyclomatic complexity 32 of function (*xClient).Call() is high (> 15) (gocyclo)
    • Line 467: warning: cyclomatic complexity 20 of function (*xClient).SendRaw() is high (> 15) (gocyclo)
    • rpcx/server/service.go
    • Line 236: warning: cyclomatic complexity 22 of function suitableMethods() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 16 of function (*Server).registerFunction() is high (> 15) (gocyclo)
    • rpcx/client/client.go
    • Line 479: warning: cyclomatic complexity 24 of function (*Client).input() is high (> 15) (gocyclo)
    • Line 382: warning: cyclomatic complexity 17 of function (*Client).send() is high (> 15) (gocyclo)

golint78%

Golint is a linter for Go source code.

    • rpcx/log/logger.go
    • Line 14: warning: exported type Logger should have comment or be unexported (golint)
    • Line 34: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 38: warning: exported function SetDummyLogger should have comment or be unexported (golint)
    • Line 42: warning: exported function Debug should have comment or be unexported (golint)
    • Line 45: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 49: warning: exported function Info should have comment or be unexported (golint)
    • Line 52: warning: exported function Infof should have comment or be unexported (golint)
    • Line 56: warning: exported function Warn should have comment or be unexported (golint)
    • Line 59: warning: exported function Warnf should have comment or be unexported (golint)
    • Line 63: warning: exported function Error should have comment or be unexported (golint)
    • Line 66: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 70: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 73: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 77: warning: exported function Panic should have comment or be unexported (golint)
    • Line 80: warning: exported function Panicf should have comment or be unexported (golint)
    • rpcx/util/converter.go
    • Line 7: warning: exported function SliceByteToString should have comment or be unexported (golint)
    • Line 11: warning: exported function StringToSliceByte should have comment or be unexported (golint)
    • Line 17: warning: exported function CopyMeta should have comment or be unexported (golint)
    • rpcx/client/client.go
    • Line 24: warning: exported const XVersion should have comment (or a comment on this block) or be unexported (golint)
    • rpcx/client/peer2peer_discovery.go
    • Line 30: warning: exported method Peer2PeerDiscovery.RemoveWatcher should have comment or be unexported (golint)
    • Line 32: warning: exported method Peer2PeerDiscovery.Close should have comment or be unexported (golint)
    • rpcx/serverplugin/trace.go
    • Line 13: warning: exported type TracePlugin should have comment or be unexported (golint)
    • Line 16: warning: exported method TracePlugin.Register should have comment or be unexported (golint)
    • Line 23: warning: exported method TracePlugin.RegisterFunction should have comment or be unexported (golint)
    • Line 30: warning: exported function GetFunctionName should have comment or be unexported (golint)
    • Line 34: warning: exported method TracePlugin.PostConnAccept should have comment or be unexported (golint)
    • Line 41: warning: exported method TracePlugin.PostReadRequest should have comment or be unexported (golint)
    • Line 48: warning: exported method TracePlugin.PostWriteResponse should have comment or be unexported (golint)
    • rpcx/client/inprocess_discovery.go
    • Line 28: warning: exported method InprocessDiscovery.RemoveWatcher should have comment or be unexported (golint)
    • Line 31: warning: exported method InprocessDiscovery.Close should have comment or be unexported (golint)
    • rpcx/client/mdns_discovery.go
    • Line 78: warning: exported method MDNSDiscovery.RemoveWatcher should have comment or be unexported (golint)
    • Line 170: warning: exported method MDNSDiscovery.Close should have comment or be unexported (golint)
    • rpcx/client/etcd_discovery.go
    • Line 119: warning: exported method EtcdDiscovery.RemoveWatcher should have comment or be unexported (golint)
    • Line 224: warning: exported method EtcdDiscovery.Close should have comment or be unexported (golint)
    • rpcx/client/hash_utils.go
    • Line 35: warning: comment on exported type ConsistentAddrStrFunction should be of the form "ConsistentAddrStrFunction ..." (with optional leading article) (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign69%

IneffAssign detects ineffectual assignments in Go code.

    • rpcx/client/etcd_discovery.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/docker/libkv (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/docker/libkv/store (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/docker/libkv/store/etcd (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/docker/libkv (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/docker/libkv/store (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/docker/libkv/store/etcd (invalid package name: "") (ineffassign)
    • rpcx/client/client.go
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 17: warning: cannot find package "." in: (ineffassign)
    • Line 18: warning: cannot find package "." in: (ineffassign)
    • Line 19: warning: cannot find package "." in: (ineffassign)
    • Line 20: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: could not import github.com/rubyist/circuitbreaker (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • Line 18: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • Line 19: warning: could not import github.com/smallnest/rpcx/share (invalid package name: "") (ineffassign)
    • Line 20: warning: could not import github.com/smallnest/rpcx/util (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/rubyist/circuitbreaker (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • Line 18: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • Line 19: warning: could not import github.com/smallnest/rpcx/share (invalid package name: "") (ineffassign)
    • Line 20: warning: could not import github.com/smallnest/rpcx/util (invalid package name: "") (ineffassign)
    • rpcx/client/xclient.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import github.com/smallnest/rpcx/errors (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/smallnest/rpcx/errors (invalid package name: "") (ineffassign)
    • rpcx/server/listener_unix.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/kavu/go_reuseport (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/kavu/go_reuseport (invalid package name: "") (ineffassign)
    • rpcx/server/plugin.go
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: could not import github.com/smallnest/rpcx/errors (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/smallnest/rpcx/errors (invalid package name: "") (ineffassign)
    • rpcx/serverplugin/mdns.go
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: could not import github.com/grandcat/zeroconf (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/grandcat/zeroconf (invalid package name: "") (ineffassign)
    • rpcx/share/share.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import github.com/smallnest/rpcx/codec (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • rpcx/codec/codec.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/gogo/protobuf/proto (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/vmihailenco/msgpack (invalid package name: "") (ineffassign)
    • rpcx/serverplugin/etcd.go
    • Line 13: warning: cannot find package "." in: (ineffassign)
    • Line 14: warning: cannot find package "." in: (ineffassign)
    • Line 15: warning: cannot find package "." in: (ineffassign)
    • Line 16: warning: cannot find package "." in: (ineffassign)
    • Line 17: warning: cannot find package "." in: (ineffassign)
    • Line 13: warning: could not import github.com/docker/libkv (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/docker/libkv/store (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/docker/libkv/store/etcd (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/rcrowley/go-metrics (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • Line 13: warning: could not import github.com/docker/libkv (invalid package name: "") (ineffassign)
    • Line 14: warning: could not import github.com/docker/libkv/store (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/docker/libkv/store/etcd (invalid package name: "") (ineffassign)
    • Line 16: warning: could not import github.com/rcrowley/go-metrics (invalid package name: "") (ineffassign)
    • Line 17: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • rpcx/protocol/message.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/smallnest/rpcx/util (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/smallnest/rpcx/util (invalid package name: "") (ineffassign)
    • rpcx/tool/xgen/xgen.go
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: could not import github.com/smallnest/rpcx/tool/xgen/parser (invalid package name: "") (ineffassign)
    • rpcx/server/converter.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/smallnest/rpcx/share (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/smallnest/rpcx/share (invalid package name: "") (ineffassign)
    • rpcx/serverplugin/rate_limiting.go
    • Line 7: warning: cannot find package "." in: (ineffassign)
    • Line 7: warning: could not import github.com/juju/ratelimit (invalid package name: "") (ineffassign)
    • Line 7: warning: could not import github.com/juju/ratelimit (invalid package name: "") (ineffassign)
    • rpcx/serverplugin/alias.go
    • Line 6: warning: cannot find package "." in: (ineffassign)
    • Line 6: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • Line 6: warning: could not import github.com/smallnest/rpcx/protocol (invalid package name: "") (ineffassign)
    • rpcx/client/client_test.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/smallnest/rpcx/_testutils (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/smallnest/rpcx/server (invalid package name: "") (ineffassign)
    • Line 31: warning: undeclared name: testutils (ineffassign)
    • Line 31: warning: undeclared name: testutils (ineffassign)
    • Line 89: warning: undeclared name: testutils (ineffassign)
    • Line 93: warning: undeclared name: testutils (ineffassign)
    • Line 8: warning: "github.com/smallnest/rpcx/_testutils" imported but not used (ineffassign)
    • rpcx/server/gateway.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 15: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import github.com/julienschmidt/httprouter (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/soheilhy/cmux (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/julienschmidt/httprouter (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/smallnest/rpcx/log (invalid package name: "") (ineffassign)
    • Line 15: warning: could not import github.com/soheilhy/cmux (invalid package name: "") (ineffassign)
    • rpcx/serverplugin/metrics.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 12: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/rcrowley/go-metrics/exp (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/smallnest/rpcx/server (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/vrischmann/go-metrics-influxdb (invalid package name: "") (ineffassign)
    • Line 21: warning: undeclared name: metrics (ineffassign)
    • Line 26: warning: undeclared name: metrics (ineffassign)
    • Line 96: warning: undeclared name: metrics (ineffassign)
    • Line 36: warning: undeclared name: metrics (ineffassign)
    • Line 43: warning: undeclared name: metrics (ineffassign)
    • Line 61: warning: undeclared name: metrics (ineffassign)
    • Line 75: warning: undeclared name: metrics (ineffassign)
    • Line 84: warning: undeclared name: metrics (ineffassign)
    • Line 85: warning: undeclared name: metrics (ineffassign)
    • Line 97: warning: undeclared name: metrics (ineffassign)
    • Line 106: warning: undeclared name: metrics (ineffassign)
    • Line 120: warning: undeclared name: metrics (ineffassign)
    • Line 8: warning: "github.com/rcrowley/go-metrics" imported but not used (ineffassign)
    • Line 9: warning: could not import github.com/rcrowley/go-metrics/exp (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/smallnest/rpcx/server (invalid package name: "") (ineffassign)
    • Line 12: warning: could not import github.com/vrischmann/go-metrics-influxdb (invalid package name: "") (ineffassign)
    • Line 21: warning: undeclared name: metrics (ineffassign)
    • Line 26: warning: undeclared name: metrics (ineffassign)
    • Line 96: warning: undeclared name: metrics (ineffassign)
    • Line 36: warning: undeclared name: metrics (ineffassign)
    • Line 43: warning: undeclared name: metrics (ineffassign)
    • Line 61: warning: undeclared name: metrics (ineffassign)
    • Line 75: warning: undeclared name: metrics (ineffassign)
    • Line 84: warning: undeclared name: metrics (ineffassign)
    • Line 85: warning: undeclared name: metrics (ineffassign)
    • Line 97: warning: undeclared name: metrics (ineffassign)
    • Line 106: warning: undeclared name: metrics (ineffassign)
    • Line 120: warning: undeclared name: metrics (ineffassign)
    • Line 8: warning: "github.com/rcrowley/go-metrics" imported but not used (ineffassign)
    • rpcx/client/mdns_discovery.go
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: could not import github.com/grandcat/zeroconf (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/grandcat/zeroconf (invalid package name: "") (ineffassign)
    • rpcx/client/selector.go
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: could not import github.com/valyala/fastrand (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/valyala/fastrand (invalid package name: "") (ineffassign)

misspell98%

Misspell Finds commonly misspelled English words

    • rpcx/tool/xgen/xgen.go
    • Line 160: warning: "registery" is a misspelling of "registry" (misspell)
    • Line 170: warning: "registery" is a misspelling of "registry" (misspell)
    • Line 180: warning: "registery" is a misspelling of "registry" (misspell)