Preparing report...

Report for github.com/raomuyang/sikong-mq

A    Great!    Found 23 issues across 26 files

Tweet

gofmt96%

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!


gocyclo100%

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.

No problems detected. Good job!


golint11%

Golint is a linter for Go source code.

    • sikong-mq/skmq/base/util.go
    • Line 13: warning: exported function UnmarshalJsonFile should have comment or be unexported (golint)
    • Line 40: warning: exported function RandSeconds should have comment or be unexported (golint)
    • Line 46: warning: exported type Backoff should have comment or be unexported (golint)
    • Line 51: warning: exported method Backoff.Increase should have comment or be unexported (golint)
    • Line 63: warning: exported method Backoff.GetLimit should have comment or be unexported (golint)
    • Line 70: warning: exported method Backoff.Reset should have comment or be unexported (golint)
    • sikong-mq/skmq/init.go
    • Line 10: warning: exported var Trace should have comment or be unexported (golint)
    • Line 19: warning: exported var Configuration should have comment or be unexported (golint)
    • sikong-mq/skmq/exchange/types.go
    • Line 8: warning: exported type MQConfig should have comment or be unexported (golint)
    • Line 9: warning: exported type DBConfig should have comment or be unexported (golint)
    • Line 12: warning: exported var Trace should have comment or be unexported (golint)
    • sikong-mq/skmq/base/contants.go
    • Line 89: warning: exported const Alive should have comment (or a comment on this block) or be unexported (golint)
    • Line 94: warning: exported const ConnectTimeOut should have comment (or a comment on this block) or be unexported (golint)
    • Line 99: warning: exported const DefaultConf should have comment (or a comment on this block) or be unexported (golint)
    • sikong-mq/skmq/process/msghandler.go
    • Line 11: warning: exported type MessageHandler should have comment or be unexported (golint)
    • Line 15: warning: exported type MessageHandlerImpl should have comment or be unexported (golint)
    • Line 19: warning: exported function GetMessageHandler should have comment or be unexported (golint)
    • Line 145: warning: exported method MessageHandlerImpl.HandleMessage should have comment or be unexported (golint)
    • sikong-mq/skmq/postoffice.go
    • Line 19: warning: exported const SendBuf should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported function OpenServer should have comment or be unexported (golint)
    • Line 39: warning: exported function StopServer should have comment or be unexported (golint)
    • sikong-mq/sikong.go
    • Line 15: warning: exported const DebugPort should have comment or be unexported (golint)
    • Line 27: warning: exported function LoadConf should have comment or be unexported (golint)
    • sikong-mq/skmq/process/cache.go
    • Line 13: warning: exported type Cache should have comment or be unexported (golint)
    • Line 37: warning: exported type MessageCache should have comment or be unexported (golint)
    • Line 43: warning: exported function InitDBConfig should have comment or be unexported (golint)
    • Line 93: warning: comment on exported method MessageCache.SaveRecipientInfo should be of the form "SaveRecipientInfo ..." (golint)
    • Line 126: warning: exported method MessageCache.UpdateRecipient should have comment or be unexported (golint)
    • Line 161: warning: comment on exported method MessageCache.FindRecipients should be of the form "FindRecipients ..." (golint)
    • Line 187: warning: exported method MessageCache.GetRecipientById should have comment or be unexported (golint)
    • Line 208: warning: comment on exported method MessageCache.RecentlyAssignedRecord should be of the form "RecentlyAssignedRecord ..." (golint)
    • Line 231: warning: exported method MessageCache.UpdateRecipientAssigned should have comment or be unexported (golint)
    • Line 243: warning: exported method MessageCache.ResetRecipientAssignedRecord should have comment or be unexported (golint)
    • Line 255: warning: comment on exported method MessageCache.GetMessageInfo should be of the form "GetMessageInfo ..." (golint)
    • Line 294: warning: exported method MessageCache.DeleteMessage should have comment or be unexported (golint)
    • Line 311: warning: exported method MessageCache.UpdateMessageStatus should have comment or be unexported (golint)
    • Line 325: warning: comment on exported method MessageCache.MessageEnqueue should be of the form "MessageEnqueue ..." (golint)
    • Line 361: warning: comment on exported method MessageCache.MessageDequeue should be of the form "MessageDequeue ..." (golint)
    • Line 417: warning: comment on exported method MessageCache.MessageEntryRetryQueue should be of the form "MessageEntryRetryQueue ..." (golint)
    • Line 460: warning: comment on exported method MessageCache.DeadLetterEnqueue should be of the form "DeadLetterEnqueue ..." (golint)
    • Line 489: warning: exported method MessageCache.MessagePostRecords should have comment or be unexported (golint)
    • Line 506: warning: exported method MessageCache.AddApplication should have comment or be unexported (golint)
    • Line 515: warning: exported method MessageCache.GetApps should have comment or be unexported (golint)
    • Line 521: warning: exported method MessageCache.Locker should have comment or be unexported (golint)
    • Line 525: warning: exported type ResourceLock should have comment or be unexported (golint)
    • Line 531: warning: exported method ResourceLock.TryLock should have comment or be unexported (golint)
    • Line 548: warning: exported method ResourceLock.Unlock should have comment or be unexported (golint)
    • Line 554: warning: exported method ResourceLock.ExpireTime should have comment or be unexported (golint)
    • Line 562: warning: exported method ResourceLock.SetExpireTime should have comment or be unexported (golint)
    • Line 566: warning: exported method ResourceLock.Prefix should have comment or be unexported (golint)
    • Line 573: warning: exported method ResourceLock.SetPrefix should have comment or be unexported (golint)
    • sikong-mq/skmq/lock/lock.go
    • Line 12: warning: exported const PREFIX should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type RedisLock should have comment or be unexported (golint)
    • Line 23: warning: exported function NewLock should have comment or be unexported (golint)
    • Line 40: warning: exported method RedisLock.TryLock should have comment or be unexported (golint)
    • Line 58: warning: exported method RedisLock.Unlock should have comment or be unexported (golint)
    • Line 64: warning: exported method RedisLock.ExpireTime should have comment or be unexported (golint)
    • Line 72: warning: exported method RedisLock.SetExpireTime should have comment or be unexported (golint)
    • sikong-mq/skmq/skerr/error.go
    • Line 5: warning: exported type StreamReadError should have comment or be unexported (golint)
    • Line 14: warning: exported type MessageHandleError should have comment or be unexported (golint)
    • Line 22: warning: exported type UnknownDBOperationException should have comment or be unexported (golint)
    • Line 30: warning: exported type MsgAlreadyExists should have comment or be unexported (golint)
    • Line 39: warning: exported type AttrTypeError should have comment or be unexported (golint)
    • Line 48: warning: exported type NoSuchMessage should have comment or be unexported (golint)
    • Line 57: warning: exported type MessageDead should have comment or be unexported (golint)
    • Line 68: warning: exported type InvalidParameters should have comment or be unexported (golint)
    • Line 76: warning: exported type NoneAvailableRecipient should have comment or be unexported (golint)
    • sikong-mq/skmq/postman.go
    • Line 13: warning: exported type Postman should have comment or be unexported (golint)
    • Line 19: warning: exported function InitPostman should have comment or be unexported (golint)
    • sikong-mq/skmq/process/io.go
    • Line 20: warning: comment on exported function SendMessage should be of the form "SendMessage ..." (golint)
    • Line 28: warning: exported function WriteBuffer should have comment or be unexported (golint)
    • Line 48: warning: exported function ReadStream should have comment or be unexported (golint)
    • Line 69: warning: comment on exported function DecodeMessage should be of the form "DecodeMessage ..." (golint)
    • Line 145: warning: exported function EncodeMessage should have comment or be unexported (golint)
    • sikong-mq/skmq/process/logger.go
    • Line 10: warning: exported const DefaultLogFile should have comment or be unexported (golint)
    • Line 13: warning: exported const TRAC should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported var Trace should have comment or be unexported (golint)
    • Line 34: warning: exported function SetLogLevel should have comment or be unexported (golint)
    • Line 58: warning: exported function LoggerSetup should have comment or be unexported (golint)
    • sikong-mq/demo/distributed_lock_demo.go
    • Line 11: warning: exported function DistributedLockDemo should have comment or be unexported (golint)
    • Line 39: warning: exported function CreateLockByPool should have comment or be unexported (golint)
    • Line 43: warning: exported function LoadConf should have comment or be unexported (golint)
    • sikong-mq/skmq/ratelimiter/rate.go
    • Line 12: warning: exported type RateLimiter should have comment or be unexported (golint)
    • Line 22: warning: exported type TokenBucketLimiter should have comment or be unexported (golint)
    • Line 31: warning: exported method TokenBucketLimiter.SetRate should have comment or be unexported (golint)
    • Line 37: warning: exported method TokenBucketLimiter.GetRate should have comment or be unexported (golint)
    • Line 41: warning: exported method TokenBucketLimiter.Acquire should have comment or be unexported (golint)
    • Line 55: warning: exported method TokenBucketLimiter.TryAcquire should have comment or be unexported (golint)
    • Line 120: warning: exported function CreateTokenBucket should have comment or be unexported (golint)
    • Line 128: warning: exported function CustomTokenBucket should have comment or be unexported (golint)
    • Line 137: warning: exported type Stopwatch should have comment or be unexported (golint)
    • Line 143: warning: exported method Stopwatch.Start should have comment or be unexported (golint)
    • Line 152: warning: exported method Stopwatch.Stop should have comment or be unexported (golint)
    • Line 161: warning: exported method Stopwatch.ElapsedNanos should have comment or be unexported (golint)
    • Line 168: warning: exported method Stopwatch.Reset should have comment or be unexported (golint)
    • Line 173: warning: exported function CreateStartedStopwatch should have comment or be unexported (golint)
    • sikong-mq/skmq/deadletter.go
    • Line 7: warning: exported type DeadLetterHandler should have comment or be unexported (golint)
    • Line 11: warning: exported type DefaultDeadLetterHandler should have comment or be unexported (golint)
    • Line 13: warning: exported method DefaultDeadLetterHandler.Process should have comment or be unexported (golint)
    • Line 21: warning: exported function SetDeadLetterHandler should have comment or be unexported (golint)
    • sikong-mq/skmq/exchange/exchange.go
    • Line 14: warning: exported type Exchange should have comment or be unexported (golint)
    • Line 25: warning: exported type DataExchange should have comment or be unexported (golint)
    • Line 29: warning: exported function GetExchange should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method DataExchange.CheckRecipientsAvailable should be of the form "CheckRecipientsAvailable ..." (golint)
    • Line 79: warning: comment on exported method DataExchange.Heartbeat should be of the form "Heartbeat ..." (golint)
    • Line 106: warning: comment on exported method DataExchange.ReplyHeartbeat should be of the form "ReplyHeartbeat ..." (golint)
    • Line 116: warning: exported method DataExchange.RecipientBalance should have comment or be unexported (golint)
    • Line 149: warning: comment on exported method DataExchange.Unicast should be of the form "Unicast ..." (golint)
    • Line 180: warning: comment on exported method DataExchange.BroadcastConnect should be of the form "BroadcastConnect ..." (golint)
    • Line 207: warning: exported method DataExchange.DeliveryContent should have comment or be unexported (golint)
    • Line 211: warning: comment on exported method DataExchange.RemoveLostRecipient should be of the form "RemoveLostRecipient ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!