Preparing report...

Report for github.com/daotl/go-libp2p-collect

(v0.0.1)

A+    Excellent!    Found 12 issues across 26 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!


gocyclo96%

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.

    • basic.go
    • Line 205: warning: cyclomatic complexity 18 of function (*BasicPubSubCollector).topicHandle() is high (> 15) (gocyclo)

golint69%

Golint is a linter for Go source code.

    • pubsub/alias.go
    • Line 52: warning: exported type TopicWireListener should have comment or be unexported (golint)
    • Line 53: warning: exported type TopicMsgHandler should have comment or be unexported (golint)
    • error.go
    • Line 6: warning: exported var ErrTopicJoined should have comment or be unexported (golint)
    • hostwires.go
    • Line 16: warning: exported const HostWiresProcotolID should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type HostWires should have comment or be unexported (golint)
    • Line 26: warning: exported function NewHostWires should have comment or be unexported (golint)
    • Line 38: warning: exported method HostWires.ID should have comment or be unexported (golint)
    • Line 41: warning: exported method HostWires.Neighbors should have comment or be unexported (golint)
    • Line 44: warning: exported method HostWires.SetListener should have comment or be unexported (golint)
    • Line 48: warning: exported method HostWires.SendMsg should have comment or be unexported (golint)
    • Line 66: warning: exported method HostWires.SetMsgHandler should have comment or be unexported (golint)
    • Line 80: warning: exported method HostWires.Listen should have comment or be unexported (golint)
    • Line 81: warning: exported method HostWires.ListenClose should have comment or be unexported (golint)
    • Line 82: warning: exported method HostWires.Connected should have comment or be unexported (golint)
    • Line 83: warning: exported method HostWires.Disconnected should have comment or be unexported (golint)
    • Line 84: warning: exported method HostWires.OpenedStream should have comment or be unexported (golint)
    • Line 85: warning: exported method HostWires.ClosedStream should have comment or be unexported (golint)
    • hub.go
    • Line 9: warning: exported type TopicHub should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTopicHub should have comment or be unexported (golint)
    • Line 26: warning: exported method TopicHub.Wires should have comment or be unexported (golint)
    • Line 32: warning: exported method TopicHub.Join should have comment or be unexported (golint)
    • Line 36: warning: exported method TopicHub.JoinWithNotifiee should have comment or be unexported (golint)
    • Line 48: warning: exported method TopicHub.Leave should have comment or be unexported (golint)
    • Line 54: warning: exported method TopicHub.Close should have comment or be unexported (golint)
    • Line 74: warning: exported method TopicHub.HandlePeerUp should have comment or be unexported (golint)
    • Line 85: warning: exported method TopicHub.HandlePeerDown should have comment or be unexported (golint)
    • intbfs.go
    • Line 18: warning: exported const IntBFSProtocolID should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported function NewIntBFSCollector should have comment or be unexported (golint)
    • Line 55: warning: exported method IntBFSCollector.Join should have comment or be unexported (golint)
    • Line 99: warning: exported method IntBFSCollector.Publish should have comment or be unexported (golint)
    • Line 110: warning: exported method IntBFSCollector.Leave should have comment or be unexported (golint)
    • Line 125: warning: exported method IntBFSCollector.Close should have comment or be unexported (golint)
    • Line 139: warning: exported type Msg should have comment or be unexported (golint)
    • Line 144: warning: exported type PubReq should have comment or be unexported (golint)
    • Line 150: warning: exported type EvalReqReq should have comment or be unexported (golint)
    • Line 183: warning: exported function NewIntBFS should have comment or be unexported (golint)
    • Line 217: warning: exported method IntBFS.Publish should have comment or be unexported (golint)
    • Line 247: warning: exported method IntBFS.Close should have comment or be unexported (golint)
    • Line 326: warning: exported method IntBFS.HandlePeerDown should have comment or be unexported (golint)
    • Line 330: warning: exported method IntBFS.HandlePeerUp should have comment or be unexported (golint)
    • opt.go
    • Line 176: warning: exported function WithProfileFactory should have comment or be unexported (golint)
    • peerset.go
    • Line 9: warning: exported type PeerSet should have comment or be unexported (golint)
    • Line 14: warning: exported function NewPeerSet should have comment or be unexported (golint)
    • Line 21: warning: exported method PeerSet.Add should have comment or be unexported (golint)
    • Line 27: warning: exported method PeerSet.Del should have comment or be unexported (golint)
    • Line 33: warning: exported method PeerSet.Equal should have comment or be unexported (golint)
    • Line 65: warning: exported method PeerSet.Slice should have comment or be unexported (golint)
    • type.go
    • Line 49: warning: exported type TopicWires should have comment or be unexported (golint)
    • Line 61: warning: exported type Wires should have comment or be unexported (golint)
    • Line 72: warning: exported type WireListener should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign84%

IneffAssign detects ineffectual assignments in Go code.

    • basic.go
    • Line 229: warning: ineffectual assignment to err (ineffassign)
    • Line 229: warning: ineffectual assignment to err (ineffassign)
    • rcache.go
    • Line 143: warning: ineffectual assignment to err (ineffassign)
    • Line 143: warning: ineffectual assignment to err (ineffassign)
    • relay.go
    • Line 249: warning: ineffectual assignment to err (ineffassign)
    • Line 249: warning: ineffectual assignment to err (ineffassign)

misspell96%

Misspell Finds commonly misspelled English words

    • intbfs.go
    • Line 43: warning: "specifiy" is a misspelling of "specify" (misspell)