Preparing report...

Report for github.com/Monkey-Mouse/mo2

A+    Excellent!    Found 39 issues across 82 files

Tweet

gofmt98%

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!


gocyclo98%

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.


golint53%

Golint is a linter for Go source code.

    • mo2/server/controller/category.go
    • Line 36: 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 65: 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 69: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mo2/config/config.go
    • Line 9: warning: exported type Configuration should have comment or be unexported (golint)
    • Line 14: warning: exported function LoadConfig should have comment or be unexported (golint)
    • mo2/mo2utils/search.go
    • Line 37: warning: exported function QueryBlog should have comment or be unexported (golint)
    • Line 49: warning: exported function DeleteBlogIndex should have comment or be unexported (golint)
    • Line 52: warning: exported function QueryPrefix should have comment or be unexported (golint)
    • mo2/database/categories.go
    • Line 45: warning: comment on exported function FindOrCreateRoot4User should be of the form "FindOrCreateRoot4User ..." (golint)
    • Line 97: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 140: warning: comment on exported function DeleteCategory should be of the form "DeleteCategory ..." (golint)
    • Line 151: warning: exported function UpdateSubCategories should have comment or be unexported (golint)
    • Line 208: warning: comment on exported function RightFilter should be of the form "RightFilter ..." (golint)
    • Line 237: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 296: warning: comment on exported function RelateCategories2Blog should be of the form "RelateCategories2Blog ..." (golint)
    • mo2/database/group.go
    • Line 16: warning: exported var GroupCol should have comment or be unexported (golint)
    • Line 55: 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)
    • mo2/server/model/directory.go
    • Line 25: warning: exported method Directory.UpdateParentId should have comment or be unexported (golint)
    • Line 28: warning: exported method Directory.UpdateName should have comment or be unexported (golint)
    • Line 31: warning: exported method Directory.Init should have comment or be unexported (golint)
    • Line 34: warning: exported method Directory.InitWithName should have comment or be unexported (golint)
    • Line 38: warning: exported method Directory.InitWithNameAndParent should have comment or be unexported (golint)
    • Line 44: warning: exported method Directory.IsValid should have comment or be unexported (golint)
    • mo2/server/controller/blog.go
    • Line 62: warning: exported method Controller.SetDocType should have comment or be unexported (golint)
    • Line 109: 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 132: warning: exported var MErrNoLogin should have comment or be unexported (golint)
    • Line 177: 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 200: 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 204: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 439: 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 445: 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)
    • mo2/services/accessControl/rules.go
    • Line 1: warning: don't use MixedCaps in package name; accessControl should be accesscontrol (golint)
    • Line 18: warning: exported const RuleAllowOwn should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported const RoleOwner should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported type AllowOwn should have comment or be unexported (golint)
    • Line 36: warning: exported method AllowOwn.ProcessContext should have comment or be unexported (golint)
    • Line 41: warning: exported method AllowOwn.JudgeRule should have comment or be unexported (golint)
    • Line 51: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 58: 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 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 71: warning: exported type AccessFilter should have comment or be unexported (golint)
    • Line 77: warning: comment on exported method AccessFilter.JudgeRule should be of the form "JudgeRule ..." (golint)
    • Line 105: warning: exported method AccessFilter.ProcessContext should have comment or be unexported (golint)
    • mo2/dto/account.go
    • Line 19: warning: exported method LoginUserInfo.IsUserInRole should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type LoginUserInfo should be of the form "LoginUserInfo ..." (with optional leading article) (golint)
    • Line 31: warning: exported method LoginUserInfo.IsInRole should have comment or be unexported (golint)
    • Line 31: warning: receiver name t should be consistent with previous receiver name user for LoginUserInfo (golint)
    • Line 35: warning: exported function Account2SuccessLogin should have comment or be unexported (golint)
    • Line 43: warning: exported type UserInfo should have comment or be unexported (golint)
    • Line 51: warning: exported function Account2UserPublicInfo should have comment or be unexported (golint)
    • Line 60: warning: exported type UserInfoBrief should have comment or be unexported (golint)
    • Line 67: warning: exported function MapAccount2InfoBrief should have comment or be unexported (golint)
    • mo2/server/model/blog.go
    • Line 25: warning: exported type Filter should have comment or be unexported (golint)
    • Line 33: warning: exported method Blog.Init should have comment or be unexported (golint)
    • Line 37: warning: exported method Blog.Add2Category should have comment or be unexported (golint)
    • Line 40: warning: exported method Blog.Add2Categories should have comment or be unexported (golint)
    • Line 43: warning: exported method Blog.IsValid should have comment or be unexported (golint)
    • mo2/services/accessControl/grants.go
    • Line 1: warning: don't use MixedCaps in package name; accessControl should be accesscontrol (golint)
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 8: warning: exported var Ctrl should have comment or be unexported (golint)
    • mo2/database/utils.go
    • Line 10: warning: exported function GetClient should have comment or be unexported (golint)
    • Line 18: warning: exported function GetCollection should have comment or be unexported (golint)
    • Line 27: warning: exported function If should have comment or be unexported (golint)
    • Line 30: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • mo2/server/controller/oauth.go
    • Line 23: warning: exported type GithubUser should have comment or be unexported (golint)
    • Line 32: warning: exported method Controller.GithubOauth should have comment or be unexported (golint)
    • mo2/dto/img.go
    • Line 3: warning: exported type ImgUploadToken should have comment or be unexported (golint)
    • mo2/services/mo2search/mo2search.go
    • Line 13: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 27: warning: exported function JsonRPC should have comment or be unexported (golint)
    • Line 66: warning: exported function Index should have comment or be unexported (golint)
    • Line 69: warning: exported function Delete should have comment or be unexported (golint)
    • mo2/database/accounts.go
    • Line 24: warning: exported function CreateAccountIndex should have comment or be unexported (golint)
    • Line 67: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 80: warning: comment on exported function InitAccount should be of the form "InitAccount ..." (golint)
    • Line 137: warning: comment on exported function UpsertAccount should be of the form "UpsertAccount ..." (golint)
    • Line 142: warning: exported function UpsertAccountWithF should have comment or be unexported (golint)
    • Line 173: warning: exported function DeleteAccount should have comment or be unexported (golint)
    • Line 184: warning: exported function DeleteAccountByEmail should have comment or be unexported (golint)
    • Line 196: warning: comment on exported function CreateAnonymousAccount should be of the form "CreateAnonymousAccount ..." (golint)
    • Line 224: warning: comment on exported function VerifyEmail should be of the form "VerifyEmail ..." (golint)
    • Line 242: warning: comment on exported function VerifyAccount should be of the form "VerifyAccount ..." (golint)
    • mo2/server/controller/group.go
    • Line 59: 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 112: 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 164: 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 196: 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)
    • mo2/database/recycleBin.go
    • Line 30: warning: comment on exported function DeleteRecycleItems should be of the form "DeleteRecycleItems ..." (golint)
    • Line 43: warning: comment on exported function DeleteByRecycleItemID should be of the form "DeleteByRecycleItemID ..." (golint)
    • Line 56: warning: comment on exported function DeleteByRecycleItemInfo should be of the form "DeleteByRecycleItemInfo ..." (golint)
    • Line 69: warning: comment on exported function DeleteExpireItems should be of the form "DeleteExpireItems ..." (golint)
    • mo2/services/accessControl/resource.go
    • Line 1: warning: don't use MixedCaps in package name; accessControl should be accesscontrol (golint)
    • Line 4: warning: comment on exported const ResourceBlog should be of the form "ResourceBlog ..." (golint)
    • Line 6: warning: exported const ResourceAccount should have comment (or a comment on this block) or be unexported (golint)
    • mo2/database/blogs.go
    • Line 21: warning: exported const OperationKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported const DurationBeforeBlogDelete should have comment (or a comment on this block) or be unexported (golint)
    • Line 153: warning: comment on exported function FindBlogsByUser should be of the form "FindBlogsByUser ..." (golint)
    • Line 161: warning: comment on exported function FindBlogsByUserId should be of the form "FindBlogsByUserId ..." (golint)
    • Line 173: warning: comment on exported function FindBlogById should be of the form "FindBlogById ..." (golint)
    • mo2/server/controller/like.go
    • Line 29: warning: exported method Controller.Liked should have comment or be unexported (golint)
    • Line 54: warning: exported method Controller.Like should have comment or be unexported (golint)
    • Line 103: warning: exported method Controller.LikeNum should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!