Preparing report...

Report for github.com/siddontang/ledisdb

A+    Excellent!    Found 63 issues across 136 files

Tweet

gofmt99%

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!


golint75%

Golint is a linter for Go source code.

    • ledisdb/store/driver/slice.go
    • Line 3: warning: exported type ISlice should have comment or be unexported (golint)
    • Line 9: warning: exported type GoSlice should have comment or be unexported (golint)
    • Line 11: warning: exported method GoSlice.Data should have comment or be unexported (golint)
    • Line 15: warning: exported method GoSlice.Size should have comment or be unexported (golint)
    • Line 19: warning: exported method GoSlice.Free should have comment or be unexported (golint)
    • ledisdb/store/goleveldb/batch.go
    • Line 7: warning: exported type WriteBatch should have comment or be unexported (golint)
    • Line 12: warning: exported method WriteBatch.Put should have comment or be unexported (golint)
    • Line 16: warning: exported method WriteBatch.Delete should have comment or be unexported (golint)
    • Line 20: warning: exported method WriteBatch.Commit should have comment or be unexported (golint)
    • Line 24: warning: exported method WriteBatch.SyncCommit should have comment or be unexported (golint)
    • Line 28: warning: exported method WriteBatch.Rollback should have comment or be unexported (golint)
    • Line 33: warning: exported method WriteBatch.Close should have comment or be unexported (golint)
    • Line 37: warning: exported method WriteBatch.Data should have comment or be unexported (golint)
    • ledisdb/rpl/log.go
    • Line 10: warning: exported const LogHeadSize should have comment or be unexported (golint)
    • Line 12: warning: exported type Log should have comment or be unexported (golint)
    • Line 20: warning: exported method Log.HeadSize should have comment or be unexported (golint)
    • Line 24: warning: exported method Log.Size should have comment or be unexported (golint)
    • Line 28: warning: exported method Log.Marshal should have comment or be unexported (golint)
    • Line 39: warning: exported method Log.Unmarshal should have comment or be unexported (golint)
    • Line 49: warning: exported method Log.Encode should have comment or be unexported (golint)
    • Line 78: warning: exported method Log.Decode should have comment or be unexported (golint)
    • Line 93: warning: exported method Log.DecodeHead should have comment or be unexported (golint)
    • Line 108: warning: exported method Log.DecodeAt should have comment or be unexported (golint)
    • Line 134: warning: exported method Log.DecodeHeadAt should have comment or be unexported (golint)
    • ledisdb/cmd/cli.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 168: warning: exported function Cli should have comment or be unexported (golint)
    • ledisdb/server/const.go
    • Line 10: warning: exported var ErrEmptyCommand should have comment or be unexported (golint)
    • Line 22: warning: exported var Delims should have comment or be unexported (golint)
    • Line 33: warning: exported const KV should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported const KVName should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported const GB should have comment (or a comment on this block) or be unexported (golint)
    • Line 54: warning: exported var TypeNames should have comment or be unexported (golint)
    • ledisdb/store/driver/store.go
    • Line 9: warning: exported type Store should have comment or be unexported (golint)
    • Line 17: warning: exported function Register should have comment or be unexported (golint)
    • Line 26: warning: exported function ListStores should have comment or be unexported (golint)
    • Line 35: warning: exported function GetStore should have comment or be unexported (golint)
    • ledisdb/config/config.go
    • Line 17: warning: exported var ErrNoConfigFile should have comment or be unexported (golint)
    • Line 21: warning: exported const DefaultAddr should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type LevelDBConfig should have comment or be unexported (golint)
    • Line 41: warning: exported type RocksDBConfig should have comment or be unexported (golint)
    • Line 69: warning: exported type LMDBConfig should have comment or be unexported (golint)
    • Line 74: warning: exported type ReplicationConfig should have comment or be unexported (golint)
    • Line 89: warning: exported type SnapshotConfig should have comment or be unexported (golint)
    • Line 94: warning: exported type TLS should have comment or be unexported (golint)
    • Line 100: warning: exported type AuthMethod should have comment or be unexported (golint)
    • Line 102: warning: exported type Config should have comment or be unexported (golint)
    • Line 153: warning: exported function NewConfigWithFile should have comment or be unexported (golint)
    • Line 168: warning: exported function NewConfigWithData should have comment or be unexported (golint)
    • Line 180: warning: exported function NewConfigDefault should have comment or be unexported (golint)
    • Line 276: warning: exported method Config.Dump should have comment or be unexported (golint)
    • Line 288: warning: exported method Config.DumpFile should have comment or be unexported (golint)
    • Line 298: warning: exported method Config.Rewrite should have comment or be unexported (golint)
    • Line 306: warning: exported method Config.GetReadonly should have comment or be unexported (golint)
    • Line 313: warning: exported method Config.SetReadonly should have comment or be unexported (golint)
    • ledisdb/store/db.go
    • Line 11: warning: exported type DB should have comment or be unexported (golint)
    • Line 24: warning: exported method DB.Close should have comment or be unexported (golint)
    • Line 32: warning: exported method DB.NewIterator should have comment or be unexported (golint)
    • Line 42: warning: exported method DB.Get should have comment or be unexported (golint)
    • Line 50: warning: exported method DB.Put should have comment or be unexported (golint)
    • Line 59: warning: exported method DB.Delete should have comment or be unexported (golint)
    • Line 68: warning: exported method DB.NewWriteBatch should have comment or be unexported (golint)
    • Line 77: warning: exported method DB.NewSnapshot should have comment or be unexported (golint)
    • Line 90: warning: exported method DB.Compact should have comment or be unexported (golint)
    • Line 101: warning: exported method DB.RangeIterator should have comment or be unexported (golint)
    • Line 105: warning: exported method DB.RevRangeIterator should have comment or be unexported (golint)
    • Line 123: warning: exported method DB.Stat should have comment or be unexported (golint)
    • Line 147: warning: exported method DB.GetSlice should have comment or be unexported (golint)
    • ledisdb/store/stat.go
    • Line 7: warning: exported type Stat should have comment or be unexported (golint)
    • Line 35: warning: exported method Stat.Reset should have comment or be unexported (golint)
    • ledisdb/store/store.go
    • Line 23: warning: exported function Open should have comment or be unexported (golint)
    • Line 49: warning: exported function Repair should have comment or be unexported (golint)
    • ledisdb/rpl/store.go
    • Line 8: warning: exported const InvalidLogID should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported var ErrLogNotFound should have comment or be unexported (golint)
    • Line 18: warning: exported type LogStore should have comment or be unexported (golint)
    • ledisdb/server/app.go
    • Line 20: warning: exported type App should have comment or be unexported (golint)
    • Line 87: warning: exported function NewApp should have comment or be unexported (golint)
    • Line 188: warning: exported method App.Close should have comment or be unexported (golint)
    • Line 231: warning: exported method App.Run should have comment or be unexported (golint)
    • Line 268: warning: exported method App.Ledis should have comment or be unexported (golint)
    • Line 272: warning: exported method App.Address should have comment or be unexported (golint)
    • ledisdb/rpl/rpl.go
    • Line 15: warning: exported type Stat should have comment or be unexported (golint)
    • Line 21: warning: exported type Replication should have comment or be unexported (golint)
    • Line 40: warning: exported function NewReplication should have comment or be unexported (golint)
    • Line 85: warning: exported method Replication.Close should have comment or be unexported (golint)
    • Line 112: warning: exported method Replication.Log should have comment or be unexported (golint)
    • Line 164: warning: exported method Replication.WaitLog should have comment or be unexported (golint)
    • Line 171: warning: exported method Replication.StoreLog should have comment or be unexported (golint)
    • Line 179: warning: exported method Replication.FirstLogID should have comment or be unexported (golint)
    • Line 187: warning: exported method Replication.LastLogID should have comment or be unexported (golint)
    • Line 194: warning: exported method Replication.LastCommitID should have comment or be unexported (golint)
    • Line 201: warning: exported method Replication.UpdateCommitID should have comment or be unexported (golint)
    • Line 209: warning: exported method Replication.Stat should have comment or be unexported (golint)
    • Line 244: warning: exported method Replication.CommitIDBehind should have comment or be unexported (golint)
    • Line 259: warning: exported method Replication.GetLog should have comment or be unexported (golint)
    • Line 263: warning: exported method Replication.NextNeedCommitLog should have comment or be unexported (golint)
    • Line 280: warning: exported method Replication.Clear should have comment or be unexported (golint)
    • Line 284: warning: exported method Replication.ClearWithCommitID should have comment or be unexported (golint)
    • ledisdb/store/iterator.go
    • Line 10: warning: exported const IteratorForward should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported const RangeClose should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported type Limit should have comment or be unexported (golint)
    • Line 42: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 108: warning: exported method Iterator.Close should have comment or be unexported (golint)
    • Line 116: warning: exported method Iterator.Valid should have comment or be unexported (golint)
    • Line 120: warning: exported method Iterator.Next should have comment or be unexported (golint)
    • Line 125: warning: exported method Iterator.Prev should have comment or be unexported (golint)
    • Line 130: warning: exported method Iterator.SeekToFirst should have comment or be unexported (golint)
    • Line 135: warning: exported method Iterator.SeekToLast should have comment or be unexported (golint)
    • Line 140: warning: exported method Iterator.Seek should have comment or be unexported (golint)
    • Line 176: warning: exported type RangeLimitIterator should have comment or be unexported (golint)
    • Line 188: warning: exported method RangeLimitIterator.Key should have comment or be unexported (golint)
    • Line 192: warning: exported method RangeLimitIterator.Value should have comment or be unexported (golint)
    • Line 196: warning: exported method RangeLimitIterator.RawKey should have comment or be unexported (golint)
    • Line 200: warning: exported method RangeLimitIterator.RawValue should have comment or be unexported (golint)
    • Line 204: warning: exported method RangeLimitIterator.BufKey should have comment or be unexported (golint)
    • Line 208: warning: exported method RangeLimitIterator.BufValue should have comment or be unexported (golint)
    • Line 212: warning: exported method RangeLimitIterator.Valid should have comment or be unexported (golint)
    • Line 226: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 235: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 244: warning: exported method RangeLimitIterator.Next should have comment or be unexported (golint)
    • Line 254: warning: exported method RangeLimitIterator.Close should have comment or be unexported (golint)
    • Line 258: warning: exported function NewRangeLimitIterator should have comment or be unexported (golint)
    • Line 262: warning: exported function NewRevRangeLimitIterator should have comment or be unexported (golint)
    • Line 266: warning: exported function NewRangeIterator should have comment or be unexported (golint)
    • Line 270: warning: exported function NewRevRangeIterator should have comment or be unexported (golint)
    • ledisdb/store/snapshot.go
    • Line 7: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 12: warning: exported method Snapshot.NewIterator should have comment or be unexported (golint)
    • Line 22: warning: exported method Snapshot.Get should have comment or be unexported (golint)
    • Line 28: warning: exported method Snapshot.GetSlice should have comment or be unexported (golint)
    • Line 44: warning: exported method Snapshot.Close should have comment or be unexported (golint)
    • ledisdb/rpl/file_store.go
    • Line 48: warning: exported type FileStore should have comment or be unexported (golint)
    • Line 64: warning: exported function NewFileStore should have comment or be unexported (golint)
    • Line 102: warning: exported method FileStore.GetLog should have comment or be unexported (golint)
    • Line 125: warning: exported method FileStore.FirstID should have comment or be unexported (golint)
    • Line 145: warning: exported method FileStore.LastID should have comment or be unexported (golint)
    • Line 162: warning: exported method FileStore.StoreLog should have comment or be unexported (golint)
    • Line 197: warning: exported method FileStore.PurgeExpired should have comment or be unexported (golint)
    • Line 220: warning: exported method FileStore.Sync should have comment or be unexported (golint)
    • Line 224: warning: exported method FileStore.Clear should have comment or be unexported (golint)
    • Line 254: warning: exported method FileStore.Close should have comment or be unexported (golint)
    • ledisdb/store/driver/driver.go
    • Line 3: warning: exported type IDB should have comment or be unexported (golint)
    • Line 23: warning: exported type ISnapshot should have comment or be unexported (golint)
    • Line 29: warning: exported type IIterator should have comment or be unexported (golint)
    • Line 45: warning: exported type IWriteBatch should have comment or be unexported (golint)
    • Line 55: warning: exported type ISliceGeter should have comment or be unexported (golint)
    • ledisdb/store/goleveldb/db.go
    • Line 19: warning: exported type Store should have comment or be unexported (golint)
    • Line 26: warning: exported type MemStore should have comment or be unexported (golint)
    • Line 33: warning: exported type DB should have comment or be unexported (golint)
    • Line 51: warning: exported method Store.Open should have comment or be unexported (golint)
    • Line 72: warning: exported method Store.Repair should have comment or be unexported (golint)
    • Line 82: warning: exported method MemStore.Open should have comment or be unexported (golint)
    • Line 98: warning: exported method MemStore.Repair should have comment or be unexported (golint)
    • Line 139: warning: exported method DB.Close should have comment or be unexported (golint)
    • Line 143: warning: exported method DB.Put should have comment or be unexported (golint)
    • Line 147: warning: exported method DB.Get should have comment or be unexported (golint)
    • Line 155: warning: exported method DB.Delete should have comment or be unexported (golint)
    • Line 159: warning: exported method DB.SyncPut should have comment or be unexported (golint)
    • Line 163: warning: exported method DB.SyncDelete should have comment or be unexported (golint)
    • Line 167: warning: exported method DB.NewWriteBatch should have comment or be unexported (golint)
    • Line 175: warning: exported method DB.NewIterator should have comment or be unexported (golint)
    • Line 183: warning: exported method DB.NewSnapshot should have comment or be unexported (golint)
    • Line 197: warning: exported method DB.Compact should have comment or be unexported (golint)
    • ledisdb/store/goleveldb/iterator.go
    • Line 7: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 11: warning: exported method Iterator.Key should have comment or be unexported (golint)
    • Line 15: warning: exported method Iterator.Value should have comment or be unexported (golint)
    • Line 19: warning: exported method Iterator.Close should have comment or be unexported (golint)
    • Line 27: warning: exported method Iterator.Valid should have comment or be unexported (golint)
    • Line 31: warning: exported method Iterator.Next should have comment or be unexported (golint)
    • Line 35: warning: exported method Iterator.Prev should have comment or be unexported (golint)
    • Line 39: warning: exported method Iterator.First should have comment or be unexported (golint)
    • Line 43: warning: exported method Iterator.Last should have comment or be unexported (golint)
    • Line 47: warning: exported method Iterator.Seek should have comment or be unexported (golint)
    • ledisdb/store/writebatch.go
    • Line 10: warning: exported type WriteBatch should have comment or be unexported (golint)
    • Line 21: warning: exported method WriteBatch.Close should have comment or be unexported (golint)
    • Line 25: warning: exported method WriteBatch.Put should have comment or be unexported (golint)
    • Line 30: warning: exported method WriteBatch.Delete should have comment or be unexported (golint)
    • Line 35: warning: exported method WriteBatch.Commit should have comment or be unexported (golint)
    • Line 55: warning: exported method WriteBatch.Rollback should have comment or be unexported (golint)
    • Line 73: warning: exported method WriteBatch.Data should have comment or be unexported (golint)
    • Line 82: warning: exported type BatchData should have comment or be unexported (golint)
    • Line 86: warning: exported function NewBatchData should have comment or be unexported (golint)
    • Line 96: warning: exported method BatchData.Data should have comment or be unexported (golint)
    • Line 100: warning: exported method BatchData.Reset should have comment or be unexported (golint)
    • Line 104: warning: exported type BatchDataReplay should have comment or be unexported (golint)
    • Line 109: warning: exported type BatchItem should have comment or be unexported (golint)
    • Line 124: warning: exported method BatchData.Replay should have comment or be unexported (golint)
    • Line 128: warning: exported method BatchData.Items should have comment or be unexported (golint)
    • ledisdb/store/goleveldb/snapshot.go
    • Line 8: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 13: warning: exported method Snapshot.Get should have comment or be unexported (golint)
    • Line 17: warning: exported method Snapshot.NewIterator should have comment or be unexported (golint)
    • Line 24: warning: exported method Snapshot.Close should have comment or be unexported (golint)
    • ledisdb/rpl/goleveldb_store.go
    • Line 15: warning: exported type GoLevelDBStore should have comment or be unexported (golint)
    • Line 29: warning: exported method GoLevelDBStore.FirstID should have comment or be unexported (golint)
    • Line 37: warning: exported method GoLevelDBStore.LastID should have comment or be unexported (golint)
    • Line 79: warning: exported method GoLevelDBStore.GetLog should have comment or be unexported (golint)
    • Line 90: warning: exported method GoLevelDBStore.StoreLog should have comment or be unexported (golint)
    • Line 122: warning: exported method GoLevelDBStore.PurgeExpired should have comment or be unexported (golint)
    • Line 160: warning: exported method GoLevelDBStore.Sync should have comment or be unexported (golint)
    • Line 170: warning: exported method GoLevelDBStore.Clear should have comment or be unexported (golint)
    • Line 184: warning: exported method GoLevelDBStore.Close should have comment or be unexported (golint)
    • Line 207: warning: exported function NewGoLevelDBStore should have comment or be unexported (golint)

gocyclo75%

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.

    • ledisdb/server/cmd_kv_test.go
    • Line 9: warning: cyclomatic complexity 44 of function TestKV() is high (> 15) (gocyclo)
    • Line 214: warning: cyclomatic complexity 20 of function TestKVErrorParams() is high (> 15) (gocyclo)
    • ledisdb/server/cmd_zset_test.go
    • Line 448: warning: cyclomatic complexity 37 of function TestZsetErrorParams() is high (> 15) (gocyclo)
    • Line 12: warning: cyclomatic complexity 35 of function TestZSet() is high (> 15) (gocyclo)
    • Line 335: warning: cyclomatic complexity 30 of function TestZSetRange() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 24 of function TestZSetRangeScore() is high (> 15) (gocyclo)
    • Line 671: warning: cyclomatic complexity 21 of function TestZInterStore() is high (> 15) (gocyclo)
    • Line 122: warning: cyclomatic complexity 18 of function TestZSetCount() is high (> 15) (gocyclo)
    • ledisdb/server/cmd_set_test.go
    • Line 9: warning: cyclomatic complexity 33 of function TestSet() is high (> 15) (gocyclo)
    • Line 116: warning: cyclomatic complexity 25 of function TestSetErrorParams() is high (> 15) (gocyclo)
    • ledisdb/ledis/t_set_test.go
    • Line 32: warning: cyclomatic complexity 24 of function TestDBSet() is high (> 15) (gocyclo)
    • Line 205: warning: cyclomatic complexity 17 of function testInter() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 16 of function testDiff() is high (> 15) (gocyclo)
    • ledisdb/server/cmd_list_test.go
    • Line 57: warning: cyclomatic complexity 33 of function TestList() is high (> 15) (gocyclo)
    • Line 399: warning: cyclomatic complexity 21 of function TestTrim() is high (> 15) (gocyclo)
    • Line 300: warning: cyclomatic complexity 20 of function TestRPopLPush() is high (> 15) (gocyclo)
    • Line 237: warning: cyclomatic complexity 19 of function TestPop() is high (> 15) (gocyclo)
    • Line 465: warning: cyclomatic complexity 16 of function TestListErrorParams() is high (> 15) (gocyclo)
    • ledisdb/ledis/t_zset_test.go
    • Line 120: warning: cyclomatic complexity 27 of function TestZSetOrder() is high (> 15) (gocyclo)
    • Line 58: warning: cyclomatic complexity 19 of function TestDBZSet() is high (> 15) (gocyclo)
    • ledisdb/ledis/t_list_test.go
    • Line 33: warning: cyclomatic complexity 22 of function TestListTrim() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 16 of function TestDBList() is high (> 15) (gocyclo)
    • Line 285: warning: cyclomatic complexity 16 of function TestListPop() is high (> 15) (gocyclo)
    • ledisdb/server/cmd_zset.go
    • Line 523: warning: cyclomatic complexity 16 of function zparseZsetoptStore() is high (> 15) (gocyclo)
    • Line 122: warning: cyclomatic complexity 16 of function zparseScoreRange() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words

    • ledisdb/ledis/t_ttl_test.go
    • Line 52: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 55: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 55: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 58: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 165: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 168: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 168: warning: "eles" is a misspelling of "eels" (misspell)
    • Line 171: warning: "eles" is a misspelling of "eels" (misspell)