Preparing report...

Report for github.com/buraksezer/olricdb

A+    Excellent!    Found 71 issues across 190 files

Tweet

gofmt98%

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!


gocyclo94%

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.

    • olricdb/config/load.go
    • Line 126: warning: cyclomatic complexity 30 of function loadMemberlistConfig() is high (> 15) (gocyclo)
    • Line 240: warning: cyclomatic complexity 23 of function Load() is high (> 15) (gocyclo)
    • olricdb/client/pipeline_test.go
    • Line 157: warning: cyclomatic complexity 18 of function TestPipeline_Delete() is high (> 15) (gocyclo)
    • Line 422: warning: cyclomatic complexity 17 of function TestPipeline_Expire() is high (> 15) (gocyclo)
    • Line 293: warning: cyclomatic complexity 16 of function TestPipeline_GetPut() is high (> 15) (gocyclo)
    • Line 491: warning: cyclomatic complexity 16 of function TestPipeline_PutIf() is high (> 15) (gocyclo)

golint67%

Golint is a linter for Go source code.

    • olricdb/internal/cluster/routingtable/members.go
    • Line 24: warning: exported type Members should have comment or be unexported (golint)
    • Line 35: warning: exported method Members.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method Members.Get should have comment or be unexported (golint)
    • Line 47: warning: exported method Members.Delete should have comment or be unexported (golint)
    • Line 51: warning: exported method Members.DeleteByName should have comment or be unexported (golint)
    • Line 59: warning: exported method Members.Length should have comment or be unexported (golint)
    • Line 63: warning: exported method Members.Range should have comment or be unexported (golint)
    • olricdb/cmd/olric-stats/query/query.go
    • Line 29: warning: exported type Query should have comment or be unexported (golint)
    • Line 35: warning: exported function New should have comment or be unexported (golint)
    • Line 94: warning: exported method Query.PrintRawStats should have comment or be unexported (golint)
    • Line 125: warning: exported method Query.PrintPartitionStats should have comment or be unexported (golint)
    • Line 143: warning: exported method Query.Dump should have comment or be unexported (golint)
    • Line 156: warning: exported method Query.PrintRuntimeStats should have comment or be unexported (golint)
    • olricdb/internal/discovery/discovery.go
    • Line 55: warning: exported method ClusterEvent.MemberAddr should have comment or be unexported (golint)
    • Line 217: warning: exported method Discovery.Start should have comment or be unexported (golint)
    • Line 277: warning: exported method Discovery.Rejoin should have comment or be unexported (golint)
    • Line 297: warning: exported method Discovery.NumMembers should have comment or be unexported (golint)
    • olricdb/internal/testolric/testolric.go
    • Line 33: warning: exported type TestOlric should have comment or be unexported (golint)
    • Line 38: warning: exported method TestOlric.Olric should have comment or be unexported (golint)
    • Line 42: warning: exported function New should have comment or be unexported (golint)
    • olricdb/stats.go
    • Line 169: warning: exported type StatsOption should have comment or be unexported (golint)
    • Line 171: warning: exported function CollectRuntime should have comment or be unexported (golint)
    • olricdb/internal/cluster/partitions/partitions.go
    • Line 23: warning: exported type Kind should have comment or be unexported (golint)
    • Line 36: warning: exported const PRIMARY should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported type Partitions should have comment or be unexported (golint)
    • Line 46: warning: exported function New should have comment or be unexported (golint)
    • Line 84: warning: comment on exported method Partitions.PartitionOwnersById should be of the form "PartitionOwnersById ..." (golint)
    • olricdb/cmd/olric-cli/cli/color.go
    • Line 29: warning: comment on exported var ColorResetEscape should be of the form "ColorResetEscape ..." (golint)
    • Line 32: warning: comment on exported function ColorEscape should be of the form "ColorEscape ..." (golint)
    • olricdb/internal/kvstore/kvstore.go
    • Line 43: warning: exported function DefaultConfig should have comment or be unexported (golint)
    • Line 49: warning: exported method KVStore.SetConfig should have comment or be unexported (golint)
    • Line 53: warning: exported method KVStore.SetLogger should have comment or be unexported (golint)
    • Line 55: warning: exported method KVStore.Start should have comment or be unexported (golint)
    • Line 79: warning: exported method KVStore.Name should have comment or be unexported (golint)
    • Line 83: warning: exported method KVStore.NewEntry should have comment or be unexported (golint)
    • Line 389: warning: comment on exported method KVStore.RegexMatchOnKeys should be of the form "RegexMatchOnKeys ..." (golint)
    • Line 416: warning: exported method KVStore.Close should have comment or be unexported (golint)
    • Line 420: warning: exported method KVStore.Destroy should have comment or be unexported (golint)
    • olricdb/internal/dmap/put.go
    • Line 32: warning: exported const IfNotFound should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported var ErrKeyFound should have comment or be unexported (golint)
    • olricdb/internal/testutil/testutil.go
    • Line 29: warning: exported function GetFreePort should have comment or be unexported (golint)
    • Line 46: warning: exported function NewFlogger should have comment or be unexported (golint)
    • Line 55: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 77: warning: exported function NewTransportServer should have comment or be unexported (golint)
    • Line 89: warning: exported function TryWithInterval should have comment or be unexported (golint)
    • Line 112: warning: exported function ToKey should have comment or be unexported (golint)
    • Line 116: warning: exported function ToVal should have comment or be unexported (golint)
    • olricdb/internal/cluster/partitions/partition.go
    • Line 34: warning: exported method Partition.Kind should have comment or be unexported (golint)
    • Line 38: warning: exported method Partition.Id should have comment or be unexported (golint)
    • Line 42: warning: exported method Partition.Map should have comment or be unexported (golint)
    • Line 77: warning: exported method Partition.SetOwners should have comment or be unexported (golint)
    • Line 81: warning: exported method Partition.Length should have comment or be unexported (golint)
    • olricdb/config/client.go
    • Line 23: warning: exported const DefaultDialTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 102: warning: exported method Client.HasTimeout should have comment or be unexported (golint)
    • olricdb/client/dtopic.go
    • Line 199: warning: should omit 2nd value from range; this loop is equivalent to `for listenerID := range ...` (golint)
    • Line 207: warning: should omit 2nd value from range; this loop is equivalent to `for listenerID := range ...` (golint)
    • olricdb/dmap.go
    • Line 26: warning: exported const IfNotFound should have comment (or a comment on this block) or be unexported (golint)
    • olricdb/internal/streams/streams.go
    • Line 30: warning: exported var ErrStreamNotFound should have comment or be unexported (golint)
    • Line 46: warning: exported function New should have comment or be unexported (golint)
    • Line 57: warning: exported method Streams.RegisterOperations should have comment or be unexported (golint)
    • Line 61: warning: exported method Streams.Shutdown should have comment or be unexported (golint)
    • Line 85: warning: exported method Streams.GetStreamByID should have comment or be unexported (golint)
    • Line 96: warning: exported method Streams.DeleteStreamByID should have comment or be unexported (golint)
    • olricdb/internal/environment/environment.go
    • Line 19: warning: exported type Environment should have comment or be unexported (golint)
    • Line 25: warning: exported function New should have comment or be unexported (golint)
    • Line 31: warning: exported method Environment.Get should have comment or be unexported (golint)
    • Line 42: warning: exported method Environment.Set should have comment or be unexported (golint)
    • Line 49: warning: exported method Environment.Clone should have comment or be unexported (golint)
    • olricdb/pkg/neterrors/neterrors.go
    • Line 38: warning: exported function New should have comment or be unexported (golint)
    • Line 60: warning: exported method NetError.Bytes should have comment or be unexported (golint)
    • Line 64: warning: exported method NetError.StatusCode should have comment or be unexported (golint)
    • Line 73: warning: exported function Unwrap should have comment or be unexported (golint)
    • Line 77: warning: exported function GetByCode should have comment or be unexported (golint)
    • Line 99: warning: exported function ErrorResponse should have comment or be unexported (golint)
    • olricdb/internal/protocol/dmap.go
    • Line 33: warning: comment on exported type DMapMessageHeader should be of the form "DMapMessageHeader ..." (with optional leading article) (golint)
    • Line 141: warning: comment on exported method DMapMessage.DMap should be of the form "DMap ..." (golint)
    • olricdb/internal/protocol/stream.go
    • Line 35: warning: comment on exported type StreamMessageHeader should be of the form "StreamMessageHeader ..." (with optional leading article) (golint)
    • Line 66: warning: exported function ConvertToStreamMessage should have comment or be unexported (golint)
    • Line 156: warning: exported method StreamMessage.SetConn should have comment or be unexported (golint)
    • Line 160: warning: exported method StreamMessage.Conn should have comment or be unexported (golint)
    • Line 164: warning: exported method StreamMessage.SetCancelFunc should have comment or be unexported (golint)
    • Line 168: warning: exported method StreamMessage.Close should have comment or be unexported (golint)
    • olricdb/client/dtopic_test.go
    • Line 190: warning: should omit 2nd value from range; this loop is equivalent to `for id := range ...` (golint)
    • Line 228: warning: should omit 2nd value from range; this loop is equivalent to `for id := range ...` (golint)
    • olricdb/internal/cluster/routingtable/routingtable.go
    • Line 45: warning: exported type RoutingTable should have comment or be unexported (golint)
    • Line 77: warning: exported function New should have comment or be unexported (golint)
    • Line 104: warning: exported method RoutingTable.Discovery should have comment or be unexported (golint)
    • Line 108: warning: exported method RoutingTable.This should have comment or be unexported (golint)
    • Line 120: warning: exported method RoutingTable.SetNumMembersEagerly should have comment or be unexported (golint)
    • Line 124: warning: exported method RoutingTable.NumMembers should have comment or be unexported (golint)
    • Line 128: warning: exported method RoutingTable.Members should have comment or be unexported (golint)
    • Line 136: warning: exported method RoutingTable.Signature should have comment or be unexported (golint)
    • Line 151: warning: exported method RoutingTable.OwnedPartitionCount should have comment or be unexported (golint)
    • Line 155: warning: exported method RoutingTable.CheckMemberCountQuorum should have comment or be unexported (golint)
    • Line 169: warning: exported method RoutingTable.IsBootstrapped should have comment or be unexported (golint)
    • Line 174: warning: comment on exported method RoutingTable.CheckBootstrap should be of the form "CheckBootstrap ..." (golint)
    • Line 202: warning: exported method RoutingTable.UpdateEagerly should have comment or be unexported (golint)
    • Line 206: warning: exported method RoutingTable.RegisterOperations should have comment or be unexported (golint)
    • Line 326: warning: exported method RoutingTable.Start should have comment or be unexported (golint)
    • Line 399: warning: exported method RoutingTable.Shutdown should have comment or be unexported (golint)
    • olricdb/internal/testutil/mockfragment/mockfragment.go
    • Line 28: warning: exported type MockFragment should have comment or be unexported (golint)
    • Line 33: warning: exported function New should have comment or be unexported (golint)
    • Line 39: warning: exported method MockFragment.Stats should have comment or be unexported (golint)
    • Line 43: warning: exported method MockFragment.Name should have comment or be unexported (golint)
    • Line 47: warning: exported method MockFragment.Length should have comment or be unexported (golint)
    • Line 53: warning: exported method MockFragment.Put should have comment or be unexported (golint)
    • Line 59: warning: exported method MockFragment.Get should have comment or be unexported (golint)
    • Line 65: warning: exported method MockFragment.Delete should have comment or be unexported (golint)
    • Line 71: warning: exported method MockFragment.Fill should have comment or be unexported (golint)
    • Line 86: warning: exported method MockFragment.Move should have comment or be unexported (golint)
    • Line 90: warning: exported method MockFragment.Compaction should have comment or be unexported (golint)
    • Line 94: warning: exported method MockFragment.Destroy should have comment or be unexported (golint)
    • Line 101: warning: exported method MockFragment.Close should have comment or be unexported (golint)
    • olricdb/internal/cluster/balancer/balancer.go
    • Line 29: warning: exported type Balancer should have comment or be unexported (golint)
    • Line 41: warning: exported function New should have comment or be unexported (golint)
    • Line 183: warning: exported method Balancer.Balance should have comment or be unexported (golint)
    • Line 197: warning: exported method Balancer.Shutdown should have comment or be unexported (golint)
    • olricdb/internal/testcluster/testcluster.go
    • Line 38: warning: exported type TestCluster should have comment or be unexported (golint)
    • Line 49: warning: exported function NewEnvironment should have comment or be unexported (golint)
    • Line 110: warning: exported function New should have comment or be unexported (golint)
    • Line 137: warning: exported method TestCluster.AddMember should have comment or be unexported (golint)
    • Line 192: warning: exported method TestCluster.Shutdown should have comment or be unexported (golint)
    • olricdb/pkg/flog/flog.go
    • Line 100: warning: comment on exported method Verbose.Ok should be of the form "Ok ..." (golint)
    • Line 119: warning: comment on exported method Verbose.Println should be of the form "Println ..." (golint)
    • olricdb/internal/dmap/service.go
    • Line 45: warning: exported type Service should have comment or be unexported (golint)
    • Line 64: warning: exported function NewService should have comment or be unexported (golint)
    • Line 190: warning: exported method Service.Shutdown should have comment or be unexported (golint)
    • olricdb/internal/kvstore/entry.go
    • Line 37: warning: exported function NewEntry should have comment or be unexported (golint)
    • Line 41: warning: exported method Entry.SetKey should have comment or be unexported (golint)
    • Line 45: warning: exported method Entry.Key should have comment or be unexported (golint)
    • Line 49: warning: exported method Entry.SetValue should have comment or be unexported (golint)
    • Line 53: warning: exported method Entry.Value should have comment or be unexported (golint)
    • Line 57: warning: exported method Entry.SetTTL should have comment or be unexported (golint)
    • Line 61: warning: exported method Entry.TTL should have comment or be unexported (golint)
    • Line 65: warning: exported method Entry.SetTimestamp should have comment or be unexported (golint)
    • Line 69: warning: exported method Entry.Timestamp should have comment or be unexported (golint)
    • Line 73: warning: exported method Entry.Encode should have comment or be unexported (golint)
    • Line 108: warning: exported method Entry.Decode should have comment or be unexported (golint)
    • olricdb/internal/protocol/system.go
    • Line 23: warning: exported const SystemMessageHeaderSize should have comment or be unexported (golint)
    • Line 26: warning: exported const MagicSystemReq should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: comment on exported type SystemMessageHeader should be of the form "SystemMessageHeader ..." (with optional leading article) (golint)
    • Line 37: warning: exported type SystemMessage should have comment or be unexported (golint)
    • Line 45: warning: exported function NewSystemMessage should have comment or be unexported (golint)
    • Line 57: warning: exported function NewSystemMessageFromRequest should have comment or be unexported (golint)
    • Line 69: warning: exported method SystemMessage.Response should have comment or be unexported (golint)
    • Line 90: warning: exported method SystemMessage.SetStatus should have comment or be unexported (golint)
    • Line 94: warning: exported method SystemMessage.Status should have comment or be unexported (golint)
    • Line 98: warning: exported method SystemMessage.SetValue should have comment or be unexported (golint)
    • Line 102: warning: exported method SystemMessage.Value should have comment or be unexported (golint)
    • Line 106: warning: exported method SystemMessage.OpCode should have comment or be unexported (golint)
    • Line 110: warning: exported method SystemMessage.SetBuffer should have comment or be unexported (golint)
    • Line 114: warning: exported method SystemMessage.Buffer should have comment or be unexported (golint)
    • Line 118: warning: exported method SystemMessage.SetExtra should have comment or be unexported (golint)
    • Line 122: warning: exported method SystemMessage.Extra should have comment or be unexported (golint)
    • Line 155: warning: exported method SystemMessage.Decode should have comment or be unexported (golint)
    • olricdb/internal/discovery/member.go
    • Line 49: warning: exported method Member.Encode should have comment or be unexported (golint)
    • Line 53: warning: exported function NewMemberFromMetadata should have comment or be unexported (golint)
    • Line 59: warning: exported function NewMember should have comment or be unexported (golint)
    • olricdb/internal/dtopic/service.go
    • Line 34: warning: exported var ErrServerGone should have comment or be unexported (golint)
    • Line 36: warning: exported type Service should have comment or be unexported (golint)
    • Line 51: warning: exported function NewService should have comment or be unexported (golint)
    • Line 66: warning: exported method Service.Start should have comment or be unexported (golint)
    • Line 112: warning: exported method Service.RegisterOperations should have comment or be unexported (golint)
    • Line 130: warning: exported method Service.Shutdown should have comment or be unexported (golint)
    • olricdb/internal/protocol/extras.go
    • Line 80: warning: exported type LocalQueryExtra should have comment or be unexported (golint)
    • Line 84: warning: exported type QueryExtra should have comment or be unexported (golint)
    • Line 88: warning: exported type StreamCreatedExtra should have comment or be unexported (golint)
    • Line 92: warning: exported type StreamMessageExtra should have comment or be unexported (golint)
    • Line 96: warning: exported type DTopicAddListenerExtra should have comment or be unexported (golint)
    • Line 101: warning: exported type DTopicRemoveListenerExtra should have comment or be unexported (golint)
    • Line 105: warning: exported type StatsExtra should have comment or be unexported (golint)
    • olricdb/pkg/storage/config.go
    • Line 22: warning: exported type Config should have comment or be unexported (golint)
    • Line 27: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 36: warning: exported method Config.Add should have comment or be unexported (golint)
    • Line 42: warning: exported method Config.Get should have comment or be unexported (golint)
    • Line 52: warning: exported method Config.Delete should have comment or be unexported (golint)
    • Line 58: warning: exported method Config.Copy should have comment or be unexported (golint)
    • Line 70: warning: exported method Config.ToMap should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words