Preparing report...

Report for github.com/bitleak/lmstfy

A+    Excellent!    Found 41 issues across 59 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


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!


gocyclo91%

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.


golint38%

Golint is a linter for Go source code.

    • lmstfy/server/handlers/admin.go
    • Line 22: warning: comment on exported function PrometheusMetrics should be of the form "PrometheusMetrics ..." (golint)
    • Line 27: warning: comment on exported function ListPools should be of the form "ListPools ..." (golint)
    • Line 33: warning: comment on exported function ListTokens should be of the form "ListTokens ..." (golint)
    • Line 54: warning: comment on exported function NewToken should be of the form "NewToken ..." (golint)
    • Line 109: warning: comment on exported function DeleteToken should be of the form "DeleteToken ..." (golint)
    • Line 140: warning: comment on exported function ListLimiters should be of the form "ListLimiters ..." (golint)
    • Line 146: warning: comment on exported function AddLimiter should be of the form "AddLimiter ..." (golint)
    • Line 178: warning: comment on exported function DeleteLimiter should be of the form "DeleteLimiter ..." (golint)
    • Line 195: warning: comment on exported function GetLimiter should be of the form "GetLimiter ..." (golint)
    • Line 207: warning: comment on exported function SetLimiter should be of the form "SetLimiter ..." (golint)
    • Line 239: warning: comment on exported function Version should be of the form "Version ..." (golint)
    • Line 248: warning: exported function PProf should have comment or be unexported (golint)
    • Line 259: warning: comment on exported function EngineMetaInfo should be of the form "EngineMetaInfo ..." (golint)
    • lmstfy/uuid/uuid.go
    • Line 20: warning: comment on exported function GenUniqueID should be of the form "GenUniqueID ..." (golint)
    • Line 29: warning: comment on exported function GenUniqueJobIDWithDelay should be of the form "GenUniqueJobIDWithDelay ..." (golint)
    • Line 41: warning: exported function UniqueIDToBinary should have comment or be unexported (golint)
    • Line 45: warning: exported function BinaryToUniqueID should have comment or be unexported (golint)
    • Line 49: warning: exported function ElapsedMilliSecondFromUniqueID should have comment or be unexported (golint)
    • Line 58: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 63: warning: exported function ExtractDelaySecondFromUniqueID should have comment or be unexported (golint)
    • lmstfy/throttler/throttler.go
    • Line 44: warning: comment on exported type Limiter should be of the form "Limiter ..." (with optional leading article) (golint)
    • Line 51: warning: comment on exported type TokenLimiter should be of the form "TokenLimiter ..." (with optional leading article) (golint)
    • Line 133: warning: comment on exported method Throttler.IsReachRateLimit should be of the form "IsReachRateLimit ..." (golint)
    • lmstfy/auth/token.go
    • Line 20: warning: exported const TokenPrefix should have comment or be unexported (golint)
    • Line 22: warning: exported var ErrPoolNotExist should have comment or be unexported (golint)
    • Line 27: warning: exported type TokenManager should have comment or be unexported (golint)
    • Line 61: warning: exported function NewTokenManager should have comment or be unexported (golint)
    • Line 93: warning: exported method TokenManager.Exist should have comment or be unexported (golint)
    • Line 112: warning: exported method TokenManager.Delete should have comment or be unexported (golint)
    • Line 122: warning: exported method TokenManager.List should have comment or be unexported (golint)
    • Line 153: warning: exported function GetTokenManager should have comment or be unexported (golint)
    • lmstfy/server/route.go
    • Line 11: warning: exported function SetupRoutes should have comment or be unexported (golint)
    • Line 52: warning: exported function SetupAdminRoutes should have comment or be unexported (golint)
    • lmstfy/server/handlers/middleware.go
    • Line 33: warning: exported function SetupQueueEngine should have comment or be unexported (golint)
    • Line 46: warning: exported function ValidateToken should have comment or be unexported (golint)
    • Line 70: warning: comment on exported function ValidateParams should be of the form "ValidateParams ..." (golint)
    • Line 91: warning: exported function ValidateMultiConsume should have comment or be unexported (golint)
    • Line 106: warning: exported function CheckPoolExists should have comment or be unexported (golint)
    • lmstfy/engine/redis/engine.go
    • Line 15: warning: exported type RedisInstance should have comment or be unexported (golint)
    • Line 32: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 64: warning: exported method Engine.Publish should have comment or be unexported (golint)
    • Line 184: warning: exported method Engine.Delete should have comment or be unexported (golint)
    • Line 193: warning: exported method Engine.Peek should have comment or be unexported (golint)
    • Line 223: warning: exported method Engine.Size should have comment or be unexported (golint)
    • Line 228: warning: exported method Engine.Destroy should have comment or be unexported (golint)
    • Line 235: warning: exported method Engine.PeekDeadLetter should have comment or be unexported (golint)
    • Line 243: warning: exported method Engine.DeleteDeadLetter should have comment or be unexported (golint)
    • Line 251: warning: exported method Engine.RespawnDeadLetter should have comment or be unexported (golint)
    • Line 268: warning: exported method Engine.Shutdown should have comment or be unexported (golint)
    • Line 272: warning: exported method Engine.DumpInfo should have comment or be unexported (golint)
    • lmstfy/engine/redis/info.go
    • Line 9: warning: exported type RedisInfo should have comment or be unexported (golint)
    • Line 18: warning: exported function GetRedisInfo should have comment or be unexported (golint)
    • Line 89: warning: exported function RedisInstanceMonitor should have comment or be unexported (golint)
    • lmstfy/engine/redis/queue.go
    • Line 28: warning: exported type QueueName should have comment or be unexported (golint)
    • Line 37: warning: exported method QueueName.Decode should have comment or be unexported (golint)
    • Line 56: warning: exported function NewQueue should have comment or be unexported (golint)
    • Line 69: warning: exported method Queue.Name should have comment or be unexported (golint)
    • Line 87: warning: comment on exported method Queue.Poll should be of the form "Poll ..." (golint)
    • Line 94: warning: comment on exported method Queue.Size should be of the form "Size ..." (golint)
    • Line 114: warning: exported method Queue.Destroy should have comment or be unexported (golint)
    • Line 137: warning: exported function PreloadQueueLuaScript should have comment or be unexported (golint)
    • Line 176: warning: comment on exported function PollQueues should be of the form "PollQueues ..." (golint)
    • lmstfy/client/errors.go
    • Line 5: warning: comment on exported type ErrType should be of the form "ErrType ..." (with optional leading article) (golint)
    • Line 9: warning: exported const RequestErr should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: comment on exported type APIError should be of the form "APIError ..." (with optional leading article) (golint)
    • lmstfy/log/utils.go
    • Line 11: warning: comment on exported function ReopenLogs should be of the form "ReopenLogs ..." (golint)
    • Line 36: warning: comment on exported function SetupLogger should be of the form "SetupLogger ..." (golint)
    • lmstfy/server/handlers/throttler.go
    • Line 14: warning: exported const ThrottleActionConsume should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported function Throttle should have comment or be unexported (golint)
    • lmstfy/engine/redis/metrics.go
    • Line 12: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 49: warning: exported const Namespace should have comment (or a comment on this block) or be unexported (golint)
    • Line 138: warning: exported type SizeProvider should have comment or be unexported (golint)
    • Line 142: warning: exported type SizeMonitor should have comment or be unexported (golint)
    • Line 150: warning: exported function NewSizeMonitor should have comment or be unexported (golint)
    • Line 164: warning: exported method SizeMonitor.Loop should have comment or be unexported (golint)
    • Line 171: warning: exported method SizeMonitor.MonitorIfNotExist should have comment or be unexported (golint)
    • Line 186: warning: exported method SizeMonitor.Remove should have comment or be unexported (golint)
    • lmstfy/engine/migration/engine.go
    • Line 9: warning: exported type Engine should have comment or be unexported (golint)
    • Line 14: warning: exported function NewEngine should have comment or be unexported (golint)
    • Line 21: warning: exported method Engine.Publish should have comment or be unexported (golint)
    • Line 34: warning: exported method Engine.Consume should have comment or be unexported (golint)
    • Line 42: warning: exported method Engine.Delete should have comment or be unexported (golint)
    • Line 50: warning: exported method Engine.Peek should have comment or be unexported (golint)
    • Line 58: warning: exported method Engine.Size should have comment or be unexported (golint)
    • Line 67: warning: exported method Engine.Destroy should have comment or be unexported (golint)
    • Line 76: warning: exported method Engine.PeekDeadLetter should have comment or be unexported (golint)
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 92: warning: exported method Engine.DeleteDeadLetter should have comment or be unexported (golint)
    • Line 101: warning: exported method Engine.RespawnDeadLetter should have comment or be unexported (golint)
    • Line 120: warning: exported method Engine.Shutdown should have comment or be unexported (golint)
    • Line 125: warning: exported method Engine.DumpInfo should have comment or be unexported (golint)
    • lmstfy/server/handlers/setup.go
    • Line 14: warning: exported var DefaultTTL should have comment or be unexported (golint)
    • Line 21: warning: exported function Setup should have comment or be unexported (golint)
    • Line 26: warning: exported function GetHTTPLogger should have comment or be unexported (golint)
    • Line 34: warning: exported function SetupParamDefaults should have comment or be unexported (golint)
    • lmstfy/engine/redis/hooks/metrics.go
    • Line 16: warning: exported type MetricsHook should have comment or be unexported (golint)
    • Line 20: warning: exported function NewMetricsHook should have comment or be unexported (golint)
    • Line 24: warning: exported method MetricsHook.BeforeProcess should have comment or be unexported (golint)
    • Line 25: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 28: warning: exported method MetricsHook.AfterProcess should have comment or be unexported (golint)
    • Line 33: warning: exported method MetricsHook.BeforeProcessPipeline should have comment or be unexported (golint)
    • Line 34: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 37: warning: exported method MetricsHook.AfterProcessPipeline should have comment or be unexported (golint)
    • lmstfy/engine/job.go
    • Line 12: warning: exported type Job should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function NewJob should be of the form "NewJob ..." (golint)
    • Line 54: warning: exported function NewJobWithID should have comment or be unexported (golint)
    • lmstfy/engine/pool.go
    • Line 6: warning: exported const KindRedis should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported function GetEngineByKind should have comment or be unexported (golint)
    • Line 23: warning: exported function GetPoolsByKind should have comment or be unexported (golint)
    • Line 35: warning: exported function GetPools should have comment or be unexported (golint)
    • Line 39: warning: exported function ExistsPool should have comment or be unexported (golint)
    • Line 46: warning: exported function GetEngine should have comment or be unexported (golint)
    • Line 57: warning: exported function Register should have comment or be unexported (golint)
    • Line 64: warning: exported function Shutdown should have comment or be unexported (golint)
    • lmstfy/engine/redis/timer.go
    • Line 78: warning: exported method Timer.Name should have comment or be unexported (golint)
    • Line 82: warning: exported method Timer.Add should have comment or be unexported (golint)
    • Line 148: warning: exported method Timer.Shutdown should have comment or be unexported (golint)
    • Line 152: warning: exported method Timer.Size should have comment or be unexported (golint)
    • lmstfy/engine/redis/timer_test.go
    • Line 68: warning: don't use underscores in Go names; func benchmarkTimer_Add should be benchmarkTimerAdd (golint)
    • Line 79: warning: don't use underscores in Go names; func benchmarkTimer_Pop should be benchmarkTimerPop (golint)
    • lmstfy/engine/redis/pool.go
    • Line 17: warning: exported function NewPool should have comment or be unexported (golint)
    • Line 23: warning: exported function PoolJobKey should have comment or be unexported (golint)
    • Line 27: warning: exported function PoolJobKey2 should have comment or be unexported (golint)
    • Line 31: warning: exported function PoolJobKeyPrefix should have comment or be unexported (golint)
    • Line 35: warning: exported method Pool.Add should have comment or be unexported (golint)
    • Line 53: warning: exported method Pool.Get should have comment or be unexported (golint)
    • Line 79: warning: exported method Pool.Delete should have comment or be unexported (golint)
    • lmstfy/client/client.go
    • Line 18: warning: exported type Job should have comment or be unexported (golint)
    • Line 27: warning: exported type LmstfyClient should have comment or be unexported (golint)
    • Line 45: warning: exported function NewLmstfyClient should have comment or be unexported (golint)
    • Line 85: warning: exported method LmstfyClient.ConfigRetry should have comment or be unexported (golint)
    • Line 395: warning: comment on exported method LmstfyClient.BatchConsumeWithFreezeTries should be of the form "BatchConsumeWithFreezeTries ..." (golint)
    • Line 502: warning: comment on exported method LmstfyClient.ConsumeFromQueues should be of the form "ConsumeFromQueues ..." (golint)
    • Line 510: warning: exported method LmstfyClient.ConsumeFromQueuesWithFreezeTries should have comment or be unexported (golint)
    • Line 585: warning: comment on exported method LmstfyClient.Ack should be of the form "Ack ..." (golint)
    • Line 612: warning: comment on exported method LmstfyClient.QueueSize should be of the form "QueueSize ..." (golint)
    • Line 660: warning: comment on exported method LmstfyClient.PeekQueue should be of the form "PeekQueue ..." (golint)
    • Line 710: warning: comment on exported method LmstfyClient.PeekJob should be of the form "PeekJob ..." (golint)
    • Line 760: warning: comment on exported method LmstfyClient.PeekDeadLetter should be of the form "PeekDeadLetter ..." (golint)
    • Line 809: warning: exported method LmstfyClient.RespawnDeadLetter should have comment or be unexported (golint)
    • Line 869: warning: exported method LmstfyClient.DeleteDeadLetter should have comment or be unexported (golint)
    • lmstfy/log/backtrack.go
    • Line 11: warning: exported type BackTrackHook should have comment or be unexported (golint)
    • Line 15: warning: exported method BackTrackHook.Levels should have comment or be unexported (golint)
    • Line 25: warning: exported method BackTrackHook.Fire should have comment or be unexported (golint)
    • Line 55: warning: exported function NewBackTrackHook should have comment or be unexported (golint)
    • lmstfy/engine/redis/deadletter.go
    • Line 57: warning: comment on exported function PreloadDeadLetterLuaScript should be of the form "PreloadDeadLetterLuaScript ..." (golint)
    • Line 95: warning: exported method DeadLetter.Name should have comment or be unexported (golint)
    • Line 113: warning: exported method DeadLetter.Peek should have comment or be unexported (golint)
    • Line 134: warning: exported method DeadLetter.Delete should have comment or be unexported (golint)
    • Line 187: warning: exported method DeadLetter.Respawn should have comment or be unexported (golint)
    • Line 251: warning: exported method DeadLetter.Size should have comment or be unexported (golint)
    • lmstfy/config/config.go
    • Line 16: warning: exported const DefaultPoolName should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • Line 47: warning: exported type RedisPool should have comment or be unexported (golint)
    • Line 49: warning: exported type RedisConf should have comment or be unexported (golint)
    • lmstfy/server/handlers/queue.go
    • Line 20: warning: comment on exported function Publish should be of the form "Publish ..." (golint)
    • Line 112: warning: comment on exported function PublishBulk should be of the form "PublishBulk ..." (golint)
    • Line 209: warning: comment on exported function Consume should be of the form "Consume ..." (golint)
    • Line 316: warning: comment on exported function Delete should be of the form "Delete ..." (golint)
    • Line 337: warning: comment on exported function PeekQueue should be of the form "PeekQueue ..." (golint)
    • Line 359: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 373: warning: comment on exported function PeekJob should be of the form "PeekJob ..." (golint)
    • Line 394: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 408: warning: comment on exported function Size should be of the form "Size ..." (golint)
    • Line 457: warning: comment on exported function PeekDeadLetter should be of the form "PeekDeadLetter ..." (golint)
    • Line 486: warning: comment on exported function RespawnDeadLetter should be of the form "RespawnDeadLetter ..." (golint)
    • Line 531: warning: comment on exported function DeleteDeadLetter should be of the form "DeleteDeadLetter ..." (golint)
    • Line 567: warning: exported function DestroyQueue should have comment or be unexported (golint)
    • lmstfy/engine/redis/meta.go
    • Line 15: warning: exported type MetaManager should have comment or be unexported (golint)
    • Line 22: warning: exported function NewMetaManager should have comment or be unexported (golint)
    • Line 32: warning: exported method MetaManager.RecordIfNotExist should have comment or be unexported (golint)
    • Line 54: warning: exported method MetaManager.Remove should have comment or be unexported (golint)
    • Line 62: warning: exported method MetaManager.ListNamespaces should have comment or be unexported (golint)
    • Line 73: warning: exported method MetaManager.ListQueues should have comment or be unexported (golint)
    • Line 108: warning: exported method MetaManager.Dump should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • lmstfy/engine/migration/engine_test.go
    • Line 25: warning: ineffectual assignment to err (ineffassign)
    • Line 67: warning: ineffectual assignment to err (ineffassign)
    • Line 117: warning: ineffectual assignment to err (ineffassign)
    • Line 126: warning: ineffectual assignment to err (ineffassign)
    • Line 210: warning: ineffectual assignment to err (ineffassign)
    • Line 218: warning: ineffectual assignment to err (ineffassign)
    • Line 219: warning: ineffectual assignment to err (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!