Preparing report...

Report for github.com/alex023/eventbus

A    Great!    Found 14 issues across 15 files

Tweet

gofmt86%

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!


gocyclo100%

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.

No problems detected. Good job!


golint6%

Golint is a linter for Go source code.

    • eventbus/example/simple/main.go
    • Line 9: warning: exported type CountMessage should have comment or be unexported (golint)
    • Line 13: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 19: warning: exported method Consumer.HandleMessage should have comment or be unexported (golint)
    • eventbus/system.go
    • Line 16: warning: exported var ErrUnvaliableTopic should have comment or be unexported (golint)
    • Line 168: warning: exported method Bus.LoadFilter should have comment or be unexported (golint)
    • Line 187: warning: exported method Bus.UnloadFilter should have comment or be unexported (golint)
    • Line 235: warning: exported method Bus.Statistic should have comment or be unexported (golint)
    • eventbus/mailbox/queue_test.go
    • Line 10: warning: don't use underscores in Go names; const producer_num should be producerNum (golint)
    • Line 11: warning: don't use underscores in Go names; const consumer_num should be consumerNum (golint)
    • Line 12: warning: don't use underscores in Go names; const action_times should be actionTimes (golint)
    • Line 13: warning: don't use underscores in Go names; const action_duration should be actionDuration (golint)
    • eventbus/subscribe.go
    • Line 5: warning: exported type Subscribe should have comment or be unexported (golint)
    • Line 34: warning: should omit 2nd value from range; this loop is equivalent to `for topic := range ...` (golint)
    • eventbus/topic.go
    • Line 54: warning: exported method Topic.PostCmdMessage should have comment or be unexported (golint)
    • Line 61: warning: exported method Topic.PostUserMessage should have comment or be unexported (golint)
    • Line 82: warning: exported method Topic.ReceiveUserMessage should have comment or be unexported (golint)
    • Line 90: warning: should omit 2nd value from range; this loop is equivalent to `for filter := range ...` (golint)
    • Line 101: warning: exported method Topic.ReceiveCmdMessage should have comment or be unexported (golint)
    • Line 132: warning: should omit 2nd value from range; this loop is equivalent to `for filter := range ...` (golint)
    • Line 137: warning: should omit 2nd value from range; this loop is equivalent to `for id := range ...` (golint)
    • Line 142: warning: exported method Topic.Info should have comment or be unexported (golint)
    • eventbus/mailbox/dispatcher.go
    • Line 3: warning: exported type Dispatcher should have comment or be unexported (golint)
    • Line 18: warning: exported function NewDispatcher should have comment or be unexported (golint)
    • eventbus/mailbox/queue.go
    • Line 5: warning: exported type Queue should have comment or be unexported (golint)
    • Line 19: warning: exported method Queue.Post should have comment or be unexported (golint)
    • eventbus/example/benchmark/main.go
    • Line 11: warning: exported type ResultChan should have comment or be unexported (golint)
    • Line 15: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 20: warning: exported method Consumer.Count should have comment or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; var message_num should be messageNum (golint)
    • Line 36: warning: don't use underscores in Go names; var topic_num should be topicNum (golint)
    • Line 37: warning: don't use underscores in Go names; var consumer_num should be consumerNum (golint)
    • eventbus/example/watcher/main.go
    • Line 11: warning: exported type CountMessage should have comment or be unexported (golint)
    • Line 19: warning: exported method DivisorJudgment.HandleMessage should have comment or be unexported (golint)
    • Line 32: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 36: warning: exported method Consumer.Div should have comment or be unexported (golint)
    • Line 50: warning: exported type Watcher should have comment or be unexported (golint)
    • Line 58: warning: exported method Watcher.SetTopicName should have comment or be unexported (golint)
    • Line 61: warning: exported method Watcher.TopicSubscribe should have comment or be unexported (golint)
    • Line 64: warning: exported method Watcher.TopicUnscribe should have comment or be unexported (golint)
    • Line 67: warning: exported method Watcher.FilterLoad should have comment or be unexported (golint)
    • Line 70: warning: exported method Watcher.FilterUnload should have comment or be unexported (golint)
    • Line 73: warning: exported method Watcher.MessagePushed should have comment or be unexported (golint)
    • Line 77: warning: exported method Watcher.MessageReceived should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


misspell86%

Misspell Finds commonly misspelled English words