Preparing report...

Report for github.com/mochi-mqtt/server/v2

(v2.7.9)

A+    Excellent!    Found 10 issues across 78 files

Tweet

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!


gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

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.

    • packets/properties.go
    • Line 199: warning: cyclomatic complexity 70 of function (*Properties).Encode() is high (> 15) (gocyclo)
    • Line 366: warning: cyclomatic complexity 38 of function (*Properties).Decode() is high (> 15) (gocyclo)
    • clients.go
    • Line 526: warning: cyclomatic complexity 36 of function (*Client).WritePacket() is high (> 15) (gocyclo)
    • Line 465: warning: cyclomatic complexity 19 of function (*Client).ReadPacket() is high (> 15) (gocyclo)
    • server.go
    • Line 858: warning: cyclomatic complexity 32 of function (*Server).processPublish() is high (> 15) (gocyclo)
    • Line 1024: warning: cyclomatic complexity 25 of function (*Server).publishToClient() is high (> 15) (gocyclo)
    • Line 668: warning: cyclomatic complexity 21 of function (*Server).processPacket() is high (> 15) (gocyclo)
    • Line 406: warning: cyclomatic complexity 18 of function (*Server).attachClient() is high (> 15) (gocyclo)
    • Line 1241: warning: cyclomatic complexity 17 of function (*Server).processSubscribe() is high (> 15) (gocyclo)
    • packets/packets.go
    • Line 444: warning: cyclomatic complexity 24 of function (*Packet).ConnectValidate() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 18 of function (*Packet).ConnectDecode() is high (> 15) (gocyclo)
    • packets/packets_test.go
    • Line 210: warning: cyclomatic complexity 24 of function TestPacketDecode() is high (> 15) (gocyclo)
    • Line 143: warning: cyclomatic complexity 21 of function TestPacketEncode() is high (> 15) (gocyclo)
    • topics.go
    • Line 530: warning: cyclomatic complexity 22 of function (*TopicsIndex).scanMessages() is high (> 15) (gocyclo)
    • Line 707: warning: cyclomatic complexity 17 of function IsValidFilter() is high (> 15) (gocyclo)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


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!