Preparing report...

Report for github.com/unknowntpo/todos

B    Not bad!    Found 60 issues across 78 files

Tweet

gofmt83%

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!


gocyclo97%

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.


golint24%

Golint is a linter for Go source code.

    • todos/internal/jsonlog/jsonlog.go
    • Line 55: warning: exported method Logger.PrintInfo should have comment or be unexported (golint)
    • Line 59: warning: exported method Logger.PrintError should have comment or be unexported (golint)
    • Line 63: warning: exported method Logger.PrintFatal should have comment or be unexported (golint)
    • todos/internal/domain/validate.go
    • Line 16: warning: exported function ValidateEmail should have comment or be unexported (golint)
    • Line 21: warning: exported function ValidatePasswordPlaintext should have comment or be unexported (golint)
    • Line 27: warning: exported function ValidateUser should have comment or be unexported (golint)
    • todos/config/config.go
    • Line 13: warning: exported type DB should have comment or be unexported (golint)
    • Line 20: warning: exported type Limiter should have comment or be unexported (golint)
    • Line 26: warning: exported type Smtp should have comment or be unexported (golint)
    • Line 34: warning: exported type Cors should have comment or be unexported (golint)
    • todos/internal/testutil/db_util.go
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: exported function NewTestDB should have comment or be unexported (golint)
    • Line 22: warning: exported function GetCallerPath should have comment or be unexported (golint)
    • Line 27: warning: comment on exported function PrepareSQLQuery should be of the form "PrepareSQLQuery ..." (golint)
    • todos/docs/go/configuration.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 51: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 60: warning: exported function NewConfiguration should have comment or be unexported (golint)
    • Line 69: warning: exported method Configuration.AddDefaultHeader should have comment or be unexported (golint)
    • todos/internal/domain/filters.go
    • Line 7: warning: exported type Filters should have comment or be unexported (golint)
    • Line 37: warning: exported method Filters.Limit should have comment or be unexported (golint)
    • Line 41: warning: exported method Filters.Offset should have comment or be unexported (golint)
    • todos/docs/go/response.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 15: warning: exported type APIResponse should have comment or be unexported (golint)
    • Line 32: warning: exported function NewAPIResponse should have comment or be unexported (golint)
    • Line 38: warning: exported function NewAPIResponseWithError should have comment or be unexported (golint)
    • todos/internal/domain/mock/token_repo.go
    • Line 12: warning: exported type MockTokenRepo should have comment or be unexported (golint)
    • Line 16: warning: exported method MockTokenRepo.New should have comment or be unexported (golint)
    • Line 21: warning: exported method MockTokenRepo.Insert should have comment or be unexported (golint)
    • Line 26: warning: exported method MockTokenRepo.DeleteAllForUser should have comment or be unexported (golint)
    • todos/docs/go/api_default.go
    • Line 2: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 2: warning: package comment should not have leading space (golint)
    • Line 27: warning: exported type DefaultApiService should have comment or be unexported (golint)
    • Line 28: warning: comment on exported method DefaultApiService.V1HealthcheckGet should be of the form "V1HealthcheckGet ..." (golint)
    • Line 111: warning: comment on exported method DefaultApiService.V1TasksGet should be of the form "V1TasksGet ..." (golint)
    • Line 208: warning: exported type DefaultApiV1TasksPostOpts should have comment or be unexported (golint)
    • Line 212: warning: exported method DefaultApiService.V1TasksPost should have comment or be unexported (golint)
    • Line 299: warning: comment on exported method DefaultApiService.V1TasksTaskIdDelete should be of the form "V1TasksTaskIdDelete ..." (golint)
    • Line 391: warning: comment on exported method DefaultApiService.V1TasksTaskIdGet should be of the form "V1TasksTaskIdGet ..." (golint)
    • Line 493: warning: exported type DefaultApiV1TasksTaskIdPatchOpts should have comment or be unexported (golint)
    • Line 497: warning: exported method DefaultApiService.V1TasksTaskIdPatch should have comment or be unexported (golint)
    • Line 597: warning: exported type DefaultApiV1TokensAuthenticationPostOpts should have comment or be unexported (golint)
    • Line 601: warning: exported method DefaultApiService.V1TokensAuthenticationPost should have comment or be unexported (golint)
    • Line 684: warning: comment on exported method DefaultApiService.V1UsersActivationPut should be of the form "V1UsersActivationPut ..." (golint)
    • Line 778: warning: exported type DefaultApiV1UsersRegistrationPostOpts should have comment or be unexported (golint)
    • Line 782: warning: exported method DefaultApiService.V1UsersRegistrationPost should have comment or be unexported (golint)
    • todos/internal/testutil/migrator.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported function NewPgMigrator should have comment or be unexported (golint)
    • todos/internal/task/delivery/api/task_api.go
    • Line 17: warning: exported type CreateTaskRequest should have comment or be unexported (golint)
    • Line 23: warning: exported type CreateTaskResponse should have comment or be unexported (golint)
    • Line 27: warning: exported type DeleteTaskByIDResponse should have comment or be unexported (golint)
    • Line 31: warning: exported type GetAllTasksResponse should have comment or be unexported (golint)
    • Line 36: warning: exported type GetTaskByIDResponse should have comment or be unexported (golint)
    • Line 40: warning: exported type UpdateTaskByIDRequest should have comment or be unexported (golint)
    • Line 46: warning: exported type UpdateTaskByIDResponse should have comment or be unexported (golint)
    • Line 56: warning: exported function NewTaskAPI should have comment or be unexported (golint)
    • todos/internal/user/delivery/api/user_api.go
    • Line 27: warning: exported type UserRegistrationResponse should have comment or be unexported (golint)
    • Line 31: warning: exported type UserRegistrationRequest should have comment or be unexported (golint)
    • Line 37: warning: exported type UserActivationResponse should have comment or be unexported (golint)
    • Line 41: warning: exported function NewUserAPI should have comment or be unexported (golint)
    • todos/docs/go/model_task.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 11: warning: exported type Task should have comment or be unexported (golint)
    • todos/internal/domain/mock/task_repo.go
    • Line 11: warning: exported type MockTaskRepo should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTaskRepo should have comment or be unexported (golint)
    • Line 19: warning: exported method MockTaskRepo.GetAll should have comment or be unexported (golint)
    • Line 24: warning: exported method MockTaskRepo.GetByID should have comment or be unexported (golint)
    • Line 29: warning: exported method MockTaskRepo.Insert should have comment or be unexported (golint)
    • Line 34: warning: exported method MockTaskRepo.Update should have comment or be unexported (golint)
    • Line 39: warning: exported method MockTaskRepo.Delete should have comment or be unexported (golint)
    • todos/internal/domain/user.go
    • Line 11: warning: exported var ErrDuplicateEmail should have comment or be unexported (golint)
    • Line 33: warning: exported type UserUsecase should have comment or be unexported (golint)
    • Line 40: warning: exported type UserRepository should have comment or be unexported (golint)
    • todos/docs/go/model_user.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 11: warning: exported type User should have comment or be unexported (golint)
    • todos/internal/domain/mock/task_usecase.go
    • Line 11: warning: exported type MockTaskUsecase should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTaskUsecase should have comment or be unexported (golint)
    • Line 19: warning: exported method MockTaskUsecase.GetAll should have comment or be unexported (golint)
    • Line 24: warning: exported method MockTaskUsecase.GetByID should have comment or be unexported (golint)
    • Line 29: warning: exported method MockTaskUsecase.Insert should have comment or be unexported (golint)
    • Line 34: warning: exported method MockTaskUsecase.Update should have comment or be unexported (golint)
    • Line 39: warning: exported method MockTaskUsecase.Delete should have comment or be unexported (golint)
    • todos/docs/go/client.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 150: warning: comment on exported method APIClient.ChangeBasePath should be of the form "ChangeBasePath ..." (golint)
    • todos/internal/domain/mock/token_usecase.go
    • Line 10: warning: exported type MockTokenUsecase should have comment or be unexported (golint)
    • Line 12: warning: exported function NewTokenUsecase should have comment or be unexported (golint)
    • Line 16: warning: exported method MockTokenUsecase.New should have comment or be unexported (golint)
    • Line 19: warning: exported method MockTokenUsecase.Insert should have comment or be unexported (golint)
    • Line 22: warning: exported method MockTokenUsecase.DeleteAllForUser should have comment or be unexported (golint)
    • todos/internal/middleware/middleware.go
    • Line 24: warning: exported type Middleware should have comment or be unexported (golint)
    • Line 30: warning: exported function New should have comment or be unexported (golint)
    • Line 34: warning: exported method Middleware.RecoverPanic should have comment or be unexported (golint)
    • Line 50: warning: exported method Middleware.RateLimit should have comment or be unexported (golint)
    • Line 115: warning: exported method Middleware.Authenticate should have comment or be unexported (golint)
    • Line 197: warning: exported method Middleware.Metrics should have comment or be unexported (golint)
    • Line 231: warning: exported method Middleware.EnableCORS should have comment or be unexported (golint)
    • todos/internal/helpers/request.go
    • Line 15: warning: exported function ReadIDParam should have comment or be unexported (golint)
    • Line 26: warning: comment on exported function ReadString should be of the form "ReadString ..." (golint)
    • Line 38: warning: comment on exported function ReadCSV should be of the form "ReadCSV ..." (golint)
    • Line 51: warning: comment on exported function ReadInt should be of the form "ReadInt ..." (golint)
    • todos/internal/helpers/response.go
    • Line 8: warning: exported type ErrorResponse should have comment or be unexported (golint)
    • Line 21: warning: exported function ServerErrorResponse should have comment or be unexported (golint)
    • Line 26: warning: exported function NotFoundResponse should have comment or be unexported (golint)
    • Line 31: warning: exported function MethodNotAllowedResponse should have comment or be unexported (golint)
    • Line 36: warning: exported function BadRequestResponse should have comment or be unexported (golint)
    • Line 40: warning: comment on exported function FailedValidationResponse should be of the form "FailedValidationResponse ..." (golint)
    • Line 46: warning: exported function EditConflictResponse should have comment or be unexported (golint)
    • Line 51: warning: exported function InvalidCredentialsResponse should have comment or be unexported (golint)
    • Line 56: warning: exported function InvalidAuthenticationTokenResponse should have comment or be unexported (golint)
    • Line 63: warning: exported function AuthenticationRequiredResponse should have comment or be unexported (golint)
    • Line 68: warning: exported function InactiveAccountResponse should have comment or be unexported (golint)
    • Line 73: warning: exported function NotPermittedResponse should have comment or be unexported (golint)
    • Line 78: warning: exported function RateLimitExceededResponse should have comment or be unexported (golint)
    • todos/internal/token/delivery/api/token_api.go
    • Line 22: warning: exported type AuthenticationRequestBody should have comment or be unexported (golint)
    • Line 27: warning: exported type AuthenticationResponse should have comment or be unexported (golint)
    • Line 31: warning: exported function NewTokenAPI should have comment or be unexported (golint)
    • todos/docs/go/model_metadata.go
    • Line 1: warning: package comment should be of the form "Package swagger ..." (golint)
    • Line 1: warning: package comment should not have leading space (golint)
    • Line 11: warning: exported type Metadata should have comment or be unexported (golint)
    • todos/internal/domain/token.go
    • Line 12: warning: exported const ScopeActivation should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type Token should have comment or be unexported (golint)
    • Line 24: warning: exported type TokenUsecase should have comment or be unexported (golint)
    • Line 29: warning: exported type TokenRepository should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!