Preparing report...

Report for github.com/gojektech/proctor

B    Not bad!    Found 91 issues across 101 files

Tweet

gofmt44%

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!


gocyclo99%

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.


golint34%

Golint is a linter for Go source code.

    • proctor/io/printer.go
    • Line 5: warning: exported type Printer should have comment or be unexported (golint)
    • Line 13: warning: exported function GetPrinter should have comment or be unexported (golint)
    • proctor/proctord/jobs/secrets/store.go
    • Line 9: warning: exported const JobsSecretsKeySuffix should have comment or be unexported (golint)
    • Line 11: warning: exported type Store should have comment or be unexported (golint)
    • Line 20: warning: exported function NewStore should have comment or be unexported (golint)
    • proctor/proctord/audit/auditor_mock.go
    • Line 8: warning: exported type MockAuditor should have comment or be unexported (golint)
    • Line 12: warning: exported method MockAuditor.JobsExecution should have comment or be unexported (golint)
    • Line 16: warning: exported method MockAuditor.JobsExecutionAndStatus should have comment or be unexported (golint)
    • Line 20: warning: exported method MockAuditor.JobsExecutionStatus should have comment or be unexported (golint)
    • proctor/proctord/utility/buffer.go
    • Line 8: warning: exported type Buffer should have comment or be unexported (golint)
    • Line 14: warning: exported function NewBuffer should have comment or be unexported (golint)
    • Line 20: warning: exported method Buffer.Close should have comment or be unexported (golint)
    • Line 27: warning: exported method Buffer.WasClosed should have comment or be unexported (golint)
    • proctor/proctord/utility/utils.go
    • Line 11: warning: exported const ClientError should have comment or be unexported (golint)
    • Line 12: warning: exported const NonExistentProcClientError should have comment or be unexported (golint)
    • Line 13: warning: exported const InvalidCronExpressionClientError should have comment or be unexported (golint)
    • Line 14: warning: exported const InvalidEmailIdClientError should have comment or be unexported (golint)
    • Line 15: warning: exported const InvalidTagError should have comment or be unexported (golint)
    • Line 16: warning: exported const DuplicateJobNameArgsClientError should have comment or be unexported (golint)
    • Line 17: warning: exported const ServerError should have comment or be unexported (golint)
    • Line 18: warning: exported const NoScheduledJobsError should have comment or be unexported (golint)
    • Line 20: warning: exported const UnauthorizedErrorMissingConfig should have comment or be unexported (golint)
    • Line 21: warning: exported const UnauthorizedErrorInvalidConfig should have comment or be unexported (golint)
    • Line 22: warning: exported const GenericListCmdError should have comment or be unexported (golint)
    • Line 23: warning: exported const GenericProcCmdError should have comment or be unexported (golint)
    • Line 24: warning: exported const GenericDescribeCmdError should have comment or be unexported (golint)
    • Line 25: warning: exported const JobForbiddenErrorHeader should have comment or be unexported (golint)
    • Line 27: warning: exported const UnauthorizedErrorHeader should have comment or be unexported (golint)
    • Line 28: warning: exported const GenericTimeoutErrorHeader should have comment or be unexported (golint)
    • Line 29: warning: exported const GenericNetworkErrorHeader should have comment or be unexported (golint)
    • Line 30: warning: exported const GenericResponseErrorHeader should have comment or be unexported (golint)
    • Line 32: warning: exported const ConfigProctorHostMissingError should have comment or be unexported (golint)
    • Line 33: warning: exported const GenericTimeoutErrorBody should have comment or be unexported (golint)
    • Line 34: warning: exported const ClientOutdatedErrorMessage should have comment or be unexported (golint)
    • Line 36: warning: exported const JobSubmissionSuccess should have comment or be unexported (golint)
    • Line 37: warning: exported const JobSubmissionClientError should have comment or be unexported (golint)
    • Line 38: warning: exported const JobSubmissionServerError should have comment or be unexported (golint)
    • Line 39: warning: exported const JobNotFoundError should have comment or be unexported (golint)
    • Line 40: warning: exported const JobSucceeded should have comment or be unexported (golint)
    • Line 41: warning: exported const JobFailed should have comment or be unexported (golint)
    • Line 42: warning: exported const JobWaiting should have comment or be unexported (golint)
    • Line 43: warning: exported const JobNotFound should have comment or be unexported (golint)
    • Line 44: warning: exported const JobExecutionStatusFetchError should have comment or be unexported (golint)
    • Line 45: warning: exported const NoDefinitiveJobExecutionStatusFound should have comment or be unexported (golint)
    • Line 46: warning: exported const GroupNameMissingError should have comment or be unexported (golint)
    • Line 47: warning: exported const JobNameContextKey should have comment or be unexported (golint)
    • Line 48: warning: exported const UserEmailContextKey should have comment or be unexported (golint)
    • Line 49: warning: exported const JobArgsContextKey should have comment or be unexported (golint)
    • Line 50: warning: exported const ImageNameContextKey should have comment or be unexported (golint)
    • Line 51: warning: exported const JobNameSubmittedForExecutionContextKey should have comment or be unexported (golint)
    • Line 52: warning: exported const JobSubmissionStatusContextKey should have comment or be unexported (golint)
    • Line 53: warning: exported const JobSchedulingStatusContextKey should have comment or be unexported (golint)
    • Line 55: warning: exported const UserEmailHeaderKey should have comment or be unexported (golint)
    • Line 56: warning: exported const AccessTokenHeaderKey should have comment or be unexported (golint)
    • Line 57: warning: exported const ClientVersionHeaderKey should have comment or be unexported (golint)
    • Line 59: warning: exported const WorkerEmail should have comment or be unexported (golint)
    • Line 61: warning: exported function MergeMaps should have comment or be unexported (golint)
    • Line 73: warning: exported function MapToString should have comment or be unexported (golint)
    • Line 81: warning: exported function DeserializeMap should have comment or be unexported (golint)
    • proctor/cmd/config/manager.go
    • Line 17: warning: exported function CreateDirIfNotExist should have comment or be unexported (golint)
    • Line 26: warning: exported function NewCmd should have comment or be unexported (golint)
    • proctor/proctord/logger/logrus.go
    • Line 13: warning: exported function Setup should have comment or be unexported (golint)
    • Line 37: warning: exported function AddHook should have comment or be unexported (golint)
    • Line 41: warning: exported function Debug should have comment or be unexported (golint)
    • Line 45: warning: exported function Info should have comment or be unexported (golint)
    • Line 49: warning: exported function Warn should have comment or be unexported (golint)
    • Line 53: warning: exported function Error should have comment or be unexported (golint)
    • Line 57: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 61: warning: exported function Panic should have comment or be unexported (golint)
    • proctor/config/config.go
    • Line 15: warning: exported const Environment should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type ProctorConfig should have comment or be unexported (golint)
    • Line 31: warning: exported type ConfigError should have comment or be unexported (golint)
    • Line 36: warning: exported method ConfigError.RootError should have comment or be unexported (golint)
    • Line 40: warning: exported type Loader should have comment or be unexported (golint)
    • Line 46: warning: exported function NewLoader should have comment or be unexported (golint)
    • Line 86: warning: comment on exported function ConfigFileDir should be of the form "ConfigFileDir ..." (golint)
    • Line 91: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • proctor/proctord/jobs/metadata/store_mock.go
    • Line 7: warning: exported type MockStore should have comment or be unexported (golint)
    • Line 11: warning: exported method MockStore.CreateOrUpdateJobMetadata should have comment or be unexported (golint)
    • Line 16: warning: exported method MockStore.GetAllJobsMetadata should have comment or be unexported (golint)
    • Line 21: warning: exported method MockStore.GetJobMetadata should have comment or be unexported (golint)
    • proctor/proctord/jobs/secrets/store_mock.go
    • Line 7: warning: exported type MockStore should have comment or be unexported (golint)
    • Line 11: warning: exported method MockStore.CreateOrUpdateJobSecret should have comment or be unexported (golint)
    • Line 16: warning: exported method MockStore.GetJobSecrets should have comment or be unexported (golint)
    • proctor/proctord/jobs/schedule/worker.go
    • Line 28: warning: exported type Worker should have comment or be unexported (golint)
    • Line 32: warning: exported function NewWorker should have comment or be unexported (golint)
    • Line 124: warning: should omit 2nd value from range; this loop is equivalent to `for id := range ...` (golint)
    • proctor/proctord/storage/store_mock.go
    • Line 8: warning: exported type MockStore should have comment or be unexported (golint)
    • Line 12: warning: exported method MockStore.AuditJobsExecution should have comment or be unexported (golint)
    • Line 17: warning: exported method MockStore.UpdateJobsExecutionAuditLog should have comment or be unexported (golint)
    • Line 22: warning: exported method MockStore.GetJobExecutionStatus should have comment or be unexported (golint)
    • Line 27: warning: exported method MockStore.InsertScheduledJob should have comment or be unexported (golint)
    • Line 32: warning: exported method MockStore.GetScheduledJobs should have comment or be unexported (golint)
    • Line 37: warning: exported method MockStore.GetEnabledScheduledJobs should have comment or be unexported (golint)
    • Line 42: warning: exported method MockStore.GetScheduledJob should have comment or be unexported (golint)
    • Line 47: warning: exported method MockStore.RemoveScheduledJob should have comment or be unexported (golint)
    • proctor/proctord/jobs/schedule/handler.go
    • Line 25: warning: exported type Scheduler should have comment or be unexported (golint)
    • Line 32: warning: exported function NewScheduler should have comment or be unexported (golint)
    • Line 119: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • proctor/proctord/storage/postgres/schema.go
    • Line 12: warning: exported type JobsExecutionAuditLog should have comment or be unexported (golint)
    • Line 25: warning: exported method JobsExecutionAuditLog.AddJobArgs should have comment or be unexported (golint)
    • Line 35: warning: exported method JobsExecutionAuditLog.AddExecutionID should have comment or be unexported (golint)
    • Line 39: warning: exported type JobsSchedule should have comment or be unexported (golint)
    • proctor/daemon/client.go
    • Line 29: warning: exported type Client should have comment or be unexported (golint)
    • Line 51: warning: exported type ProcToExecute should have comment or be unexported (golint)
    • Line 56: warning: exported type ScheduleJobPayload should have comment or be unexported (golint)
    • Line 66: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 388: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • proctor/proctord/kubernetes/client_mock.go
    • Line 10: warning: exported type MockClient should have comment or be unexported (golint)
    • Line 14: warning: exported method MockClient.ExecuteJob should have comment or be unexported (golint)
    • Line 19: warning: exported method MockClient.StreamJobLogs should have comment or be unexported (golint)
    • Line 24: warning: exported method MockClient.JobExecutionStatus should have comment or be unexported (golint)
    • proctor/proctord/storage/postgres/client_mock.go
    • Line 8: warning: exported type ClientMock should have comment or be unexported (golint)
    • Line 12: warning: exported method ClientMock.NamedExec should have comment or be unexported (golint)
    • Line 17: warning: exported method ClientMock.Select should have comment or be unexported (golint)
    • Line 23: warning: exported method ClientMock.Close should have comment or be unexported (golint)
    • Line 28: warning: exported method ClientMock.GetDB should have comment or be unexported (golint)
    • proctor/proctord/jobs/schedule/handler_test.go
    • Line 288: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 313: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 329: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 346: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 373: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 379: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 397: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 421: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 445: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 467: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 471: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 489: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • Line 511: warning: receiver name s should be consistent with previous receiver name suite for SchedulerTestSuite (golint)
    • proctor/proctord/jobs/logs/handler.go
    • Line 27: warning: exported type Logger should have comment or be unexported (golint)
    • Line 31: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 37: warning: exported function CloseWebSocket should have comment or be unexported (golint)
    • proctor/proctord/jobs/metadata/store.go
    • Line 9: warning: exported const JobNameKeySuffix should have comment or be unexported (golint)
    • Line 11: warning: exported type Store should have comment or be unexported (golint)
    • Line 21: warning: exported function NewStore should have comment or be unexported (golint)
    • proctor/daemon/client_mock.go
    • Line 9: warning: exported type MockClient should have comment or be unexported (golint)
    • Line 13: warning: exported method MockClient.ListProcs should have comment or be unexported (golint)
    • Line 18: warning: exported method MockClient.ListScheduledProcs should have comment or be unexported (golint)
    • Line 23: warning: exported method MockClient.ExecuteProc should have comment or be unexported (golint)
    • Line 28: warning: exported method MockClient.StreamProcLogs should have comment or be unexported (golint)
    • Line 33: warning: exported method MockClient.GetDefinitiveProcExecutionStatus should have comment or be unexported (golint)
    • Line 38: warning: exported method MockClient.ScheduleJob should have comment or be unexported (golint)
    • Line 43: warning: exported method MockClient.DescribeScheduledProc should have comment or be unexported (golint)
    • Line 48: warning: exported method MockClient.RemoveScheduledProc should have comment or be unexported (golint)
    • proctor/io/printer_mock.go
    • Line 8: warning: exported type MockPrinter should have comment or be unexported (golint)
    • Line 12: warning: exported method MockPrinter.Println should have comment or be unexported (golint)
    • proctor/proctord/config/config.go
    • Line 14: warning: exported function KubeConfig should have comment or be unexported (golint)
    • Line 18: warning: exported function LogLevel should have comment or be unexported (golint)
    • Line 22: warning: exported function AppPort should have comment or be unexported (golint)
    • Line 26: warning: exported function DefaultNamespace should have comment or be unexported (golint)
    • Line 30: warning: exported function RedisAddress should have comment or be unexported (golint)
    • Line 34: warning: exported function KubeClusterHostName should have comment or be unexported (golint)
    • Line 38: warning: exported function KubeCACertEncoded should have comment or be unexported (golint)
    • Line 42: warning: exported function KubeBasicAuthEncoded should have comment or be unexported (golint)
    • Line 46: warning: exported function RedisMaxActiveConnections should have comment or be unexported (golint)
    • Line 50: warning: exported function LogsStreamReadBufferSize should have comment or be unexported (golint)
    • Line 54: warning: exported function LogsStreamWriteBufferSize should have comment or be unexported (golint)
    • Line 58: warning: exported function KubePodsListWaitTime should have comment or be unexported (golint)
    • Line 62: warning: exported function KubeJobActiveDeadlineSeconds should have comment or be unexported (golint)
    • Line 67: warning: exported function KubeJobRetries should have comment or be unexported (golint)
    • Line 72: warning: exported function PostgresUser should have comment or be unexported (golint)
    • Line 76: warning: exported function PostgresPassword should have comment or be unexported (golint)
    • Line 80: warning: exported function PostgresHost should have comment or be unexported (golint)
    • Line 84: warning: exported function PostgresPort should have comment or be unexported (golint)
    • Line 88: warning: exported function PostgresDatabase should have comment or be unexported (golint)
    • Line 92: warning: exported function PostgresMaxConnections should have comment or be unexported (golint)
    • Line 96: warning: exported function PostgresConnectionMaxLifetime should have comment or be unexported (golint)
    • Line 100: warning: exported function NewRelicAppName should have comment or be unexported (golint)
    • Line 104: warning: exported function NewRelicLicenceKey should have comment or be unexported (golint)
    • Line 108: warning: exported function MinClientVersion should have comment or be unexported (golint)
    • Line 112: warning: exported function ScheduledJobsFetchIntervalInMins should have comment or be unexported (golint)
    • Line 116: warning: exported function MailUsername should have comment or be unexported (golint)
    • Line 120: warning: exported function MailPassword should have comment or be unexported (golint)
    • Line 124: warning: exported function MailServerHost should have comment or be unexported (golint)
    • Line 128: warning: exported function MailServerPort should have comment or be unexported (golint)
    • Line 132: warning: exported function JobPodAnnotations should have comment or be unexported (golint)
    • Line 144: warning: exported function SentryDSN should have comment or be unexported (golint)
    • Line 148: warning: exported function DocsPath should have comment or be unexported (golint)
    • proctor/proctord/instrumentation/newrelic_stub.go
    • Line 10: warning: exported type StubNewRelicTransaction should have comment or be unexported (golint)
    • Line 12: warning: exported method StubNewRelicTransaction.End should have comment or be unexported (golint)
    • Line 16: warning: exported method StubNewRelicTransaction.Ignore should have comment or be unexported (golint)
    • Line 20: warning: exported method StubNewRelicTransaction.SetName should have comment or be unexported (golint)
    • Line 24: warning: exported method StubNewRelicTransaction.NoticeError should have comment or be unexported (golint)
    • Line 28: warning: exported method StubNewRelicTransaction.AddAttribute should have comment or be unexported (golint)
    • Line 32: warning: exported method StubNewRelicTransaction.StartSegmentNow should have comment or be unexported (golint)
    • Line 36: warning: exported method StubNewRelicTransaction.Header should have comment or be unexported (golint)
    • Line 44: warning: exported method StubNewRelicTransaction.WriteHeader should have comment or be unexported (golint)
    • Line 48: warning: exported type StubNewrelicApp should have comment or be unexported (golint)
    • Line 50: warning: exported method StubNewrelicApp.StartTransaction should have comment or be unexported (golint)
    • Line 54: warning: exported method StubNewrelicApp.RecordCustomEvent should have comment or be unexported (golint)
    • Line 57: warning: exported method StubNewrelicApp.WaitForConnection should have comment or be unexported (golint)
    • Line 60: warning: exported method StubNewrelicApp.Shutdown should have comment or be unexported (golint)
    • proctor/proctord/jobs/schedule/scheduled_job.go
    • Line 8: warning: exported type ScheduledJob should have comment or be unexported (golint)
    • Line 18: warning: exported function FromStoreToHandler should have comment or be unexported (golint)
    • Line 30: warning: exported function GetScheduledJob should have comment or be unexported (golint)
    • proctor/proctord/jobs/execution/executioner.go
    • Line 20: warning: exported type Executioner should have comment or be unexported (golint)
    • Line 24: warning: exported function NewExecutioner should have comment or be unexported (golint)
    • Line 37: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 44: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 52: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • proctor/config/config_mock.go
    • Line 5: warning: exported type MockLoader should have comment or be unexported (golint)
    • Line 9: warning: exported method MockLoader.Load should have comment or be unexported (golint)
    • proctor/proctord/redis/client_mock.go
    • Line 5: warning: exported type MockClient should have comment or be unexported (golint)
    • Line 9: warning: exported method MockClient.GET should have comment or be unexported (golint)
    • Line 14: warning: exported method MockClient.SET should have comment or be unexported (golint)
    • Line 19: warning: exported method MockClient.KEYS should have comment or be unexported (golint)
    • Line 24: warning: exported method MockClient.MGET should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign99%

IneffAssign detects ineffectual assignments in Go code.

    • proctor/daemon/client.go
    • Line 94: warning: ineffectual assignment to err (ineffassign)
    • Line 142: warning: ineffectual assignment to err (ineffassign)
    • Line 171: warning: ineffectual assignment to err (ineffassign)
    • Line 201: warning: ineffectual assignment to err (ineffassign)
    • Line 231: warning: ineffectual assignment to err (ineffassign)
    • Line 266: warning: ineffectual assignment to err (ineffassign)
    • Line 361: warning: ineffectual assignment to err (ineffassign)

misspell98%

Misspell Finds commonly misspelled English words