Preparing report...

Report for github.com/rl-os/api

A+    Excellent!    Found 66 issues across 86 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!


gocyclo100%

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.

No problems detected. Good job!


golint24%

Golint is a linter for Go source code.

    • api/api/api.go
    • Line 14: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 27: warning: comment on exported function CreateInitControllersFn should be of the form "CreateInitControllersFn ..." (golint)
    • api/services/cache/cache.go
    • Line 10: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 12: warning: error var KeyNotFoundErr should have name of the form ErrFoo (golint)
    • Line 13: warning: error var ValueMarshallErr should have name of the form ErrFoo (golint)
    • Line 14: warning: error var InvalidStorageErr should have name of the form ErrFoo (golint)
    • Line 15: warning: error var InternalStorageErr should have name of the form ErrFoo (golint)
    • Line 18: warning: exported type Cache should have comment or be unexported (golint)
    • api/repository/gorm/beatmapset_store.go
    • Line 10: warning: exported type BeatmapSetRepository should have comment or be unexported (golint)
    • Line 14: warning: exported function NewBeatmapSetRepository should have comment or be unexported (golint)
    • Line 18: warning: exported method BeatmapSetRepository.SetFavourite should have comment or be unexported (golint)
    • Line 39: warning: exported method BeatmapSetRepository.SetUnFavourite should have comment or be unexported (golint)
    • Line 60: warning: exported method BeatmapSetRepository.Get should have comment or be unexported (golint)
    • Line 78: warning: exported method BeatmapSetRepository.Create should have comment or be unexported (golint)
    • Line 82: warning: exported method BeatmapSetRepository.Update should have comment or be unexported (golint)
    • Line 86: warning: exported method BeatmapSetRepository.Delete should have comment or be unexported (golint)
    • api/api/oauth_client.go
    • Line 14: warning: exported type OAuthClientController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewOAuthClientController should have comment or be unexported (golint)
    • api/api/users.go
    • Line 13: warning: exported type UserController should have comment or be unexported (golint)
    • Line 23: warning: exported function NewUserController should have comment or be unexported (golint)
    • Line 33: warning: exported method UserController.Get should have comment or be unexported (golint)
    • api/errors/error.go
    • Line 29: warning: exported type ResponseFormat should have comment or be unexported (golint)
    • Line 35: warning: exported method Error.WithCause should have comment or be unexported (golint)
    • api/app/beatmapset.go
    • Line 20: warning: exported type BeatmapSetUseCase should have comment or be unexported (golint)
    • Line 26: warning: exported function NewBeatmapSetUseCase should have comment or be unexported (golint)
    • Line 53: warning: exported method BeatmapSetUseCase.Lookup should have comment or be unexported (golint)
    • Line 76: warning: exported method BeatmapSetUseCase.Search should have comment or be unexported (golint)
    • Line 81: warning: exported method BeatmapSetUseCase.Favourite should have comment or be unexported (golint)
    • api/app/oauth.go
    • Line 27: warning: error var InvalidAuthParamsErr should have name of the form ErrFoo (golint)
    • Line 27: warning: exported var InvalidAuthParamsErr should have comment or be unexported (golint)
    • Line 28: warning: error var InvalidAuthTokenErr should have name of the form ErrFoo (golint)
    • Line 29: warning: error var ExpiredAuthTokenErr should have name of the form ErrFoo (golint)
    • Line 30: warning: error var NotFoundRefreshAuthErr should have name of the form ErrFoo (golint)
    • Line 31: warning: error var InvalidOAuthClientParamsErr should have name of the form ErrFoo (golint)
    • Line 34: warning: exported type OAuthUseCase should have comment or be unexported (golint)
    • Line 40: warning: exported function NewOAuthUseCase should have comment or be unexported (golint)
    • api/services/bancho/client.go
    • Line 12: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 15: warning: error var AuthErr should have name of the form ErrFoo (golint)
    • Line 15: warning: exported var AuthErr should have comment or be unexported (golint)
    • Line 18: warning: exported type Options should have comment or be unexported (golint)
    • Line 28: warning: exported type Client should have comment or be unexported (golint)
    • Line 49: warning: exported function New should have comment or be unexported (golint)
    • api/repository/gorm/oauth_store.go
    • Line 11: warning: exported type OAuthRepository should have comment or be unexported (golint)
    • Line 15: warning: exported function NewOAuthRepository should have comment or be unexported (golint)
    • Line 19: warning: exported method OAuthRepository.CreateClient should have comment or be unexported (golint)
    • Line 47: warning: exported method OAuthRepository.GetClient should have comment or be unexported (golint)
    • Line 63: warning: exported method OAuthRepository.CreateToken should have comment or be unexported (golint)
    • Line 75: warning: exported method OAuthRepository.RevokeAllTokens should have comment or be unexported (golint)
    • Line 89: warning: exported method OAuthRepository.RefreshToken should have comment or be unexported (golint)
    • Line 106: warning: exported method OAuthRepository.GetToken should have comment or be unexported (golint)
    • api/entity/beatmapset_search.go
    • Line 5: warning: exported type BeatmapsetSearch should have comment or be unexported (golint)
    • Line 37: warning: exported type BeatmapsetSearchResult should have comment or be unexported (golint)
    • api/entity/request/beatmap.go
    • Line 3: warning: exported type BeatmapLookup should have comment or be unexported (golint)
    • Line 9: warning: exported type GetBeatmapScores should have comment or be unexported (golint)
    • api/entity/beatmapset.go
    • Line 10: warning: exported type BeatmapSet should have comment or be unexported (golint)
    • Line 46: warning: exported method BeatmapSet.TableName should have comment or be unexported (golint)
    • Line 50: warning: exported type BeatmapSetFull should have comment or be unexported (golint)
    • Line 60: warning: exported type Availability should have comment or be unexported (golint)
    • Line 65: warning: exported method Availability.Value should have comment or be unexported (golint)
    • Line 66: warning: exported method Availability.Scan should have comment or be unexported (golint)
    • Line 68: warning: exported type Covers should have comment or be unexported (golint)
    • Line 80: warning: exported method Covers.Value should have comment or be unexported (golint)
    • Line 81: warning: exported method Covers.Scan should have comment or be unexported (golint)
    • Line 83: warning: exported type CurrentUserAttributes should have comment or be unexported (golint)
    • Line 93: warning: exported method CurrentUserAttributes.Value should have comment or be unexported (golint)
    • Line 94: warning: exported method CurrentUserAttributes.Scan should have comment or be unexported (golint)
    • Line 96: warning: exported type Description should have comment or be unexported (golint)
    • Line 100: warning: exported method Description.Value should have comment or be unexported (golint)
    • Line 101: warning: exported method Description.Scan should have comment or be unexported (golint)
    • Line 103: warning: exported type Genre should have comment or be unexported (golint)
    • Line 108: warning: exported method Genre.Value should have comment or be unexported (golint)
    • Line 109: warning: exported method Genre.Scan should have comment or be unexported (golint)
    • Line 111: warning: exported type Hype should have comment or be unexported (golint)
    • Line 116: warning: exported method Hype.Value should have comment or be unexported (golint)
    • Line 117: warning: exported method Hype.Scan should have comment or be unexported (golint)
    • Line 119: warning: exported type Nominations should have comment or be unexported (golint)
    • Line 124: warning: exported method Nominations.Value should have comment or be unexported (golint)
    • Line 125: warning: exported method Nominations.Scan should have comment or be unexported (golint)
    • Line 127: warning: exported type DefaultGroup should have comment or be unexported (golint)
    • Line 130: warning: exported const Default should have comment (or a comment on this block) or be unexported (golint)
    • api/app/friend.go
    • Line 9: warning: exported type FriendUseCase should have comment or be unexported (golint)
    • Line 14: warning: exported function NewFriendUseCase should have comment or be unexported (golint)
    • api/repository/repository.go
    • Line 17: warning: exported type OAuth should have comment or be unexported (golint)
    • Line 27: warning: exported type Beatmap should have comment or be unexported (golint)
    • Line 37: warning: exported type BeatmapSet should have comment or be unexported (golint)
    • Line 47: warning: exported type User should have comment or be unexported (golint)
    • Line 66: warning: exported type Friend should have comment or be unexported (golint)
    • Line 72: warning: exported type Chat should have comment or be unexported (golint)
    • api/repository/gorm/beatmap_store.go
    • Line 10: warning: exported type BeatmapRepository should have comment or be unexported (golint)
    • Line 14: warning: exported function NewBeatmapRepository should have comment or be unexported (golint)
    • Line 18: warning: exported method BeatmapRepository.Get should have comment or be unexported (golint)
    • Line 36: warning: exported method BeatmapRepository.GetBySetId should have comment or be unexported (golint)
    • Line 54: warning: exported method BeatmapRepository.Create should have comment or be unexported (golint)
    • Line 58: warning: exported method BeatmapRepository.CreateBatch should have comment or be unexported (golint)
    • Line 62: warning: exported method BeatmapRepository.Update should have comment or be unexported (golint)
    • Line 66: warning: exported method BeatmapRepository.Delete should have comment or be unexported (golint)
    • api/api/beatmaps.go
    • Line 18: warning: exported type BeatmapController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewBeatmapController should have comment or be unexported (golint)
    • api/cmd/main.go
    • Line 12: warning: exported var Version should have comment or be unexported (golint)
    • Line 13: warning: exported var Commit should have comment or be unexported (golint)
    • Line 14: warning: exported var Branch should have comment or be unexported (golint)
    • Line 15: warning: exported var BuildTimestamp should have comment or be unexported (golint)
    • api/repository/gorm/friend_store.go
    • Line 9: warning: exported type FriendRepository should have comment or be unexported (golint)
    • Line 13: warning: exported function NewFriendRepository should have comment or be unexported (golint)
    • Line 17: warning: exported method FriendRepository.Add should have comment or be unexported (golint)
    • Line 21: warning: exported method FriendRepository.Remove should have comment or be unexported (golint)
    • Line 25: warning: exported method FriendRepository.GetSubscriptions should have comment or be unexported (golint)
    • api/entity/chat_channel.go
    • Line 10: warning: exported const ChannelPublicType should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type Channel should have comment or be unexported (golint)
    • api/services/scheduler/task.go
    • Line 9: warning: exported type TaskFunc should have comment or be unexported (golint)
    • Line 11: warning: exported type ScheduledTask should have comment or be unexported (golint)
    • Line 22: warning: exported method ScheduledTask.WithDelay should have comment or be unexported (golint)
    • Line 27: warning: exported method ScheduledTask.WithInterval should have comment or be unexported (golint)
    • Line 46: warning: exported method ScheduledTask.Cancel should have comment or be unexported (golint)
    • Line 60: warning: exported method ScheduledTask.Run should have comment or be unexported (golint)
    • api/services/redis/redis.go
    • Line 11: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 13: warning: exported type Options should have comment or be unexported (golint)
    • Line 19: warning: exported type Pool should have comment or be unexported (golint)
    • Line 42: warning: exported function New should have comment or be unexported (golint)
    • api/api/beatmapset.go
    • Line 19: warning: exported type BeatmapSetController should have comment or be unexported (golint)
    • Line 25: warning: exported function NewBeatmapSetController should have comment or be unexported (golint)
    • api/ctx/ctx_test.go
    • Line 37: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 94: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 151: warning: should not use basic type int as key in context.WithValue (golint)
    • api/repository/gorm/chat_store.go
    • Line 13: warning: exported type ChatRepository should have comment or be unexported (golint)
    • Line 17: warning: exported function NewChatRepository should have comment or be unexported (golint)
    • Line 21: warning: exported method ChatRepository.Get should have comment or be unexported (golint)
    • Line 38: warning: exported method ChatRepository.CreatePm should have comment or be unexported (golint)
    • Line 61: warning: exported method ChatRepository.GetPublic should have comment or be unexported (golint)
    • Line 78: warning: exported method ChatRepository.GetJoined should have comment or be unexported (golint)
    • Line 95: warning: exported method ChatRepository.GetMessages should have comment or be unexported (golint)
    • Line 114: warning: exported method ChatRepository.SendMessage should have comment or be unexported (golint)
    • Line 137: warning: exported method ChatRepository.GetMessage should have comment or be unexported (golint)
    • Line 155: warning: exported method ChatRepository.Join should have comment or be unexported (golint)
    • Line 176: warning: exported method ChatRepository.Leave should have comment or be unexported (golint)
    • Line 193: warning: exported method ChatRepository.ReadMessage should have comment or be unexported (golint)
    • api/entity/beatmap.go
    • Line 5: warning: exported type Beatmap should have comment or be unexported (golint)
    • Line 37: warning: exported method Beatmap.TableName should have comment or be unexported (golint)
    • Line 41: warning: exported type SingleBeatmap should have comment or be unexported (golint)
    • Line 47: warning: exported type PlayMode should have comment or be unexported (golint)
    • Line 50: warning: exported const Fruits should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported var Modes should have comment or be unexported (golint)
    • Line 63: warning: exported type Status should have comment or be unexported (golint)
    • Line 66: warning: exported const BeatmapRanked should have comment (or a comment on this block) or be unexported (golint)
    • api/api/friend.go
    • Line 14: warning: exported type FriendController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewFriendController should have comment or be unexported (golint)
    • api/ctx/ctx.go
    • Line 9: warning: exported const RequestId should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: error var emptyReqIdErr should have name of the form errFoo (golint)
    • Line 17: warning: error var emptyUserIdErr should have name of the form errFoo (golint)
    • Line 18: warning: error var emptyUserTokenErr should have name of the form errFoo (golint)
    • Line 21: warning: exported type PipeFunc should have comment or be unexported (golint)
    • Line 23: warning: exported function Pipe should have comment or be unexported (golint)
    • Line 34: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 50: warning: should not use basic type int as key in context.WithValue (golint)
    • Line 66: warning: should not use basic type int as key in context.WithValue (golint)
    • api/api/current_user.go
    • Line 14: warning: exported type CurrentUserController should have comment or be unexported (golint)
    • Line 24: warning: exported function NewCurrentUserController should have comment or be unexported (golint)
    • api/app/beatmap.go
    • Line 14: warning: exported var ErrNotFoundBM should have comment or be unexported (golint)
    • Line 17: warning: exported type BeatmapUseCase should have comment or be unexported (golint)
    • Line 22: warning: exported function NewBeatmapUseCase should have comment or be unexported (golint)
    • Line 45: warning: exported method BeatmapUseCase.Lookup should have comment or be unexported (golint)
    • api/api/chat.go
    • Line 15: warning: exported type ChatController should have comment or be unexported (golint)
    • Line 25: warning: exported function NewChatController should have comment or be unexported (golint)
    • api/services/log/log.go
    • Line 13: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 21: warning: exported function NewOptions should have comment or be unexported (golint)
    • api/app/app.go
    • Line 24: warning: exported type App should have comment or be unexported (golint)
    • Line 65: warning: exported method App.SetContext should have comment or be unexported (golint)
    • api/app/user.go
    • Line 16: warning: exported var ErrNotFoundUser should have comment or be unexported (golint)
    • Line 20: warning: exported type UserUseCase should have comment or be unexported (golint)
    • Line 25: warning: exported function NewUserUseCase should have comment or be unexported (golint)
    • Line 53: warning: exported method UserUseCase.UpdateLastVisit should have comment or be unexported (golint)
    • Line 62: warning: exported method UserUseCase.Create should have comment or be unexported (golint)
    • api/repository/gorm/supplier.go
    • Line 12: warning: exported type Options should have comment or be unexported (golint)
    • Line 34: warning: exported type Supplier should have comment or be unexported (golint)
    • Line 99: warning: exported method Supplier.GetMaster should have comment or be unexported (golint)
    • api/entity/beatmap_failtimes.go
    • Line 5: warning: exported type Failtimes should have comment or be unexported (golint)
    • Line 12: warning: exported method Failtimes.TableName should have comment or be unexported (golint)
    • api/entity/user.go
    • Line 10: warning: exported type User should have comment or be unexported (golint)
    • Line 55: warning: exported method User.TableName should have comment or be unexported (golint)
    • Line 59: warning: exported method User.AfterFind should have comment or be unexported (golint)
    • Line 73: warning: exported method Country.TableName should have comment or be unexported (golint)
    • Line 90: warning: exported method Kudosu.Value should have comment or be unexported (golint)
    • Line 91: warning: exported method Kudosu.Scan should have comment or be unexported (golint)
    • Line 103: warning: exported method Page.Value should have comment or be unexported (golint)
    • Line 104: warning: exported method Page.Scan should have comment or be unexported (golint)
    • api/entity/user_short.go
    • Line 8: warning: exported type UserBasic should have comment or be unexported (golint)
    • Line 42: warning: exported method UserShort.TableName should have comment or be unexported (golint)
    • Line 46: warning: exported method UserShort.AfterFind should have comment or be unexported (golint)
    • api/api/oauth_token.go
    • Line 13: warning: exported type OAuthTokenController should have comment or be unexported (golint)
    • Line 23: warning: exported function NewOAuthTokenController should have comment or be unexported (golint)
    • Line 33: warning: exported method OAuthTokenController.Create should have comment or be unexported (golint)
    • api/app/chat.go
    • Line 13: warning: exported var ErrNotFoundChat should have comment or be unexported (golint)
    • Line 16: warning: error var InvalidPMBodyErr should have name of the form ErrFoo (golint)
    • Line 17: warning: error var InvalidMessageBodyErr should have name of the form ErrFoo (golint)
    • Line 20: warning: exported type ChatUseCase should have comment or be unexported (golint)
    • Line 25: warning: exported function NewChatUseCase should have comment or be unexported (golint)
    • Line 29: warning: exported method ChatUseCase.CreateChat should have comment or be unexported (golint)
    • Line 52: warning: exported method ChatUseCase.GetUpdatesInChat should have comment or be unexported (golint)
    • Line 101: warning: exported method ChatUseCase.GetAllPublicChats should have comment or be unexported (golint)
    • Line 110: warning: exported method ChatUseCase.GetAllChats should have comment or be unexported (golint)
    • Line 119: warning: exported method ChatUseCase.JoinToChat should have comment or be unexported (golint)
    • Line 128: warning: exported method ChatUseCase.LeaveFromChat should have comment or be unexported (golint)
    • api/services/cache/redis.go
    • Line 11: warning: exported type RedisOptions should have comment or be unexported (golint)
    • Line 13: warning: exported function NewRedisOptions should have comment or be unexported (golint)
    • Line 17: warning: exported type RedisCache should have comment or be unexported (golint)
    • Line 23: warning: exported function NewRedis should have comment or be unexported (golint)
    • Line 27: warning: exported method RedisCache.Set should have comment or be unexported (golint)
    • Line 31: warning: exported method RedisCache.SetWithExpiry should have comment or be unexported (golint)
    • Line 43: warning: exported method RedisCache.Get should have comment or be unexported (golint)
    • Line 59: warning: exported method RedisCache.Remove should have comment or be unexported (golint)
    • Line 63: warning: exported method RedisCache.Purge should have comment or be unexported (golint)
    • Line 67: warning: exported method RedisCache.Len should have comment or be unexported (golint)
    • Line 71: warning: exported method RedisCache.Keys should have comment or be unexported (golint)
    • api/services/transports/http/http.go
    • Line 22: warning: exported var ProviderSet should have comment or be unexported (golint)
    • Line 24: warning: exported const WAIT_FOR_CONNECTIONS_BEFORE_SHUTDOWN should have comment or be unexported (golint)
    • Line 44: warning: exported type InitControllers should have comment or be unexported (golint)
    • Line 46: warning: exported function NewOptions should have comment or be unexported (golint)
    • Line 66: warning: exported function NewRouter should have comment or be unexported (golint)
    • Line 100: warning: exported function New should have comment or be unexported (golint)
    • Line 125: warning: exported method Server.Start should have comment or be unexported (golint)
    • Line 138: warning: exported method Server.Stop should have comment or be unexported (golint)
    • api/repository/gorm/user_store.go
    • Line 15: warning: exported type UserRepository should have comment or be unexported (golint)
    • Line 19: warning: exported function NewUserRepository should have comment or be unexported (golint)
    • Line 23: warning: exported method UserRepository.GetByBasic should have comment or be unexported (golint)
    • Line 43: warning: exported method UserRepository.Get should have comment or be unexported (golint)
    • Line 64: warning: exported method UserRepository.GetShort should have comment or be unexported (golint)
    • Line 81: warning: exported method UserRepository.Create should have comment or be unexported (golint)
    • Line 148: warning: exported method UserRepository.Update should have comment or be unexported (golint)
    • Line 152: warning: exported method UserRepository.Activate should have comment or be unexported (golint)
    • Line 166: warning: exported method UserRepository.Deactivate should have comment or be unexported (golint)
    • Line 181: warning: exported method UserRepository.Ban should have comment or be unexported (golint)
    • Line 185: warning: exported method UserRepository.UnBan should have comment or be unexported (golint)
    • Line 189: warning: exported method UserRepository.Mute should have comment or be unexported (golint)
    • Line 193: warning: exported method UserRepository.UnMute should have comment or be unexported (golint)
    • Line 197: warning: exported method UserRepository.UpdateLastVisit should have comment or be unexported (golint)
    • Line 213: warning: exported method UserRepository.ComputeFields should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!