Preparing report...

Report for github.com/meitu/titan

A+    Excellent!    Found 38 issues across 88 files

Tweet

gofmt94%

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!


golint82%

Golint is a linter for Go source code.

    • titan/tools/autotest/cmd/key.go
    • Line 147: warning: comment on exported method ExampleKey.ExpireAtEqualErr should be of the form "ExpireAtEqualErr ..." (golint)
    • Line 166: warning: comment on exported method ExampleKey.PExpireAtEqual should be of the form "PExpireAtEqual ..." (golint)
    • Line 173: warning: comment on exported method ExampleKey.PExpireAtEqualErr should be of the form "PExpireAtEqualErr ..." (golint)
    • Line 179: warning: exported method ExampleKey.TypeEqual should have comment or be unexported (golint)
    • Line 185: warning: exported method ExampleKey.TypeEqualErr should have comment or be unexported (golint)
    • Line 190: warning: exported method ExampleKey.KeysEqual should have comment or be unexported (golint)
    • Line 193: warning: exported method ExampleKey.KeysEqualErr should have comment or be unexported (golint)
    • Line 196: warning: exported method ExampleKey.ObjectEqual should have comment or be unexported (golint)
    • Line 202: warning: exported method ExampleKey.ObjectEqualErr should have comment or be unexported (golint)
    • Line 209: warning: comment on exported method ExampleKey.PersistEqual should be of the form "PersistEqual ..." (golint)
    • Line 216: warning: comment on exported method ExampleKey.PersistEqualErr should be of the form "PersistEqualErr ..." (golint)
    • titan/tools/autotest/cmd/string.go
    • Line 56: warning: comment on exported method ExampleString.SetNxEqual should be of the form "SetNxEqual ..." (golint)
    • Line 67: warning: comment on exported method ExampleString.SetExEqual should be of the form "SetExEqual ..." (golint)
    • Line 81: warning: comment on exported method ExampleString.PSetexEqual should be of the form "PSetexEqual ..." (golint)
    • Line 95: warning: comment on exported method ExampleString.SetRangeEqual should be of the form "SetRangeEqual ..." (golint)
    • Line 99: warning: comment on exported method ExampleString.MSetNxEqual should be of the form "MSetNxEqual ..." (golint)
    • Line 197: warning: comment on exported method ExampleString.DecrByEqual should be of the form "DecrByEqual ..." (golint)
    • titan/tools/autotest/cmd/zset.go
    • Line 13: warning: comment on exported type ExampleZSet should be of the form "ExampleZSet ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported function NewExampleZSet should be of the form "NewExampleZSet ..." (golint)
    • Line 28: warning: exported method ExampleZSet.ZAddEqual should have comment or be unexported (golint)
    • Line 50: warning: don't use underscores in Go names; var uniq_members should be uniqMembers (golint)
    • Line 75: warning: exported method ExampleZSet.ZAddEqualErr should have comment or be unexported (golint)
    • Line 80: warning: exported method ExampleZSet.ZRemEqual should have comment or be unexported (golint)
    • Line 105: warning: exported method ExampleZSet.ZRemEqualErr should have comment or be unexported (golint)
    • Line 110: warning: exported method ExampleZSet.ZAnyOrderRangeEqual should have comment or be unexported (golint)
    • Line 159: warning: exported method ExampleZSet.ZRangeEqual should have comment or be unexported (golint)
    • Line 163: warning: exported method ExampleZSet.ZRangeEqualErr should have comment or be unexported (golint)
    • Line 168: warning: exported method ExampleZSet.ZRevRangeEqual should have comment or be unexported (golint)
    • Line 172: warning: exported method ExampleZSet.ZRevRangeEqualErr should have comment or be unexported (golint)
    • Line 177: warning: exported method ExampleZSet.ZRangeByScoreEqual should have comment or be unexported (golint)
    • Line 181: warning: exported method ExampleZSet.ZRevRangeByScoreEqual should have comment or be unexported (golint)
    • Line 185: warning: exported method ExampleZSet.ZAnyOrderRangeByScoreEqual should have comment or be unexported (golint)
    • Line 218: warning: exported method ExampleZSet.ZRangeByScoreEqualErr should have comment or be unexported (golint)
    • Line 223: warning: exported method ExampleZSet.ZRevRangeByScoreEqualErr should have comment or be unexported (golint)
    • Line 228: warning: exported method ExampleZSet.ZCardEqual should have comment or be unexported (golint)
    • Line 234: warning: exported method ExampleZSet.ZCardEqualErr should have comment or be unexported (golint)
    • Line 239: warning: exported method ExampleZSet.ZScoreEqual should have comment or be unexported (golint)
    • Line 260: warning: exported method ExampleZSet.ZScoreEqualErr should have comment or be unexported (golint)
    • Line 275: warning: should omit 2nd value from range; this loop is equivalent to `for score := range ...` (golint)
    • titan/command/error.go
    • Line 43: warning: comment on exported var ErrExpireSetEx should be of the form "ErrExpireSetEx ..." (golint)
    • Line 100: warning: comment on exported var ErrMinOrMaxNotFloat should be of the form "ErrMinOrMaxNotFloat ..." (golint)
    • titan/db/string.go
    • Line 254: warning: exported method String.BitOpAnd should have comment or be unexported (golint)
    • Line 257: warning: exported method String.BitOpOr should have comment or be unexported (golint)
    • Line 260: warning: exported method String.BitOpXor should have comment or be unexported (golint)
    • Line 263: warning: exported method String.BitOpNot should have comment or be unexported (golint)
    • titan/db/task.go
    • Line 20: warning: exported function RegisterTask should have comment or be unexported (golint)
    • Line 22: warning: don't use underscores in Go names; var task_pool should be taskPool (golint)
    • Line 23: warning: don't use underscores in Go names; var register_list should be registerList (golint)
    • Line 52: warning: exported function NewEtcdClient should have comment or be unexported (golint)
    • Line 63: warning: exported function PdAddrsToEtcd should have comment or be unexported (golint)
    • Line 79: warning: exported type TaskRegister should have comment or be unexported (golint)
    • Line 80: warning: exported type TaskProc should have comment or be unexported (golint)
    • Line 82: warning: exported type TaskPool should have comment or be unexported (golint)
    • Line 89: warning: exported function NewTaskPool should have comment or be unexported (golint)
    • Line 90: warning: don't use underscores in Go names; var task_pool should be taskPool (golint)
    • Line 107: warning: exported method TaskPool.Regist should have comment or be unexported (golint)
    • Line 118: warning: exported method TaskPool.Start should have comment or be unexported (golint)
    • Line 133: warning: exported function RegisterZT should have comment or be unexported (golint)
    • Line 139: warning: exported function RegisterExpireTask should have comment or be unexported (golint)
    • Line 145: warning: exported function RegisterTikvGCTask should have comment or be unexported (golint)
    • Line 151: warning: exported function RegisterGCTask should have comment or be unexported (golint)
    • Line 157: warning: exported function NewTask should have comment or be unexported (golint)
    • Line 174: warning: exported type Task should have comment or be unexported (golint)
    • Line 186: warning: exported method Task.Campaign should have comment or be unexported (golint)
    • titan/db/store/store.go
    • Line 93: warning: exported function IsConflictError should have comment or be unexported (golint)
    • Line 98: warning: exported function RunInNewTxn should have comment or be unexported (golint)
    • Line 117: warning: exported function SetOption should have comment or be unexported (golint)
    • Line 121: warning: exported function DelOption should have comment or be unexported (golint)
    • titan/db/zset.go
    • Line 26: warning: exported type MemberScore should have comment or be unexported (golint)
    • Line 88: warning: exported method ZSet.ZAdd should have comment or be unexported (golint)
    • Line 160: warning: exported method ZSet.MGet should have comment or be unexported (golint)
    • Line 182: warning: exported method ZSet.Exist should have comment or be unexported (golint)
    • Line 186: warning: exported method ZSet.ZAnyOrderRange should have comment or be unexported (golint)
    • Line 365: warning: exported method ZSet.ZRem should have comment or be unexported (golint)
    • Line 428: warning: exported method ZSet.ZCard should have comment or be unexported (golint)
    • Line 432: warning: exported method ZSet.ZScore should have comment or be unexported (golint)
    • titan/command/sets.go
    • Line 204: warning: exported type MinHeap should have comment or be unexported (golint)
    • Line 209: warning: exported method MinHeap.Push should have comment or be unexported (golint)
    • Line 214: warning: exported method MinHeap.Pop should have comment or be unexported (golint)
    • titan/command/zsets.go
    • Line 60: warning: exported function ZRange should have comment or be unexported (golint)
    • Line 64: warning: exported function ZRevRange should have comment or be unexported (golint)
    • Line 106: warning: exported function ZRangeByScore should have comment or be unexported (golint)
    • Line 110: warning: exported function ZRevRangeByScore should have comment or be unexported (golint)
    • Line 168: warning: exported function ZRem should have comment or be unexported (golint)
    • Line 201: warning: exported function ZCard should have comment or be unexported (golint)
    • Line 218: warning: exported function ZScore should have comment or be unexported (golint)

gocyclo85%

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.

    • titan/command/strings.go
    • Line 38: warning: cyclomatic complexity 36 of function Set() is high (> 15) (gocyclo)
    • Line 587: warning: cyclomatic complexity 16 of function BitPos() is high (> 15) (gocyclo)
    • titan/command/constraint.go
    • Line 36: warning: cyclomatic complexity 17 of function (Flag).String() is high (> 15) (gocyclo)
    • Line 100: warning: cyclomatic complexity 16 of function flags() is high (> 15) (gocyclo)
    • titan/db/zset.go
    • Line 268: warning: cyclomatic complexity 31 of function (*ZSet).ZAnyOrderRangeByScore() is high (> 15) (gocyclo)
    • Line 186: warning: cyclomatic complexity 20 of function (*ZSet).ZAnyOrderRange() is high (> 15) (gocyclo)
    • titan/command/server.go
    • Line 26: warning: cyclomatic complexity 45 of function Client() is high (> 15) (gocyclo)
    • Line 231: warning: cyclomatic complexity 20 of function RedisCommand() is high (> 15) (gocyclo)

ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • titan/db/string_test.go
    • Line 23: warning: ineffectual assignment to err (ineffassign)
    • Line 134: warning: ineffectual assignment to err (ineffassign)
    • Line 239: warning: ineffectual assignment to err (ineffassign)
    • Line 313: warning: ineffectual assignment to err (ineffassign)
    • titan/db/hash_test.go
    • Line 224: warning: ineffectual assignment to err (ineffassign)
    • Line 368: warning: ineffectual assignment to err (ineffassign)
    • Line 415: warning: ineffectual assignment to err (ineffassign)
    • Line 462: warning: ineffectual assignment to err (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell90%

Misspell Finds commonly misspelled English words

    • titan/db/llist.go
    • Line 383: warning: "destory" is a misspelling of "destroy" (misspell)
    • Line 509: warning: "destory" is a misspelling of "destroy" (misspell)
    • Line 681: warning: "Destory" is a misspelling of "Destroy" (misspell)
    • Line 682: warning: "Destory" is a misspelling of "Destroy" (misspell)