Preparing report...

Report for github.com/weibocom/motan-go

(v1.0.2)

A+    Excellent!    Found 29 issues across 137 files

Tweet

gofmt91%

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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo88%

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.

    • http/httpProxy.go
    • Line 416: warning: cyclomatic complexity 17 of function MotanRequestToFasthttpRequest() is high (> 15) (gocyclo)
    • tools/nginx/parser.go
    • Line 72: warning: cyclomatic complexity 47 of function (*Parser).readToken() is high (> 15) (gocyclo)
    • Line 303: warning: cyclomatic complexity 33 of function visitLocation() is high (> 15) (gocyclo)
    • serialize/simple.go
    • Line 66: warning: cyclomatic complexity 17 of function serializeBuf() is high (> 15) (gocyclo)
    • Line 158: warning: cyclomatic complexity 16 of function deSerializeBuf() is high (> 15) (gocyclo)
    • serialize/pb.go
    • Line 185: warning: cyclomatic complexity 37 of function (*PbSerialization).deSerializeBuf() is high (> 15) (gocyclo)
    • Line 107: warning: cyclomatic complexity 21 of function (*PbSerialization).serializeBuf() is high (> 15) (gocyclo)
    • core/bytes_test.go
    • Line 9: warning: cyclomatic complexity 23 of function TestWrite() is high (> 15) (gocyclo)
    • Line 103: warning: cyclomatic complexity 22 of function TestRead() is high (> 15) (gocyclo)
    • log/rotate.go
    • Line 318: warning: cyclomatic complexity 22 of function (*RotateWriter).millRunOnce() is high (> 15) (gocyclo)
    • lb/lb_test.go
    • Line 11: warning: cyclomatic complexity 21 of function TestWeightedLbWraper() is high (> 15) (gocyclo)
    • cluster/command.go
    • Line 323: warning: cyclomatic complexity 28 of function (*CommandRegistryWrapper).processCommand() is high (> 15) (gocyclo)
    • registry/zkRegistry.go
    • Line 309: warning: cyclomatic complexity 16 of function (*ZkRegistry).doSubscribeCommand() is high (> 15) (gocyclo)
    • Line 193: warning: cyclomatic complexity 16 of function (*ZkRegistry).doSubscribe() is high (> 15) (gocyclo)
    • agent.go
    • Line 258: warning: cyclomatic complexity 37 of function (*Agent).initParam() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words

    • server.go
    • Line 234: warning: "registed" is a misspelling of "registered" (misspell)
    • Line 240: warning: "registed" is a misspelling of "registered" (misspell)