Preparing report...

Report for github.com/iamduo/workq

A+    Excellent!    Found 44 issues across 80 files

Tweet

gofmt91%

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.

    • workq/int/skiplist/list_test.go
    • Line 78: warning: cyclomatic complexity 31 of function TestInsertAndDelete() is high (> 15) (gocyclo)
    • Line 237: warning: cyclomatic complexity 29 of function TestSearchPath() is high (> 15) (gocyclo)
    • workq/int/job/registry_test.go
    • Line 75: warning: cyclomatic complexity 17 of function TestRunRecord() is high (> 15) (gocyclo)
    • Line 10: warning: cyclomatic complexity 17 of function TestRegistry() is high (> 15) (gocyclo)

golint65%

Golint is a linter for Go source code.

    • workq/int/job/job.go
    • Line 12: warning: exported const MaxName should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: comment on exported const MaxPayload should be of the form "MaxPayload ..." (golint)
    • Line 21: warning: comment on exported const MaxTTR should be of the form "MaxTTR ..." (golint)
    • Line 23: warning: comment on exported const MaxTTL should be of the form "MaxTTL ..." (golint)
    • Line 28: warning: comment on exported const MaxTimeout should be of the form "MaxTimeout ..." (golint)
    • Line 33: warning: exported var ErrInvalidID should have comment or be unexported (golint)
    • Line 46: warning: exported type Job should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function NewEmptyJob should be of the form "NewEmptyJob ..." (golint)
    • Line 64: warning: exported method Job.Expiration should have comment or be unexported (golint)
    • Line 73: warning: comment on exported type ID should be of the form "ID ..." (with optional leading article) (golint)
    • Line 83: warning: exported function ValidateID should have comment or be unexported (golint)
    • Line 94: warning: exported function ValidateName should have comment or be unexported (golint)
    • Line 103: warning: exported function ValidatePayload should have comment or be unexported (golint)
    • Line 111: warning: exported function ValidateResult should have comment or be unexported (golint)
    • Line 119: warning: comment on exported function ValidateTTR should be of the form "ValidateTTR ..." (golint)
    • Line 128: warning: comment on exported function ValidateTTL should be of the form "ValidateTTL ..." (golint)
    • Line 137: warning: comment on exported function ValidateTime should be of the form "ValidateTime ..." (golint)
    • Line 146: warning: exported function ValidateTimeout should have comment or be unexported (golint)
    • workq/int/prot/cmd.go
    • Line 3: warning: comment on exported type Cmd should be of the form "Cmd ..." (with optional leading article) (golint)
    • Line 14: warning: exported function NewCmd should have comment or be unexported (golint)
    • Line 24: warning: exported type CmdFlags should have comment or be unexported (golint)
    • workq/int/cmdlog/clean.go
    • Line 58: warning: exported function NewWarmedCommandCleaner should have comment or be unexported (golint)
    • Line 197: warning: receiver name p should be consistent with previous receiver name c for CommandCleaner (golint)
    • Line 206: warning: receiver name p should be consistent with previous receiver name c for CommandCleaner (golint)
    • workq/int/testutil/utils.go
    • Line 20: warning: exported function GenID should have comment or be unexported (golint)
    • Line 24: warning: exported function GenIDString should have comment or be unexported (golint)
    • Line 28: warning: exported function GenName should have comment or be unexported (golint)
    • Line 32: warning: exported function StartServer should have comment or be unexported (golint)
    • Line 44: warning: exported type Client should have comment or be unexported (golint)
    • Line 50: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 72: warning: exported method Client.Conn should have comment or be unexported (golint)
    • Line 76: warning: exported method Client.Reader should have comment or be unexported (golint)
    • Line 80: warning: exported method Client.Exec should have comment or be unexported (golint)
    • Line 111: warning: exported function Connect should have comment or be unexported (golint)
    • workq/int/job/wqueue.go
    • Line 10: warning: exported type QueueInterface should have comment or be unexported (golint)
    • Line 20: warning: exported type Iterator should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method WorkQueue.Exists should be of the form "Exists ..." (golint)
    • Line 120: warning: comment on exported method WorkQueue.Len should be of the form "Len ..." (golint)
    • Line 192: warning: exported function NewInspector should have comment or be unexported (golint)
    • Line 196: warning: comment on exported method Inspector.Lens should be of the form "Lens ..." (golint)
    • Line 206: warning: exported type QueueControllerInterface should have comment or be unexported (golint)
    • Line 218: warning: comment on exported type QueueController should be of the form "QueueController ..." (with optional leading article) (golint)
    • Line 227: warning: exported function NewQueueController should have comment or be unexported (golint)
    • Line 236: warning: comment on exported method QueueController.Queues should be of the form "Queues ..." (golint)
    • Line 242: warning: comment on exported method QueueController.Queue should be of the form "Queue ..." (golint)
    • Line 294: warning: comment on exported method QueueController.Exists should be of the form "Exists ..." (golint)
    • Line 300: warning: comment on exported method QueueController.Lease should be of the form "Lease ..." (golint)
    • workq/int/handlers/complete.go
    • Line 15: warning: exported type CompleteHandler should have comment or be unexported (golint)
    • Line 19: warning: exported function NewCompleteHandler should have comment or be unexported (golint)
    • Line 25: warning: comment on exported method CompleteHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/job/controller.go
    • Line 10: warning: exported var ErrDuplicateJob should have comment or be unexported (golint)
    • Line 22: warning: exported type Controller should have comment or be unexported (golint)
    • Line 31: warning: exported type ControllerInterface should have comment or be unexported (golint)
    • Line 41: warning: exported type Adder should have comment or be unexported (golint)
    • Line 48: warning: exported type Completer should have comment or be unexported (golint)
    • Line 52: warning: exported type Deleter should have comment or be unexported (golint)
    • Line 56: warning: exported type Failer should have comment or be unexported (golint)
    • Line 60: warning: exported type Runner should have comment or be unexported (golint)
    • Line 64: warning: exported type Scheduler should have comment or be unexported (golint)
    • Line 68: warning: exported type Leaser should have comment or be unexported (golint)
    • Line 76: warning: exported function ValidateAddJob should have comment or be unexported (golint)
    • Line 108: warning: exported function ValidateScheduleJob should have comment or be unexported (golint)
    • Line 112: warning: exported function ValidateRunJob should have comment or be unexported (golint)
    • Line 135: warning: exported function NewController should have comment or be unexported (golint)
    • Line 145: warning: comment on exported method Controller.Add should be of the form "Add ..." (golint)
    • Line 181: warning: comment on exported method Controller.Complete should be of the form "Complete ..." (golint)
    • Line 472: warning: comment on exported method Controller.Schedule should be of the form "Schedule ..." (golint)
    • Line 544: warning: comment on exported method Controller.ExpireFunc should be of the form "ExpireFunc ..." (golint)
    • Line 549: warning: comment on exported method Controller.TimeoutAttempt should be of the form "TimeoutAttempt ..." (golint)
    • Line 592: warning: comment on exported method Controller.TimeoutAttemptFunc should be of the form "TimeoutAttemptFunc ..." (golint)
    • Line 597: warning: comment on exported method Controller.StartAttempt should be of the form "StartAttempt ..." (golint)
    • workq/int/job/registry.go
    • Line 10: warning: exported const StateNew should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported var ErrDuplicate should have comment or be unexported (golint)
    • Line 33: warning: exported function NewRegistry should have comment or be unexported (golint)
    • Line 79: warning: comment on exported method Registry.Record should be of the form "Record ..." (golint)
    • Line 91: warning: comment on exported method Registry.Len should be of the form "Len ..." (golint)
    • Line 99: warning: comment on exported type RunRecord should be of the form "RunRecord ..." (with optional leading article) (golint)
    • Line 112: warning: comment on exported function NewRunRecord should be of the form "NewRunRecord ..." (golint)
    • Line 119: warning: comment on exported method RunRecord.Success should be of the form "Success ..." (golint)
    • Line 124: warning: comment on exported method RunRecord.Running should be of the form "Running ..." (golint)
    • Line 129: warning: comment on exported method RunRecord.Processed should be of the form "Processed ..." (golint)
    • Line 134: warning: comment on exported method RunRecord.WriteResult should be of the form "WriteResult ..." (golint)
    • Line 148: warning: exported type Result should have comment or be unexported (golint)
    • Line 172: warning: exported function NewTimer should have comment or be unexported (golint)
    • workq/int/server/server.go
    • Line 18: warning: comment on exported type Router should be of the form "Router ..." (with optional leading article) (golint)
    • Line 23: warning: comment on exported type CmdRouter should be of the form "CmdRouter ..." (with optional leading article) (golint)
    • Line 38: warning: comment on exported type Server should be of the form "Server ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported method Server.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • Line 92: warning: comment on exported method Server.Stop should be of the form "Stop ..." (golint)
    • workq/int/handlers/delete.go
    • Line 13: warning: exported type DeleteHandler should have comment or be unexported (golint)
    • Line 17: warning: exported function NewDeleteHandler should have comment or be unexported (golint)
    • Line 23: warning: comment on exported method DeleteHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/handlers/fail.go
    • Line 15: warning: exported type FailHandler should have comment or be unexported (golint)
    • Line 19: warning: exported function NewFailHandler should have comment or be unexported (golint)
    • Line 25: warning: comment on exported method FailHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/skiplist/list.go
    • Line 23: warning: exported var ErrDuplicate should have comment or be unexported (golint)
    • Line 36: warning: exported type List should have comment or be unexported (golint)
    • Line 45: warning: exported type Node should have comment or be unexported (golint)
    • Line 138: warning: comment on exported method List.Exists should be of the form "Exists ..." (golint)
    • Line 233: warning: comment on exported method List.Len should be of the form "Len ..." (golint)
    • Line 240: warning: exported method List.Iterator should have comment or be unexported (golint)
    • Line 246: warning: comment on exported type Iterator should be of the form "Iterator ..." (with optional leading article) (golint)
    • Line 252: warning: comment on exported method Iterator.Next should be of the form "Next ..." (golint)
    • Line 265: warning: comment on exported method Iterator.Current should be of the form "Current ..." (golint)
    • workq/int/prot/err.go
    • Line 4: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 22: warning: exported type ErrClient should have comment or be unexported (golint)
    • Line 26: warning: exported type ErrServer should have comment or be unexported (golint)
    • Line 30: warning: exported function NewClientErr should have comment or be unexported (golint)
    • Line 37: warning: exported function NewServerErr should have comment or be unexported (golint)
    • Line 44: warning: exported function NewError should have comment or be unexported (golint)
    • workq/int/prot/prot_test.go
    • Line 118: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 124: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • workq/int/handlers/result.go
    • Line 16: warning: exported type ResultHandler should have comment or be unexported (golint)
    • Line 21: warning: exported function NewResultHandler should have comment or be unexported (golint)
    • Line 28: warning: comment on exported method ResultHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/handlers/schedule.go
    • Line 17: warning: exported type ScheduleHandler should have comment or be unexported (golint)
    • Line 21: warning: exported function NewScheduleHandler should have comment or be unexported (golint)
    • Line 27: warning: comment on exported method ScheduleHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/handlers/unknown.go
    • Line 5: warning: exported type UnknownHandler should have comment or be unexported (golint)
    • Line 7: warning: exported method UnknownHandler.Exec should have comment or be unexported (golint)
    • workq/int/client/client.go
    • Line 12: warning: exported var KeepAlivePeriod should have comment or be unexported (golint)
    • Line 37: warning: exported function New should have comment or be unexported (golint)
    • Line 53: warning: comment on exported method Client.ResetLimit should be of the form "ResetLimit ..." (golint)
    • Line 59: warning: comment on exported method Client.Reader should be of the form "Reader ..." (golint)
    • Line 65: warning: comment on exported method Client.Writer should be of the form "Writer ..." (golint)
    • Line 70: warning: comment on exported method Client.Closer should be of the form "Closer ..." (golint)
    • workq/int/cmdlog/circuit.go
    • Line 47: warning: exported function NewCircuitBreakerAppender should have comment or be unexported (golint)
    • Line 54: warning: exported method CircuitBreakerAppender.Append should have comment or be unexported (golint)
    • Line 89: warning: exported function NewCircuitBreakerRouter should have comment or be unexported (golint)
    • Line 129: warning: exported method CircuitBreakerHandler.Exec should have comment or be unexported (golint)
    • workq/int/handlers/inspect.go
    • Line 31: warning: exported const MaxLimit should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported var ErrInvalidCursorOffset should have comment or be unexported (golint)
    • Line 39: warning: exported type Handler should have comment or be unexported (golint)
    • Line 43: warning: comment on exported type InspectHandler should be of the form "InspectHandler ..." (with optional leading article) (golint)
    • Line 52: warning: exported function NewInspectHandler should have comment or be unexported (golint)
    • Line 68: warning: comment on exported method InspectHandler.Exec should be of the form "Exec ..." (golint)
    • Line 97: warning: exported type ServerStater should have comment or be unexported (golint)
    • Line 101: warning: exported type JobStater should have comment or be unexported (golint)
    • Line 105: warning: exported type InspectServerHandler should have comment or be unexported (golint)
    • Line 110: warning: exported function NewInspectServerHandler should have comment or be unexported (golint)
    • Line 117: warning: comment on exported method InspectServerHandler.Exec should be of the form "Exec ..." (golint)
    • Line 150: warning: exported type InspectQueueHandler should have comment or be unexported (golint)
    • Line 154: warning: exported function NewInspectQueueHandler should have comment or be unexported (golint)
    • Line 158: warning: comment on exported method InspectQueueHandler.Exec should be of the form "Exec ..." (golint)
    • Line 196: warning: exported type InspectQueuesHandler should have comment or be unexported (golint)
    • Line 200: warning: exported function NewInspectQueuesHandler should have comment or be unexported (golint)
    • Line 204: warning: comment on exported method InspectQueuesHandler.Exec should be of the form "Exec ..." (golint)
    • Line 263: warning: comment on exported function QueueResp should be of the form "QueueResp ..." (golint)
    • Line 276: warning: exported type InspectJobsHandler should have comment or be unexported (golint)
    • Line 281: warning: exported function NewInspectJobsHandler should have comment or be unexported (golint)
    • Line 285: warning: comment on exported method InspectJobsHandler.Exec should be of the form "Exec ..." (golint)
    • Line 372: warning: exported type InspectJobHandler should have comment or be unexported (golint)
    • Line 376: warning: exported function NewInspectJobHandler should have comment or be unexported (golint)
    • Line 380: warning: comment on exported method InspectJobHandler.Exec should be of the form "Exec ..." (golint)
    • Line 409: warning: comment on exported function JobResp should be of the form "JobResp ..." (golint)
    • workq/int/prot/prot.go
    • Line 14: warning: exported const CmdAdd should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: comment on exported const MaxRead should be of the form "MaxRead ..." (golint)
    • Line 36: warning: exported var ErrInvalidCmdArgs should have comment or be unexported (golint)
    • Line 45: warning: exported type Interface should have comment or be unexported (golint)
    • Line 51: warning: exported type Prot should have comment or be unexported (golint)
    • Line 53: warning: comment on exported method Prot.ParseCmd should be of the form "ParseCmd ..." (golint)
    • Line 231: warning: exported method Prot.SendReply should have comment or be unexported (golint)
    • Line 235: warning: exported method Prot.SendErr should have comment or be unexported (golint)
    • Line 265: warning: exported function SendReply should have comment or be unexported (golint)
    • Line 272: warning: exported function SendErr should have comment or be unexported (golint)
    • Line 277: warning: exported function OkJobResp should have comment or be unexported (golint)
    • Line 286: warning: exported function OkResultResp should have comment or be unexported (golint)
    • Line 301: warning: exported function OkResp should have comment or be unexported (golint)
    • workq/int/handlers/add.go
    • Line 19: warning: exported type AddHandler should have comment or be unexported (golint)
    • Line 23: warning: exported function NewAddHandler should have comment or be unexported (golint)
    • Line 29: warning: comment on exported method AddHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/cmdlog/cmdlog.go
    • Line 70: warning: exported method ControllerProxy.Add should have comment or be unexported (golint)
    • Line 86: warning: exported method ControllerProxy.Complete should have comment or be unexported (golint)
    • Line 103: warning: exported method ControllerProxy.Fail should have comment or be unexported (golint)
    • Line 120: warning: exported method ControllerProxy.Delete should have comment or be unexported (golint)
    • Line 136: warning: exported method ControllerProxy.Lease should have comment or be unexported (golint)
    • Line 156: warning: exported method ControllerProxy.StartAttempt should have comment or be unexported (golint)
    • Line 162: warning: exported method ControllerProxy.TimeoutAttempt should have comment or be unexported (golint)
    • Line 174: warning: exported method ControllerProxy.HandleTimeoutAttempt should have comment or be unexported (golint)
    • Line 178: warning: exported method ControllerProxy.TimeoutAttemptFunc should have comment or be unexported (golint)
    • Line 182: warning: exported method ControllerProxy.Run should have comment or be unexported (golint)
    • Line 186: warning: exported method ControllerProxy.Schedule should have comment or be unexported (golint)
    • Line 202: warning: exported method ControllerProxy.Expire should have comment or be unexported (golint)
    • Line 214: warning: exported method ControllerProxy.HandleExpire should have comment or be unexported (golint)
    • Line 218: warning: exported method ControllerProxy.ExpireFunc should have comment or be unexported (golint)
    • workq/int/handlers/lease.go
    • Line 8: warning: exported type LeaseHandler should have comment or be unexported (golint)
    • Line 12: warning: exported function NewLeaseHandler should have comment or be unexported (golint)
    • Line 18: warning: comment on exported method LeaseHandler.Exec should be of the form "Exec ..." (golint)
    • workq/int/handlers/run.go
    • Line 16: warning: exported type RunHandler should have comment or be unexported (golint)
    • Line 20: warning: exported function NewRunHandler should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method RunHandler.Exec should be of the form "Exec ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell92%

Misspell Finds commonly misspelled English words

    • workq/int/job/controller.go
    • Line 181: warning: "Sucessfully" is a misspelling of "Successfully" (misspell)
    • Line 374: warning: "naturaly" is a misspelling of "naturally" (misspell)
    • Line 400: warning: "syncronous" is a misspelling of "synchronous" (misspell)
    • Line 664: warning: "neccessary" is a misspelling of "necessary" (misspell)