Preparing report...

Report for github.com/SuperAvalonHome/gin-api

A    Great!    Found 33 issues across 40 files

Tweet

gofmt72%

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!


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!


golint25%

Golint is a linter for Go source code.

    • gin-api/pkg/e/code.go
    • Line 4: warning: exported const SUCCESS should have comment (or a comment on this block) or be unexported (golint)
    • gin-api/service/cache_service/article.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type Article should have comment or be unexported (golint)
    • Line 19: warning: exported method Article.GetArticleKey should have comment or be unexported (golint)
    • Line 23: warning: exported method Article.GetArticlesKey should have comment or be unexported (golint)
    • gin-api/models/sodexo.go
    • Line 7: warning: exported type SodexoUser should have comment or be unexported (golint)
    • Line 20: warning: exported type SodexoTrade should have comment or be unexported (golint)
    • Line 33: warning: exported type SodexoRefund should have comment or be unexported (golint)
    • Line 47: warning: exported function AddSodexoUser should have comment or be unexported (golint)
    • Line 68: warning: exported function AddSodexoTrade should have comment or be unexported (golint)
    • Line 89: warning: exported function AddSodexoRefund should have comment or be unexported (golint)
    • Line 122: warning: comment on exported function GetSodexoTrade should be of the form "GetSodexoTrade ..." (golint)
    • Line 123: warning: don't use underscores in Go names; func parameter order_id should be orderID (golint)
    • Line 134: warning: comment on exported function GetSodexoRefund should be of the form "GetSodexoRefund ..." (golint)
    • Line 135: warning: don't use underscores in Go names; func parameter order_id should be orderID (golint)
    • gin-api/service/tag_service/tag.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 20: warning: exported type Tag should have comment or be unexported (golint)
    • Line 31: warning: exported method Tag.ExistByName should have comment or be unexported (golint)
    • Line 35: warning: exported method Tag.ExistByID should have comment or be unexported (golint)
    • Line 39: warning: exported method Tag.Add should have comment or be unexported (golint)
    • Line 43: warning: exported method Tag.Edit should have comment or be unexported (golint)
    • Line 54: warning: exported method Tag.Delete should have comment or be unexported (golint)
    • Line 58: warning: exported method Tag.Count should have comment or be unexported (golint)
    • Line 62: warning: exported method Tag.GetAll should have comment or be unexported (golint)
    • Line 93: warning: exported method Tag.Export should have comment or be unexported (golint)
    • Line 148: warning: exported method Tag.Import should have comment or be unexported (golint)
    • gin-api/service/auth_service/auth.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 5: warning: exported type Auth should have comment or be unexported (golint)
    • Line 10: warning: exported method Auth.Check should have comment or be unexported (golint)
    • gin-api/routers/api/v1/tag.go
    • Line 19: warning: comment on exported function GetTags should be of the form "GetTags ..." (golint)
    • Line 58: warning: exported type AddTagForm should have comment or be unexported (golint)
    • Line 64: warning: comment on exported function AddTag should be of the form "AddTag ..." (golint)
    • Line 108: warning: exported type EditTagForm should have comment or be unexported (golint)
    • Line 115: warning: comment on exported function EditTag should be of the form "EditTag ..." (golint)
    • Line 163: warning: comment on exported function DeleteTag should be of the form "DeleteTag ..." (golint)
    • Line 200: warning: comment on exported function ExportTag should be of the form "ExportTag ..." (golint)
    • Line 232: warning: comment on exported function ImportTag should be of the form "ImportTag ..." (golint)
    • gin-api/service/article_service/article_poster.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 17: warning: exported type ArticlePoster should have comment or be unexported (golint)
    • Line 23: warning: exported function NewArticlePoster should have comment or be unexported (golint)
    • Line 31: warning: exported function GetPosterFlag should have comment or be unexported (golint)
    • Line 35: warning: exported method ArticlePoster.CheckMergedImage should have comment or be unexported (golint)
    • Line 43: warning: exported method ArticlePoster.OpenMergedImage should have comment or be unexported (golint)
    • Line 52: warning: exported type ArticlePosterBg should have comment or be unexported (golint)
    • Line 59: warning: exported type Rect should have comment or be unexported (golint)
    • Line 67: warning: exported type Pt should have comment or be unexported (golint)
    • Line 72: warning: exported function NewArticlePosterBg should have comment or be unexported (golint)
    • Line 81: warning: exported type DrawText should have comment or be unexported (golint)
    • Line 96: warning: exported method ArticlePosterBg.DrawPoster should have comment or be unexported (golint)
    • Line 136: warning: exported method ArticlePosterBg.Generate should have comment or be unexported (golint)
    • gin-api/pkg/qrcode/qrcode.go
    • Line 14: warning: exported type QrCode should have comment or be unexported (golint)
    • Line 24: warning: exported const EXT_JPG should have comment (or a comment on this block) or be unexported (golint)
    • gin-api/pkg/e/cache.go
    • Line 4: warning: exported const CACHE_ARTICLE should have comment (or a comment on this block) or be unexported (golint)
    • gin-api/pkg/setting/setting.go
    • Line 10: warning: exported type App should have comment or be unexported (golint)
    • Line 31: warning: exported var AppSetting should have comment or be unexported (golint)
    • Line 33: warning: exported type Server should have comment or be unexported (golint)
    • Line 40: warning: exported var ServerSetting should have comment or be unexported (golint)
    • Line 42: warning: exported type Database should have comment or be unexported (golint)
    • Line 51: warning: exported var DatabaseSetting should have comment or be unexported (golint)
    • Line 53: warning: exported type Redis should have comment or be unexported (golint)
    • Line 61: warning: exported var RedisSetting should have comment or be unexported (golint)
    • gin-api/service/sodexo_service/sodexo_refund.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 7: warning: exported type SodexoRefund should have comment or be unexported (golint)
    • Line 21: warning: exported method SodexoRefund.Add should have comment or be unexported (golint)
    • Line 41: warning: exported method SodexoRefund.Get should have comment or be unexported (golint)
    • gin-api/service/sodexo_service/sodexo_trade.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 7: warning: exported type SodexoTrade should have comment or be unexported (golint)
    • Line 20: warning: exported method SodexoTrade.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method SodexoTrade.Get should have comment or be unexported (golint)
    • gin-api/pkg/logging/log.go
    • Line 12: warning: exported type Level should have comment or be unexported (golint)
    • Line 15: warning: exported var F should have comment or be unexported (golint)
    • Line 26: warning: exported const DEBUG should have comment (or a comment on this block) or be unexported (golint)
    • gin-api/routers/api/v1/sodexo.go
    • Line 15: warning: comment on exported function GetSodexoUser should be of the form "GetSodexoUser ..." (golint)
    • Line 45: warning: exported function GetSodexoTrade should have comment or be unexported (golint)
    • Line 47: warning: don't use underscores in Go names; var order_id should be orderID (golint)
    • Line 60: warning: exported function GetSodexoRefund should have comment or be unexported (golint)
    • Line 62: warning: don't use underscores in Go names; var order_id should be orderID (golint)
    • gin-api/service/article_service/article.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 12: warning: exported type Article should have comment or be unexported (golint)
    • Line 27: warning: exported method Article.Add should have comment or be unexported (golint)
    • Line 45: warning: exported method Article.Edit should have comment or be unexported (golint)
    • Line 57: warning: exported method Article.Get should have comment or be unexported (golint)
    • Line 81: warning: exported method Article.GetAll should have comment or be unexported (golint)
    • Line 113: warning: exported method Article.Delete should have comment or be unexported (golint)
    • Line 117: warning: exported method Article.ExistByID should have comment or be unexported (golint)
    • Line 121: warning: exported method Article.Count should have comment or be unexported (golint)
    • gin-api/service/cache_service/tag.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 10: warning: exported type Tag should have comment or be unexported (golint)
    • Line 19: warning: exported method Tag.GetTagsKey should have comment or be unexported (golint)
    • gin-api/models/models.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 16: warning: exported type Model should have comment or be unexported (golint)
    • gin-api/service/sodexo_service/sodexo_user.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 7: warning: exported type SodexoUser should have comment or be unexported (golint)
    • Line 20: warning: exported method SodexoUser.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method SodexoUser.Get should have comment or be unexported (golint)
    • gin-api/routers/api/v1/article.go
    • Line 20: warning: comment on exported function GetArticle should be of the form "GetArticle ..." (golint)
    • Line 58: warning: comment on exported function GetArticles should be of the form "GetArticles ..." (golint)
    • Line 114: warning: exported type AddArticleForm should have comment or be unexported (golint)
    • Line 124: warning: comment on exported function AddArticle should be of the form "AddArticle ..." (golint)
    • Line 176: warning: exported type EditArticleForm should have comment or be unexported (golint)
    • Line 187: warning: comment on exported function EditArticle should be of the form "EditArticle ..." (golint)
    • Line 252: warning: comment on exported function DeleteArticle should be of the form "DeleteArticle ..." (golint)
    • Line 291: warning: exported const QRCODE_URL should have comment (or a comment on this block) or be unexported (golint)
    • Line 294: warning: exported function GenerateArticlePoster should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell90%

Misspell Finds commonly misspelled English words