Preparing report...

Report for github.com/distributedio/titan

A+    Excellent!    Found 33 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!


golint86%

Golint is a linter for Go source code.

    • 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/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)
    • 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/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/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/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/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)

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/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/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)
    • 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/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)

ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • 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)
    • 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)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words