Preparing report...

Report for github.com/celrenheit/sandglass

A    Great!    Found 31 issues across 45 files

Tweet

gofmt73%

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!


gocyclo91%

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.


golint35%

Golint is a linter for Go source code.

    • sandglass/watchy/watchy.go
    • Line 7: warning: exported type EventEmitter should have comment or be unexported (golint)
    • Line 12: warning: exported type Listener should have comment or be unexported (golint)
    • Line 17: warning: exported function New should have comment or be unexported (golint)
    • Line 23: warning: exported method EventEmitter.Emit should have comment or be unexported (golint)
    • Line 39: warning: exported method EventEmitter.Once should have comment or be unexported (golint)
    • Line 51: warning: exported method EventEmitter.On should have comment or be unexported (golint)
    • sandglass/cmd/sandctl/cmd/root.go
    • Line 27: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 41: warning: exported var Version should have comment or be unexported (golint)
    • sandglass/raft/raft.go
    • Line 31: warning: exported const CreateTopicOp should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported type Config should have comment or be unexported (golint)
    • Line 47: warning: exported type Store should have comment or be unexported (golint)
    • Line 84: warning: exported function New should have comment or be unexported (golint)
    • Line 96: warning: exported method Store.Init should have comment or be unexported (golint)
    • Line 310: warning: exported method Store.AddVoter should have comment or be unexported (golint)
    • Line 319: warning: exported method Store.RemoveServer should have comment or be unexported (golint)
    • Line 356: warning: exported method Store.AddNode should have comment or be unexported (golint)
    • Line 361: warning: exported method Store.RemoveNode should have comment or be unexported (golint)
    • Line 366: warning: exported method Store.Stop should have comment or be unexported (golint)
    • Line 376: warning: exported method Store.Leader should have comment or be unexported (golint)
    • Line 380: warning: exported method Store.IsLeader should have comment or be unexported (golint)
    • Line 384: warning: exported method Store.LeaderCh should have comment or be unexported (golint)
    • Line 388: warning: exported method Store.NewTopicChan should have comment or be unexported (golint)
    • Line 392: warning: exported method Store.GetTopics should have comment or be unexported (golint)
    • Line 419: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 450: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 466: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 487: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 511: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 537: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 567: warning: receiver name f should be consistent with previous receiver name s for fsm (golint)
    • Line 605: warning: exported method Store.GetHWMark should have comment or be unexported (golint)
    • Line 617: warning: exported method Store.CreateTopic should have comment or be unexported (golint)
    • Line 625: warning: exported method Store.SetPartitionLeaderOp should have comment or be unexported (golint)
    • Line 631: warning: exported method Store.GetTopic should have comment or be unexported (golint)
    • Line 642: warning: exported method Store.SetPartitionLeaderBulkOp should have comment or be unexported (golint)
    • Line 648: warning: exported method Store.GetPartitionLeader should have comment or be unexported (golint)
    • Line 664: warning: exported method Store.SetPartitionHWMark should have comment or be unexported (golint)
    • sandglass/broker/consumer_group.go
    • Line 20: warning: comment on exported var RedeliveryTimeout should be of the form "RedeliveryTimeout ..." (golint)
    • Line 22: warning: exported var MaxRedeliveryCount should have comment or be unexported (golint)
    • Line 25: warning: exported type ConsumerGroup should have comment or be unexported (golint)
    • Line 36: warning: exported function NewConsumerGroup should have comment or be unexported (golint)
    • Line 380: warning: exported method ConsumerGroup.Consume should have comment or be unexported (golint)
    • sandglass/broker/broker.go
    • Line 28: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 36: warning: exported const ConsumerOffsetTopicName should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported var DefaultStateCheckInterval should have comment or be unexported (golint)
    • Line 47: warning: exported type Config should have comment or be unexported (golint)
    • Line 64: warning: exported type Broker should have comment or be unexported (golint)
    • Line 88: warning: exported function New should have comment or be unexported (golint)
    • Line 135: warning: exported method Broker.Stop should have comment or be unexported (golint)
    • Line 197: warning: exported method Broker.Members should have comment or be unexported (golint)
    • Line 207: warning: exported method Broker.Conf should have comment or be unexported (golint)
    • Line 211: warning: exported method Broker.LaunchWatchers should have comment or be unexported (golint)
    • Line 253: warning: exported method Broker.Bootstrap should have comment or be unexported (golint)
    • Line 352: warning: exported method Broker.WaitForIt should have comment or be unexported (golint)
    • Line 406: warning: exported method Broker.Join should have comment or be unexported (golint)
    • Line 424: warning: exported method Broker.Name should have comment or be unexported (golint)
    • Line 504: warning: exported method Broker.TriggerSyncRequest should have comment or be unexported (golint)
    • Line 651: warning: exported method Broker.Topics should have comment or be unexported (golint)
    • sandglass/broker/controller.go
    • Line 12: warning: exported method Broker.IsController should have comment or be unexported (golint)
    • Line 16: warning: exported method Broker.GetController should have comment or be unexported (golint)
    • sandglass/broker/broker_topic.go
    • Line 18: warning: exported var ErrTopicAlreadyExist should have comment or be unexported (golint)
    • Line 49: warning: exported method Broker.CreateTopic should have comment or be unexported (golint)
    • sandglass/broker/service.go
    • Line 13: warning: exported method Broker.GetTopic should have comment or be unexported (golint)
    • Line 30: warning: exported method Broker.FetchFrom should have comment or be unexported (golint)
    • Line 43: warning: exported method Broker.FetchRange should have comment or be unexported (golint)
    • Line 49: warning: exported method Broker.ConsumeFromGroup should have comment or be unexported (golint)
    • Line 55: warning: exported method Broker.GetByKey should have comment or be unexported (golint)
    • Line 63: warning: exported method Broker.HasKey should have comment or be unexported (golint)
    • Line 78: warning: exported method Broker.Acknowledge should have comment or be unexported (golint)
    • Line 88: warning: exported method Broker.NotAcknowledge should have comment or be unexported (golint)
    • Line 98: warning: exported method Broker.Commit should have comment or be unexported (golint)
    • Line 108: warning: exported method Broker.MarkConsumed should have comment or be unexported (golint)
    • Line 118: warning: exported method Broker.Mark should have comment or be unexported (golint)
    • Line 125: warning: exported method Broker.LastOffset should have comment or be unexported (golint)
    • Line 132: warning: exported method Broker.FetchFromSync should have comment or be unexported (golint)
    • sandglass/storage/storage.go
    • Line 7: warning: exported var Separator should have comment or be unexported (golint)
    • Line 9: warning: exported type Storage should have comment or be unexported (golint)
    • Line 28: warning: exported type Entry should have comment or be unexported (golint)
    • Line 33: warning: exported type IterOptions should have comment or be unexported (golint)
    • Line 39: warning: exported type MergeOperator should have comment or be unexported (golint)
    • sandglass/storage/badger/badger.go
    • Line 13: warning: exported type Storage should have comment or be unexported (golint)
    • Line 19: warning: exported function NewStorage should have comment or be unexported (golint)
    • Line 54: warning: exported method Storage.Get should have comment or be unexported (golint)
    • Line 70: warning: exported method Storage.Put should have comment or be unexported (golint)
    • Line 74: warning: exported method Storage.BatchPut should have comment or be unexported (golint)
    • Line 86: warning: exported method Storage.Merge should have comment or be unexported (golint)
    • Line 90: warning: exported method Storage.ProcessMergedKey should have comment or be unexported (golint)
    • Line 117: warning: exported method Storage.Iter should have comment or be unexported (golint)
    • Line 126: warning: exported method Storage.IterReverse should have comment or be unexported (golint)
    • Line 134: warning: exported method Storage.Truncate should have comment or be unexported (golint)
    • Line 177: warning: exported method Storage.Delete should have comment or be unexported (golint)
    • Line 184: warning: exported method Storage.BatchDelete should have comment or be unexported (golint)
    • Line 197: warning: exported method Storage.Close should have comment or be unexported (golint)
    • sandglass/storage/scommons/base.go
    • Line 14: warning: exported var PendingPrefix should have comment or be unexported (golint)
    • Line 19: warning: exported type StorageCommons should have comment or be unexported (golint)
    • Line 23: warning: exported method StorageCommons.LastKeyForPrefix should have comment or be unexported (golint)
    • Line 43: warning: exported method StorageCommons.LastKVForPrefix should have comment or be unexported (golint)
    • Line 66: warning: exported method StorageCommons.ForEach should have comment or be unexported (golint)
    • Line 70: warning: exported method StorageCommons.ForRange should have comment or be unexported (golint)
    • Line 97: warning: exported method StorageCommons.ForEachWALEntry should have comment or be unexported (golint)
    • Line 128: warning: exported method StorageCommons.ForRangeWAL should have comment or be unexported (golint)
    • Line 170: warning: exported function Join should have comment or be unexported (golint)
    • sandglass/sgutils/testutils.go
    • Line 5: warning: exported function TestETCDAddr should have comment or be unexported (golint)
    • Line 14: warning: exported function AmIInDockerContainer should have comment or be unexported (golint)
    • sandglass/topic/partition.go
    • Line 26: warning: exported var ErrNoKeySet should have comment or be unexported (golint)
    • Line 29: warning: exported type Partition should have comment or be unexported (golint)
    • Line 56: warning: exported method Partition.InitStore should have comment or be unexported (golint)
    • Line 84: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 100: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 136: warning: exported method Partition.WalToView should have comment or be unexported (golint)
    • Line 136: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 180: warning: exported method Partition.GetMessage should have comment or be unexported (golint)
    • Line 180: warning: receiver name s should be consistent with previous receiver name t for Partition (golint)
    • Line 213: warning: receiver name s should be consistent with previous receiver name t for Partition (golint)
    • Line 218: warning: receiver name s should be consistent with previous receiver name t for Partition (golint)
    • Line 223: warning: exported method Partition.HasKey should have comment or be unexported (golint)
    • Line 257: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 263: warning: exported method Partition.PutMessage should have comment or be unexported (golint)
    • Line 267: warning: exported method Partition.BatchPutMessages should have comment or be unexported (golint)
    • Line 288: warning: exported method Partition.WALBatchPutMessages should have comment or be unexported (golint)
    • Line 288: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 309: warning: exported method Partition.ForRange should have comment or be unexported (golint)
    • Line 309: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 338: warning: exported method Partition.Close should have comment or be unexported (golint)
    • Line 338: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 346: warning: exported method Partition.Iter should have comment or be unexported (golint)
    • Line 346: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 353: warning: exported method Partition.RangeFromWAL should have comment or be unexported (golint)
    • Line 353: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 357: warning: exported method Partition.LastWALEntry should have comment or be unexported (golint)
    • Line 357: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 361: warning: exported method Partition.EndOfLog should have comment or be unexported (golint)
    • Line 361: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 375: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • Line 394: warning: exported method Partition.TruncateWALFrom should have comment or be unexported (golint)
    • Line 394: warning: receiver name p should be consistent with previous receiver name t for Partition (golint)
    • sandglass/broker/broker_fetch.go
    • Line 18: warning: exported method Broker.FetchRangeFn should have comment or be unexported (golint)
    • Line 74: warning: exported method Broker.EndOfLog should have comment or be unexported (golint)
    • Line 100: warning: exported method Broker.Get should have comment or be unexported (golint)
    • sandglass/broker/server.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 17: warning: exported type Server should have comment or be unexported (golint)
    • Line 28: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 37: warning: exported method Server.Start should have comment or be unexported (golint)
    • Line 69: warning: exported method Server.Shutdown should have comment or be unexported (golint)
    • sandglass/topic/topic.go
    • Line 18: warning: exported type Topic should have comment or be unexported (golint)
    • Line 30: warning: exported method Topic.Validate should have comment or be unexported (golint)
    • Line 44: warning: exported method Topic.InitStore should have comment or be unexported (golint)
    • Line 89: warning: exported method Topic.ListPartitions should have comment or be unexported (golint)
    • Line 91: warning: exported method Topic.GetPartition should have comment or be unexported (golint)
    • Line 101: warning: exported method Topic.ChoosePartitionForKey should have comment or be unexported (golint)
    • Line 114: warning: exported method Topic.ChoosePartition should have comment or be unexported (golint)
    • Line 127: warning: exported method Topic.ChooseRandomPartition should have comment or be unexported (golint)
    • Line 132: warning: exported method Topic.PutMessage should have comment or be unexported (golint)
    • Line 143: warning: exported method Topic.BatchPutMessages should have comment or be unexported (golint)
    • Line 162: warning: exported method Topic.Close should have comment or be unexported (golint)
    • Line 174: warning: exported method Topic.ForEach should have comment or be unexported (golint)
    • Line 178: warning: exported method Topic.ForRange should have comment or be unexported (golint)
    • sandglass/sgutils/sgutils.go
    • Line 10: warning: exported function MkdirIfNotExist should have comment or be unexported (golint)
    • Line 20: warning: exported function StringSliceHasString should have comment or be unexported (golint)
    • Line 30: warning: exported function CopyBytes should have comment or be unexported (golint)
    • Line 36: warning: exported function Hash should have comment or be unexported (golint)
    • Line 43: warning: exported function HashString should have comment or be unexported (golint)
    • sandglass/storage/rocksdb/rocksdb.go
    • Line 24: warning: exported type Store should have comment or be unexported (golint)
    • Line 29: warning: exported function NewStorage should have comment or be unexported (golint)
    • Line 48: warning: exported method Store.Get should have comment or be unexported (golint)
    • Line 64: warning: exported method Store.Put should have comment or be unexported (golint)
    • Line 70: warning: exported method Store.BatchPut should have comment or be unexported (golint)
    • Line 83: warning: exported method Store.Merge should have comment or be unexported (golint)
    • Line 90: warning: exported method Store.ProcessMergedKey should have comment or be unexported (golint)
    • Line 112: warning: exported method Store.Iter should have comment or be unexported (golint)
    • Line 120: warning: exported method Store.Truncate should have comment or be unexported (golint)
    • Line 168: warning: exported method Store.Delete should have comment or be unexported (golint)
    • Line 174: warning: exported method Store.BatchDelete should have comment or be unexported (golint)
    • Line 188: warning: exported method Store.Close should have comment or be unexported (golint)
    • sandglass/sandglass.go
    • Line 11: warning: exported type Node should have comment or be unexported (golint)
    • Line 24: warning: exported method Node.Dial should have comment or be unexported (golint)
    • Line 35: warning: exported method Node.Close should have comment or be unexported (golint)
    • Line 50: warning: exported method Node.IsAlive should have comment or be unexported (golint)
    • sandglass/integration/broker/broker_test.go
    • Line 690: warning: don't use underscores in Go names; var bind_addr should be bindAddr (golint)
    • Line 691: warning: don't use underscores in Go names; var advertise_addr should be advertiseAddr (golint)
    • Line 692: warning: don't use underscores in Go names; var gossip_port should be gossipPort (golint)
    • Line 694: warning: don't use underscores in Go names; var grpc_port should be grpcPort (golint)
    • Line 696: warning: don't use underscores in Go names; var http_port should be httpPort (golint)
    • Line 698: warning: don't use underscores in Go names; var raft_port should be raftPort (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter bind_addr should be bindAddr (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter adv_addr should be advAddr (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter gossip_port should be gossipPort (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter grpc_port should be grpcPort (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter http_port should be httpPort (golint)
    • Line 737: warning: don't use underscores in Go names; func parameter raft_port should be raftPort (golint)
    • sandglass/storage/iterator.go
    • Line 7: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 17: warning: exported type MessageIterator should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell86%

Misspell Finds commonly misspelled English words