Preparing report...

Report for github.com/wix/supraworker

A+    Excellent!    Found 22 issues across 48 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!


gocyclo87%

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.

    • supraworker/model/request.go
    • Line 211: warning: cyclomatic complexity 20 of function NewRemoteApiRequest() is high (> 15) (gocyclo)
    • Line 135: warning: cyclomatic complexity 18 of function DoApiCall() is high (> 15) (gocyclo)
    • supraworker/communicator/http_test.go
    • Line 149: warning: cyclomatic complexity 18 of function TestGetCommunicatorsFromSectionFetch() is high (> 15) (gocyclo)
    • Line 37: warning: cyclomatic complexity 17 of function TestGetCommunicatorFetch() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • supraworker/communicator/communicator.go
    • Line 34: 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 54: 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)
    • supraworker/communicator/vars.go
    • Line 9: warning: exported type ContextKey should have comment or be unexported (golint)
    • Line 15: warning: exported var ErrNoSuitableCommunicator should have comment or be unexported (golint)
    • Line 30: warning: exported const CtxAllowedResponseCodes should have comment (or a comment on this block) or be unexported (golint)
    • supraworker/config/config.go
    • Line 24: warning: comment on exported const DefaultNumWorkers should be of the form "DefaultNumWorkers ..." (golint)
    • Line 151: warning: exported function GetStringTemplatedDefault should have comment or be unexported (golint)
    • Line 201: warning: exported function GetStringMapStringTemplatedDefault should have comment or be unexported (golint)
    • Line 241: warning: exported function GetStringMapStringTemplated should have comment or be unexported (golint)
    • Line 254: warning: exported function GetStringMapStringTemplatedFromMap should have comment or be unexported (golint)
    • Line 259: warning: exported function GetStringMapStringTemplatedFromMapDefault should have comment or be unexported (golint)
    • Line 286: warning: comment on exported function GetTimeDurationDefault should be of the form "GetTimeDurationDefault ..." (golint)
    • supraworker/config/tests_common.go
    • Line 16: warning: exported function TestMain should have comment or be unexported (golint)
    • Line 20: warning: exported function StringToCfgForTests should have comment or be unexported (golint)
    • Line 42: warning: exported function LoadCfgForTests should have comment or be unexported (golint)
    • Line 66: warning: exported function NewTestServer should have comment or be unexported (golint)
    • Line 89: warning: exported function NewFlakyTestServer should have comment or be unexported (golint)
    • supraworker/model/job.go
    • Line 133: warning: exported method Job.GetParamsWithResend should have comment or be unexported (golint)
    • Line 161: warning: exported method Job.GetParams should have comment or be unexported (golint)
    • Line 300: warning: exported method Job.GetTTR should have comment or be unexported (golint)
    • Line 303: warning: exported method Job.GetTTRDuration should have comment or be unexported (golint)
    • Line 353: warning: exported method Job.TimeoutWithCancel should have comment or be unexported (golint)
    • Line 368: warning: comment on exported method Job.AppendLogStream should be of the form "AppendLogStream ..." (golint)
    • supraworker/utils/context.go
    • Line 10: warning: exported type ContextKey should have comment or be unexported (golint)
    • Line 13: warning: exported const CtxWorkerIdKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported var DefaultRequestTimeout should have comment or be unexported (golint)
    • supraworker/utils/slice_func.go
    • Line 3: warning: exported function ContainsInts should have comment or be unexported (golint)
    • Line 12: warning: exported function ConvertMapStringToInterface should have comment or be unexported (golint)
    • supraworker/config/vars.go
    • Line 5: warning: exported const TimeoutJobsAfter5MinInTerminalState should have comment or be unexported (golint)
    • Line 6: warning: exported const StopReadJobsOutputAfter5Min should have comment or be unexported (golint)
    • Line 7: warning: exported const TimeoutAppendLogStreams should have comment or be unexported (golint)
    • Line 10: warning: comment on exported var CFG_PREFIX_JOBS should be of the form "CFG_PREFIX_JOBS ..." (golint)
    • Line 12: warning: exported var CFG_PREFIX_JOBS_TIMEOUT should have comment or be unexported (golint)
    • Line 19: warning: comment on exported var CFG_PREFIX_ALLOWED_RESPONSE_CODES should be of the form "CFG_PREFIX_ALLOWED_RESPONSE_CODES ..." (golint)
    • Line 22: warning: comment on exported var CFG_PREFIX_BACKOFF should be of the form "CFG_PREFIX_BACKOFF ..." (golint)
    • Line 27: warning: comment on exported var CFG_PREFIX_BACKOFF_MAXINTERVAL should be of the form "CFG_PREFIX_BACKOFF_MAXINTERVAL ..." (golint)
    • Line 29: warning: comment on exported var CFG_PREFIX_BACKOFF_MAXELAPSEDTIME should be of the form "CFG_PREFIX_BACKOFF_MAXELAPSEDTIME ..." (golint)
    • supraworker/model/vars.go
    • Line 9: warning: exported type ContextKey should have comment or be unexported (golint)
    • Line 12: warning: exported const CtxKeyRequestTimeout should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported var ErrFailedSendRequest should have comment or be unexported (golint)
    • Line 50: warning: exported const JOB_STATUS_PENDING should have comment (or a comment on this block) or be unexported (golint)
    • supraworker/metrics/http_endpoint.go
    • Line 51: warning: exported function Get should have comment or be unexported (golint)
    • Line 63: warning: exported function StartAll should have comment or be unexported (golint)
    • Line 73: warning: exported function StopAll should have comment or be unexported (golint)
    • Line 83: warning: exported function NewSrvSession should have comment or be unexported (golint)
    • Line 96: warning: exported method SrvSession.AddHandler should have comment or be unexported (golint)
    • Line 101: warning: exported method SrvSession.AddHandleFunc should have comment or be unexported (golint)
    • Line 113: warning: exported function AddPrometheusMetricsHandler should have comment or be unexported (golint)
    • Line 119: warning: exported function AddPProf should have comment or be unexported (golint)
    • Line 132: warning: exported function StartHealthCheck should have comment or be unexported (golint)
    • Line 138: warning: exported function WaitForShutdown should have comment or be unexported (golint)
    • supraworker/worker/vars.go
    • Line 8: warning: comment on exported var NumActiveJobs should be of the form "NumActiveJobs ..." (golint)
    • Line 10: warning: comment on exported var NumProcessedJobs should be of the form "NumProcessedJobs ..." (golint)
    • supraworker/communicator/http.go
    • Line 53: warning: comment on exported function NewConfiguredRestCommunicator should be of the form "NewConfiguredRestCommunicator ..." (golint)
    • Line 126: warning: exported method RestCommunicator.Fetch should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell97%

Misspell Finds commonly misspelled English words