Preparing report...

Report for github.com/mebr0/tiny-url

A    Great!    Found 26 issues across 39 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!


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.


golint43%

Golint is a linter for Go source code.

    • tiny-url/pkg/hash/url.go
    • Line 11: warning: exported var ErrURLAliasLengthExceed should have comment or be unexported (golint)
    • Line 13: warning: exported type URLEncoder should have comment or be unexported (golint)
    • Line 17: warning: exported type MD5Encoder should have comment or be unexported (golint)
    • Line 20: warning: exported function NewMD5Encoder should have comment or be unexported (golint)
    • Line 24: warning: exported method MD5Encoder.Encode should have comment or be unexported (golint)
    • tiny-url/internal/handler/handler.go
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported type Handler should have comment or be unexported (golint)
    • Line 20: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 27: warning: exported method Handler.Init should have comment or be unexported (golint)
    • tiny-url/internal/repo/repo.go
    • Line 13: warning: exported type Users should have comment or be unexported (golint)
    • Line 20: warning: exported type URLs should have comment or be unexported (golint)
    • Line 28: warning: exported type Repos should have comment or be unexported (golint)
    • Line 33: warning: exported function NewRepos should have comment or be unexported (golint)
    • tiny-url/internal/repo/user_mongo.go
    • Line 13: warning: exported type UsersRepo should have comment or be unexported (golint)
    • Line 23: warning: exported method UsersRepo.List should have comment or be unexported (golint)
    • Line 37: warning: exported method UsersRepo.Create should have comment or be unexported (golint)
    • Line 51: warning: exported method UsersRepo.GetByCredentials should have comment or be unexported (golint)
    • Line 65: warning: exported method UsersRepo.UpdateLastLogin should have comment or be unexported (golint)
    • tiny-url/pkg/hash/password.go
    • Line 8: warning: exported type PasswordHasher should have comment or be unexported (golint)
    • Line 17: warning: exported function NewSHA1Hasher should have comment or be unexported (golint)
    • tiny-url/internal/service/url.go
    • Line 14: warning: exported type URLsService should have comment or be unexported (golint)
    • Line 34: warning: exported method URLsService.ListByOwner should have comment or be unexported (golint)
    • Line 62: warning: exported method URLsService.Create should have comment or be unexported (golint)
    • Line 135: warning: exported method URLsService.Get should have comment or be unexported (golint)
    • tiny-url/internal/server/server.go
    • Line 9: warning: exported type Server should have comment or be unexported (golint)
    • Line 13: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 25: warning: exported method Server.Run should have comment or be unexported (golint)
    • Line 29: warning: exported method Server.Stop should have comment or be unexported (golint)
    • tiny-url/internal/handler/v1/handler.go
    • Line 9: warning: exported type Handler should have comment or be unexported (golint)
    • Line 14: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 21: warning: exported method Handler.Init should have comment or be unexported (golint)
    • tiny-url/internal/cache/cache.go
    • Line 12: warning: exported type URLs should have comment or be unexported (golint)
    • Line 18: warning: exported type Caches should have comment or be unexported (golint)
    • Line 22: warning: exported function NewCaches should have comment or be unexported (golint)
    • tiny-url/internal/domain/user.go
    • Line 8: warning: exported type User should have comment or be unexported (golint)
    • Line 23: warning: exported type UserRegister should have comment or be unexported (golint)
    • Line 32: warning: exported type UserLogin should have comment or be unexported (golint)
    • Line 39: warning: exported type Tokens should have comment or be unexported (golint)
    • tiny-url/pkg/auth/manager.go
    • Line 16: warning: exported type Manager should have comment or be unexported (golint)
    • Line 20: warning: exported function NewManager should have comment or be unexported (golint)
    • Line 30: warning: exported method Manager.NewJWT should have comment or be unexported (golint)
    • Line 39: warning: exported method Manager.Parse should have comment or be unexported (golint)
    • tiny-url/internal/service/auth.go
    • Line 14: warning: exported type AuthService should have comment or be unexported (golint)
    • Line 31: warning: exported method AuthService.Register should have comment or be unexported (golint)
    • Line 51: warning: exported method AuthService.Login should have comment or be unexported (golint)
    • tiny-url/internal/service/service.go
    • Line 16: warning: exported type Users should have comment or be unexported (golint)
    • Line 20: warning: exported type Auth should have comment or be unexported (golint)
    • Line 25: warning: exported type URLs should have comment or be unexported (golint)
    • Line 31: warning: exported type Services should have comment or be unexported (golint)
    • Line 37: warning: exported function NewServices should have comment or be unexported (golint)
    • tiny-url/internal/cache/url_redis.go
    • Line 10: warning: exported type URLsCache should have comment or be unexported (golint)
    • Line 22: warning: exported method URLsCache.Set should have comment or be unexported (golint)
    • Line 26: warning: exported method URLsCache.Get should have comment or be unexported (golint)
    • Line 36: warning: exported method URLsCache.Delete should have comment or be unexported (golint)
    • tiny-url/internal/repo/url_mongo.go
    • Line 12: warning: exported type URLsRepo should have comment or be unexported (golint)
    • Line 22: warning: exported method URLsRepo.ListByOwner should have comment or be unexported (golint)
    • Line 36: warning: exported method URLsRepo.Create should have comment or be unexported (golint)
    • Line 50: warning: exported method URLsRepo.Get should have comment or be unexported (golint)
    • Line 64: warning: exported method URLsRepo.GetByOriginalAndOwner should have comment or be unexported (golint)
    • Line 78: warning: exported method URLsRepo.Delete should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign87%

IneffAssign detects ineffectual assignments in Go code.

    • tiny-url/internal/handler/handler.go
    • Line 12: warning: no required module provides package github.com/mebr0/tiny-url/docs; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mebr0/tiny-url/docs (invalid package name: "") (ineffassign)
    • tiny-url/internal/service/url_test.go
    • Line 7: warning: no required module provides package github.com/mebr0/tiny-url/internal/cache/mocks; to add it: (ineffassign)
    • Line 7: warning: could not import github.com/mebr0/tiny-url/internal/cache/mocks (invalid package name: "") (ineffassign)
    • tiny-url/internal/service/auth_test.go
    • Line 9: warning: no required module provides package github.com/mebr0/tiny-url/internal/repo/mocks; to add it: (ineffassign)
    • Line 9: warning: could not import github.com/mebr0/tiny-url/internal/repo/mocks (invalid package name: "") (ineffassign)
    • tiny-url/internal/handler/v1/auth_test.go
    • Line 12: warning: no required module provides package github.com/mebr0/tiny-url/internal/service/mocks; to add it: (ineffassign)
    • Line 12: warning: could not import github.com/mebr0/tiny-url/internal/service/mocks (invalid package name: "") (ineffassign)

misspell94%

Misspell Finds commonly misspelled English words