Preparing report...

Report for github.com/yezihack/go-mygen

A    Great!    Found 17 issues across 19 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!


golint10%

Golint is a linter for Go source code.

    • go-mygen/example/db_models/db_entity.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgBlogTags should have comment or be unexported (golint)
    • Line 19: warning: exported type SgBlogTagsNull should have comment or be unexported (golint)
    • Line 28: warning: exported type SgBlogs should have comment or be unexported (golint)
    • Line 44: warning: exported type SgBlogsNull should have comment or be unexported (golint)
    • Line 60: warning: exported type SgConfigs should have comment or be unexported (golint)
    • Line 72: warning: exported type SgConfigsNull should have comment or be unexported (golint)
    • Line 84: warning: exported type SgMigrations should have comment or be unexported (golint)
    • Line 90: warning: exported type SgMigrationsNull should have comment or be unexported (golint)
    • Line 96: warning: exported type SgTags should have comment or be unexported (golint)
    • Line 105: warning: exported type SgTagsNull should have comment or be unexported (golint)
    • Line 114: warning: exported type SgUsers should have comment or be unexported (golint)
    • Line 128: warning: exported type SgUsersNull should have comment or be unexported (golint)
    • go-mygen/example/db_models/sg_blogs.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgBlogsModel should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSgBlogs should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method SgBlogsModel.Save should be of the form "Save ..." (golint)
    • Line 131: warning: comment on exported method SgBlogsModel.Create should be of the form "Create ..." (golint)
    • Line 160: warning: comment on exported method SgBlogsModel.Update should be of the form "Update ..." (golint)
    • Line 178: warning: comment on exported method SgBlogsModel.Find should be of the form "Find ..." (golint)
    • Line 185: warning: comment on exported method SgBlogsModel.First should be of the form "First ..." (golint)
    • Line 195: warning: comment on exported method SgBlogsModel.Last should be of the form "Last ..." (golint)
    • Line 205: warning: comment on exported method SgBlogsModel.Count should be of the form "Count ..." (golint)
    • go-mygen/example/db_models/sg_tags.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgTagsModel should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSgTags should have comment or be unexported (golint)
    • Line 83: warning: comment on exported method SgTagsModel.Save should be of the form "Save ..." (golint)
    • Line 103: warning: comment on exported method SgTagsModel.Create should be of the form "Create ..." (golint)
    • Line 125: warning: comment on exported method SgTagsModel.Update should be of the form "Update ..." (golint)
    • Line 136: warning: comment on exported method SgTagsModel.Find should be of the form "Find ..." (golint)
    • Line 143: warning: comment on exported method SgTagsModel.First should be of the form "First ..." (golint)
    • Line 153: warning: comment on exported method SgTagsModel.Last should be of the form "Last ..." (golint)
    • Line 163: warning: comment on exported method SgTagsModel.Count should be of the form "Count ..." (golint)
    • go-mygen/example/db_models/sg_users.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgUsersModel should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSgUsers should have comment or be unexported (golint)
    • Line 103: warning: comment on exported method SgUsersModel.Save should be of the form "Save ..." (golint)
    • Line 123: warning: comment on exported method SgUsersModel.Create should be of the form "Create ..." (golint)
    • Line 150: warning: comment on exported method SgUsersModel.Update should be of the form "Update ..." (golint)
    • Line 166: warning: comment on exported method SgUsersModel.Find should be of the form "Find ..." (golint)
    • Line 173: warning: comment on exported method SgUsersModel.First should be of the form "First ..." (golint)
    • Line 183: warning: comment on exported method SgUsersModel.Last should be of the form "Last ..." (golint)
    • Line 193: warning: comment on exported method SgUsersModel.Count should be of the form "Count ..." (golint)
    • go-mygen/config.go
    • Line 6: warning: exported const ProjectName should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported const DS should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported const TPL_CURD should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: don't use underscores in Go names; const TPL_Error should be TPLError (golint)
    • Line 32: warning: exported const Unknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: don't use underscores in Go names; const GODIR_Config should be GODIRConfig (golint)
    • Line 42: warning: don't use underscores in Go names; const GODIR_Entity should be GODIREntity (golint)
    • Line 44: warning: don't use underscores in Go names; const GoFile_TableList should be GoFileTableList (golint)
    • Line 45: warning: don't use underscores in Go names; const GoFile_Init should be GoFileInit (golint)
    • Line 46: warning: don't use underscores in Go names; const GoFile_Error should be GoFileError (golint)
    • Line 47: warning: don't use underscores in Go names; const GoFile_Example should be GoFileExample (golint)
    • Line 51: warning: exported const PkgDbModels should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: comment on exported var CmdHelp should be of the form "CmdHelp ..." (golint)
    • Line 69: warning: comment on exported var MysqlTypeToGoType should be of the form "MysqlTypeToGoType ..." (golint)
    • Line 97: warning: comment on exported var MysqlTypeToGoNullType should be of the form "MysqlTypeToGoNullType ..." (golint)
    • go-mygen/logic.go
    • Line 13: warning: exported type Logic should have comment or be unexported (golint)
    • Line 21: warning: comment on exported method Logic.CreateEntity should be of the form "CreateEntity ..." (golint)
    • Line 52: warning: comment on exported method Logic.CreateCURD should be of the form "CreateCURD ..." (golint)
    • Line 104: warning: comment on exported method Logic.CreateMarkdown should be of the form "CreateMarkdown ..." (golint)
    • Line 138: warning: comment on exported method Logic.GetMysqlDir should be of the form "GetMysqlDir ..." (golint)
    • Line 143: warning: comment on exported method Logic.GetConfigDir should be of the form "GetConfigDir ..." (golint)
    • Line 148: warning: comment on exported method Logic.GetEntityDir should be of the form "GetEntityDir ..." (golint)
    • Line 153: warning: comment on exported method Logic.GetRoot should be of the form "GetRoot ..." (golint)
    • Line 158: warning: comment on exported method Logic.GenerateDBStructure should be of the form "GenerateDBStructure ..." (golint)
    • Line 224: warning: comment on exported method Logic.GenerateDBEntity should be of the form "GenerateDBEntity ..." (golint)
    • Line 284: warning: comment on exported method Logic.GenerateCURDFile should be of the form "GenerateCURDFile ..." (golint)
    • Line 376: warning: comment on exported method Logic.GenerateExample should be of the form "GenerateExample ..." (golint)
    • Line 410: warning: comment on exported method Logic.GenerateTableList should be of the form "GenerateTableList ..." (golint)
    • Line 446: warning: comment on exported method Logic.GenerateInit should be of the form "GenerateInit ..." (golint)
    • Line 481: warning: comment on exported method Logic.GenerateError should be of the form "GenerateError ..." (golint)
    • Line 517: warning: comment on exported method Logic.GenerateSQL should be of the form "GenerateSQL ..." (golint)
    • Line 560: warning: comment on exported method Logic.GenerateMarkdown should be of the form "GenerateMarkdown ..." (golint)
    • go-mygen/core.go
    • Line 18: warning: exported var Conn should have comment or be unexported (golint)
    • Line 114: warning: comment on exported function Commands should be of the form "Commands ..." (golint)
    • go-mygen/service.go
    • Line 8: warning: comment on exported method ModelS.GetTableNameAndComment should be of the form "GetTableNameAndComment ..." (golint)
    • Line 51: warning: comment on exported method ModelS.GetTableDesc should be of the form "GetTableDesc ..." (golint)
    • go-mygen/example/db_entity/db_entity.go
    • Line 1: warning: package comment should be of the form "Package entity ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgBlogTags should have comment or be unexported (golint)
    • Line 19: warning: exported type SgBlogTagsNull should have comment or be unexported (golint)
    • Line 28: warning: exported type SgBlogs should have comment or be unexported (golint)
    • Line 44: warning: exported type SgBlogsNull should have comment or be unexported (golint)
    • Line 60: warning: exported type SgConfigs should have comment or be unexported (golint)
    • Line 72: warning: exported type SgConfigsNull should have comment or be unexported (golint)
    • Line 84: warning: exported type SgMigrations should have comment or be unexported (golint)
    • Line 90: warning: exported type SgMigrationsNull should have comment or be unexported (golint)
    • Line 96: warning: exported type SgTags should have comment or be unexported (golint)
    • Line 105: warning: exported type SgTagsNull should have comment or be unexported (golint)
    • Line 114: warning: exported type SgUsers should have comment or be unexported (golint)
    • Line 128: warning: exported type SgUsersNull should have comment or be unexported (golint)
    • go-mygen/example/db_models/sg_migrations.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgMigrationsModel should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSgMigrations should have comment or be unexported (golint)
    • Line 75: warning: comment on exported method SgMigrationsModel.Save should be of the form "Save ..." (golint)
    • Line 95: warning: comment on exported method SgMigrationsModel.Create should be of the form "Create ..." (golint)
    • Line 117: warning: comment on exported method SgMigrationsModel.Update should be of the form "Update ..." (golint)
    • Line 128: warning: comment on exported method SgMigrationsModel.Find should be of the form "Find ..." (golint)
    • Line 135: warning: comment on exported method SgMigrationsModel.First should be of the form "First ..." (golint)
    • Line 145: warning: comment on exported method SgMigrationsModel.Last should be of the form "Last ..." (golint)
    • Line 155: warning: comment on exported method SgMigrationsModel.Count should be of the form "Count ..." (golint)
    • go-mygen/model.go
    • Line 11: warning: comment on exported function InitDB should be of the form "InitDB ..." (golint)
    • Line 40: warning: comment on exported function NewDB should be of the form "NewDB ..." (golint)
    • Line 44: warning: exported method ModelS.Using should have comment or be unexported (golint)
    • Line 48: warning: comment on exported method ModelS.Find should be of the form "Find ..." (golint)
    • Line 99: warning: comment on exported method ModelS.First should be of the form "First ..." (golint)
    • Line 144: warning: comment on exported method ModelS.Pluck should be of the form "Pluck ..." (golint)
    • Line 191: warning: comment on exported method ModelS.Update should be of the form "Update ..." (golint)
    • Line 209: warning: comment on exported method ModelS.Delete should be of the form "Delete ..." (golint)
    • Line 227: warning: comment on exported method ModelS.Insert should be of the form "Insert ..." (golint)
    • go-mygen/example/db_models/sg_blog_tags.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 12: warning: exported type SgBlogTagsModel should have comment or be unexported (golint)
    • Line 16: warning: exported function NewSgBlogTags should have comment or be unexported (golint)
    • Line 84: warning: comment on exported method SgBlogTagsModel.Save should be of the form "Save ..." (golint)
    • Line 105: warning: comment on exported method SgBlogTagsModel.Create should be of the form "Create ..." (golint)
    • Line 127: warning: comment on exported method SgBlogTagsModel.Update should be of the form "Update ..." (golint)
    • Line 138: warning: comment on exported method SgBlogTagsModel.Find should be of the form "Find ..." (golint)
    • Line 145: warning: comment on exported method SgBlogTagsModel.First should be of the form "First ..." (golint)
    • Line 155: warning: comment on exported method SgBlogTagsModel.Last should be of the form "Last ..." (golint)
    • Line 165: warning: comment on exported method SgBlogTagsModel.Count should be of the form "Count ..." (golint)
    • go-mygen/example/db_models/sg_configs.go
    • Line 1: warning: package comment should be of the form "Package models ..." (golint)
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported type SgConfigsModel should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSgConfigs should have comment or be unexported (golint)
    • Line 95: warning: comment on exported method SgConfigsModel.Save should be of the form "Save ..." (golint)
    • Line 115: warning: comment on exported method SgConfigsModel.Create should be of the form "Create ..." (golint)
    • Line 140: warning: comment on exported method SgConfigsModel.Update should be of the form "Update ..." (golint)
    • Line 154: warning: comment on exported method SgConfigsModel.Find should be of the form "Find ..." (golint)
    • Line 161: warning: comment on exported method SgConfigsModel.First should be of the form "First ..." (golint)
    • Line 171: warning: comment on exported method SgConfigsModel.Last should be of the form "Last ..." (golint)
    • Line 181: warning: comment on exported method SgConfigsModel.Count should be of the form "Count ..." (golint)
    • go-mygen/entry.go
    • Line 9: warning: exported type CmdEntity should have comment or be unexported (golint)
    • Line 14: warning: comment on exported type ModelS should be of the form "ModelS ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported type DBConfig should be of the form "DBConfig ..." (with optional leading article) (golint)
    • Line 37: warning: comment on exported type EntityReq should be of the form "EntityReq ..." (with optional leading article) (golint)
    • Line 50: warning: comment on exported type TableDesc should be of the form "TableDesc ..." (with optional leading article) (golint)
    • Line 66: warning: comment on exported type MarkDownData should be of the form "MarkDownData ..." (with optional leading article) (golint)
    • Line 71: warning: exported type MarkDownDataChild should have comment or be unexported (golint)
    • Line 78: warning: comment on exported type FieldsInfo should be of the form "FieldsInfo ..." (with optional leading article) (golint)
    • Line 89: warning: comment on exported type TableInfo should be of the form "TableInfo ..." (with optional leading article) (golint)
    • Line 98: warning: comment on exported type TableList should be of the form "TableList ..." (with optional leading article) (golint)
    • Line 106: warning: comment on exported type SqlInfo should be of the form "SqlInfo ..." (with optional leading article) (golint)
    • Line 127: warning: comment on exported type SqlFieldInfo should be of the form "SqlFieldInfo ..." (with optional leading article) (golint)
    • Line 132: warning: exported type NullSqlFieldInfo should have comment or be unexported (golint)
    • Line 139: warning: comment on exported type TableNameAndComment should be of the form "TableNameAndComment ..." (with optional leading article) (golint)
    • go-mygen/tools.go
    • Line 20: warning: exported type Tools should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method Tools.CheckFileContainsChar should be of the form "CheckFileContainsChar ..." (golint)
    • Line 33: warning: comment on exported method Tools.ReadFile should be of the form "ReadFile ..." (golint)
    • Line 42: warning: comment on exported method Tools.WriteFile should be of the form "WriteFile ..." (golint)
    • Line 61: warning: comment on exported method Tools.WriteFileAppend should be of the form "WriteFileAppend ..." (golint)
    • Line 80: warning: comment on exported method Tools.CreateFile should be of the form "CreateFile ..." (golint)
    • Line 90: warning: comment on exported method Tools.CreateDir should be of the form "CreateDir ..." (golint)
    • Line 101: warning: comment on exported method Tools.GenerateDir should be of the form "GenerateDir ..." (golint)
    • Line 119: warning: comment on exported method Tools.IsDirOrFileExist should be of the form "IsDirOrFileExist ..." (golint)
    • Line 125: warning: comment on exported method Tools.IsDir should be of the form "IsDir ..." (golint)
    • Line 131: warning: comment on exported method Tools.IsFile should be of the form "IsFile ..." (golint)
    • Line 150: warning: comment on exported method Tools.Capitalize should be of the form "Capitalize ..." (golint)
    • Line 171: warning: comment on exported method Tools.ToUpper should be of the form "ToUpper ..." (golint)
    • Line 176: warning: comment on exported method Tools.ToJson should be of the form "ToJson ..." (golint)
    • Line 185: warning: comment on exported function CreateDir should be of the form "CreateDir ..." (golint)
    • Line 199: warning: comment on exported function WriteFile should be of the form "WriteFile ..." (golint)
    • Line 204: 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 205: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 209: warning: comment on exported function WriteAppendFile should be of the form "WriteAppendFile ..." (golint)
    • Line 214: 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 219: warning: comment on exported function GetExeRootDir should be of the form "GetExeRootDir ..." (golint)
    • Line 231: warning: comment on exported function GetRootPath should be of the form "GetRootPath ..." (golint)
    • Line 239: warning: comment on exported function SubStr should be of the form "SubStr ..." (golint)
    • Line 249: warning: exported function ErrMsg should have comment or be unexported (golint)
    • Line 256: warning: comment on exported function Gofmt should be of the form "Gofmt ..." (golint)
    • Line 269: warning: comment on exported function Clean should be of the form "Clean ..." (golint)
    • Line 283: warning: comment on exported function GetOs should be of the form "GetOs ..." (golint)
    • Line 297: warning: exported function ExecCommand should have comment or be unexported (golint)
    • Line 306: warning: comment on exported function FormatField should be of the form "FormatField ..." (golint)
    • Line 318: warning: comment on exported function AddToComment should be of the form "AddToComment ..." (golint)
    • Line 326: warning: comment on exported function InArrayString should be of the form "InArrayString ..." (golint)
    • Line 336: warning: comment on exported function CheckCharDoSpecial should be of the form "CheckCharDoSpecial ..." (golint)
    • Line 358: warning: exported function CheckCharDoSpecialArr should have comment or be unexported (golint)
    • Line 363: warning: comment on exported function AddQuote should be of the form "AddQuote ..." (golint)
    • Line 368: warning: comment on exported function CleanQuote should be of the form "CleanQuote ..." (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!


misspell94%

Misspell Finds commonly misspelled English words