Preparing report...

Report for github.com/roseduan/rosedb

(v0.0.0-20211219072426-04b93d755eba)

A+    Excellent!    Found 17 issues across 60 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!


gocyclo86%

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.

    • db_str.go
    • Line 117: warning: cyclomatic complexity 16 of function (*RoseDB).MSet() is high (> 15) (gocyclo)
    • db_hash.go
    • Line 145: warning: cyclomatic complexity 16 of function (*RoseDB).HMSet() is high (> 15) (gocyclo)
    • cmd/cmd_txn.go
    • Line 8: warning: cyclomatic complexity 69 of function txn() is high (> 15) (gocyclo)
    • rosedb.go
    • Line 386: warning: cyclomatic complexity 20 of function (*RoseDB).mergeString() is high (> 15) (gocyclo)
    • idx.go
    • Line 102: warning: cyclomatic complexity 19 of function (*RoseDB).buildListIndex() is high (> 15) (gocyclo)
    • txn.go
    • Line 127: warning: cyclomatic complexity 18 of function (*Txn).Commit() is high (> 15) (gocyclo)

golint88%

Golint is a linter for Go source code.

    • storage/db_file.go
    • Line 55: warning: exported type FileIds should have comment or be unexported (golint)
    • Line 230: warning: exported method DBFile.FindValidEntries should have comment or be unexported (golint)
    • Line 243: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 250: warning: exported function BuildType should have comment or be unexported (golint)
    • storage/entry.go
    • Line 93: warning: comment on exported function NewEntryWithTxn should be of the form "NewEntryWithTxn ..." (golint)
    • cmd/grpc_server.go
    • Line 15: warning: exported type GrpcServer should have comment or be unexported (golint)
    • Line 21: warning: exported function NewGrpcServer should have comment or be unexported (golint)
    • Line 28: warning: exported method GrpcServer.Listen should have comment or be unexported (golint)
    • Line 43: warning: exported method GrpcServer.Stop should have comment or be unexported (golint)
    • Line 55: warning: exported method GrpcServer.SAdd should have comment or be unexported (golint)
    • Line 71: warning: exported method GrpcServer.SPop should have comment or be unexported (golint)
    • Line 80: warning: exported method GrpcServer.SIsMember should have comment or be unexported (golint)
    • Line 86: warning: exported method GrpcServer.SRandMember should have comment or be unexported (golint)
    • Line 92: warning: exported method GrpcServer.SRem should have comment or be unexported (golint)
    • Line 107: warning: exported method GrpcServer.SMove should have comment or be unexported (golint)
    • Line 116: warning: exported method GrpcServer.SCard should have comment or be unexported (golint)
    • Line 123: warning: exported method GrpcServer.SMembers should have comment or be unexported (golint)
    • Line 129: warning: exported method GrpcServer.SUnion should have comment or be unexported (golint)
    • Line 139: warning: exported method GrpcServer.SDiff should have comment or be unexported (golint)
    • Line 150: warning: exported method GrpcServer.SKeyExists should have comment or be unexported (golint)
    • Line 156: warning: exported method GrpcServer.SClear should have comment or be unexported (golint)
    • Line 162: warning: exported method GrpcServer.SExpire should have comment or be unexported (golint)
    • Line 171: warning: exported method GrpcServer.STTL should have comment or be unexported (golint)
    • Line 177: warning: exported method GrpcServer.HSet should have comment or be unexported (golint)
    • Line 187: warning: exported method GrpcServer.HSetNx should have comment or be unexported (golint)
    • Line 197: warning: exported method GrpcServer.HGet should have comment or be unexported (golint)
    • Line 203: warning: exported method GrpcServer.HGetAll should have comment or be unexported (golint)
    • Line 209: warning: exported method GrpcServer.HMSet should have comment or be unexported (golint)
    • Line 224: warning: exported method GrpcServer.HMGet should have comment or be unexported (golint)
    • Line 236: warning: exported method GrpcServer.HDel should have comment or be unexported (golint)
    • Line 253: warning: exported method GrpcServer.HKeyExists should have comment or be unexported (golint)
    • Line 259: warning: exported method GrpcServer.HExists should have comment or be unexported (golint)
    • Line 265: warning: exported method GrpcServer.HLen should have comment or be unexported (golint)
    • Line 272: warning: exported method GrpcServer.HKeys should have comment or be unexported (golint)
    • Line 282: warning: exported method GrpcServer.HVals should have comment or be unexported (golint)
    • Line 288: warning: exported method GrpcServer.HClear should have comment or be unexported (golint)
    • Line 297: warning: exported method GrpcServer.HExpire should have comment or be unexported (golint)
    • Line 306: warning: exported method GrpcServer.HTTL should have comment or be unexported (golint)
    • Line 312: warning: exported method GrpcServer.LPush should have comment or be unexported (golint)
    • Line 327: warning: exported method GrpcServer.RPush should have comment or be unexported (golint)
    • Line 341: warning: exported method GrpcServer.LPop should have comment or be unexported (golint)
    • Line 351: warning: exported method GrpcServer.RPop should have comment or be unexported (golint)
    • Line 362: warning: exported method GrpcServer.LIndex should have comment or be unexported (golint)
    • Line 368: warning: exported method GrpcServer.LRem should have comment or be unexported (golint)
    • Line 378: warning: exported method GrpcServer.LInsert should have comment or be unexported (golint)
    • Line 388: warning: exported method GrpcServer.LSet should have comment or be unexported (golint)
    • Line 398: warning: exported method GrpcServer.LTrim should have comment or be unexported (golint)
    • Line 407: warning: exported method GrpcServer.LRange should have comment or be unexported (golint)
    • Line 418: warning: exported method GrpcServer.LLen should have comment or be unexported (golint)
    • Line 424: warning: exported method GrpcServer.LKeyExists should have comment or be unexported (golint)
    • Line 430: warning: exported method GrpcServer.LClear should have comment or be unexported (golint)
    • Line 439: warning: exported method GrpcServer.LExpire should have comment or be unexported (golint)
    • Line 448: warning: exported method GrpcServer.LTTL should have comment or be unexported (golint)
    • Line 454: warning: exported method GrpcServer.Set should have comment or be unexported (golint)
    • Line 463: warning: exported method GrpcServer.SetNx should have comment or be unexported (golint)
    • Line 473: warning: exported method GrpcServer.SetEx should have comment or be unexported (golint)
    • Line 482: warning: exported method GrpcServer.Get should have comment or be unexported (golint)
    • Line 491: warning: exported method GrpcServer.GetSet should have comment or be unexported (golint)
    • Line 500: warning: exported method GrpcServer.MSet should have comment or be unexported (golint)
    • Line 518: warning: exported method GrpcServer.MGet should have comment or be unexported (golint)
    • Line 538: warning: exported method GrpcServer.Append should have comment or be unexported (golint)
    • Line 547: warning: exported method GrpcServer.StrExists should have comment or be unexported (golint)
    • Line 553: warning: exported method GrpcServer.Remove should have comment or be unexported (golint)
    • Line 562: warning: exported method GrpcServer.Expire should have comment or be unexported (golint)
    • Line 571: warning: exported method GrpcServer.Persist should have comment or be unexported (golint)
    • Line 580: warning: exported method GrpcServer.TTL should have comment or be unexported (golint)
    • Line 586: warning: exported method GrpcServer.ZAdd should have comment or be unexported (golint)
    • Line 595: warning: exported method GrpcServer.ZScore should have comment or be unexported (golint)
    • Line 601: warning: exported method GrpcServer.ZCard should have comment or be unexported (golint)
    • Line 608: warning: exported method GrpcServer.ZRank should have comment or be unexported (golint)
    • Line 614: warning: exported method GrpcServer.ZRevRank should have comment or be unexported (golint)
    • Line 620: warning: exported method GrpcServer.ZIncrBy should have comment or be unexported (golint)
    • Line 630: warning: exported method GrpcServer.ZRange should have comment or be unexported (golint)
    • Line 639: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 646: warning: exported method GrpcServer.ZRangeWithScores should have comment or be unexported (golint)
    • Line 655: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 662: warning: exported method GrpcServer.ZRevRange should have comment or be unexported (golint)
    • Line 671: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 678: warning: exported method GrpcServer.ZRevRangeWithScores should have comment or be unexported (golint)
    • Line 687: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 694: warning: exported method GrpcServer.ZRem should have comment or be unexported (golint)
    • Line 705: warning: exported method GrpcServer.ZGetByRank should have comment or be unexported (golint)
    • Line 714: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 721: warning: exported method GrpcServer.ZRevGetByRank should have comment or be unexported (golint)
    • Line 730: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 737: warning: exported method GrpcServer.ZScoreRange should have comment or be unexported (golint)
    • Line 746: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 753: warning: exported method GrpcServer.ZRevScoreRange should have comment or be unexported (golint)
    • Line 762: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 769: warning: exported method GrpcServer.ZKeyExists should have comment or be unexported (golint)
    • Line 775: warning: exported method GrpcServer.ZClear should have comment or be unexported (golint)
    • Line 781: warning: exported method GrpcServer.ZExpire should have comment or be unexported (golint)
    • Line 790: warning: exported method GrpcServer.ZTTL should have comment or be unexported (golint)
    • cmd/server.go
    • Line 20: warning: error var nestedMultiErr should have name of the form errFoo (golint)
    • Line 21: warning: error var withoutMultiErr should have name of the form errFoo (golint)
    • Line 22: warning: error var execAbortErr should have name of the form errFoo (golint)
    • Line 38: warning: exported type TxnList should have comment or be unexported (golint)
    • Line 52: warning: exported function NewServerUseDbPtr should have comment or be unexported (golint)
    • db_list.go
    • Line 121: warning: comment on exported method RoseDB.RPop should be of the form "RPop ..." (golint)
    • txn_api.go
    • Line 454: warning: comment on exported method Txn.ZAdd should be of the form "ZAdd ..." (golint)
    • ds/zset/zset.go
    • Line 206: warning: comment on exported method SortedSet.ZRevRangeWithScores should be of the form "ZRevRangeWithScores ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.

    • ds/list/list.go
    • Line 137: warning: ineffectual assignment to ele (ineffassign)
    • Line 261: warning: ineffectual assignment to ele (ineffassign)
    • Line 137: warning: ineffectual assignment to ele (ineffassign)
    • Line 261: warning: ineffectual assignment to ele (ineffassign)
    • txn_test.go
    • Line 301: warning: ineffectual assignment to err (ineffassign)
    • Line 532: warning: ineffectual assignment to err (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!