Preparing report...

Report for github.com/astaxie/beego

(v1.12.3)

A+    Excellent!    Found 55 issues across 207 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!


gocyclo80%

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.

    • router.go
    • Line 694: warning: cyclomatic complexity 76 of function (*ControllerRegister).ServeHTTP() is high (> 15) (gocyclo)
    • Line 557: warning: cyclomatic complexity 40 of function (*ControllerRegister).getURL() is high (> 15) (gocyclo)
    • Line 254: warning: cyclomatic complexity 16 of function (*ControllerRegister).Include() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 16 of function (*ControllerRegister).addWithMethodParams() is high (> 15) (gocyclo)
    • httplib/httplib.go
    • Line 441: warning: cyclomatic complexity 20 of function (*BeegoHTTPRequest).DoRequest() is high (> 15) (gocyclo)
    • Line 372: warning: cyclomatic complexity 17 of function (*BeegoHTTPRequest).buildURL() is high (> 15) (gocyclo)
    • utils/mail.go
    • Line 84: warning: cyclomatic complexity 17 of function (*Email).Bytes() is high (> 15) (gocyclo)
    • utils/debug.go
    • Line 164: warning: cyclomatic complexity 53 of function printKeyValue() is high (> 15) (gocyclo)
    • Line 113: warning: cyclomatic complexity 17 of function isSimpleType() is high (> 15) (gocyclo)
    • Line 374: warning: cyclomatic complexity 17 of function PrintPointerInfo() is high (> 15) (gocyclo)
    • tree.go
    • Line 294: warning: cyclomatic complexity 36 of function (*Tree).match() is high (> 15) (gocyclo)
    • Line 56: warning: cyclomatic complexity 31 of function (*Tree).addtree() is high (> 15) (gocyclo)
    • Line 479: warning: cyclomatic complexity 25 of function splitSegment() is high (> 15) (gocyclo)
    • Line 209: warning: cyclomatic complexity 23 of function (*Tree).addseg() is high (> 15) (gocyclo)
    • Line 394: warning: cyclomatic complexity 20 of function (*leafInfo).match() is high (> 15) (gocyclo)
    • orm/orm_test.go
    • Line 2429: warning: cyclomatic complexity 21 of function TestInsertOrUpdate() is high (> 15) (gocyclo)
    • toolbox/task.go
    • Line 295: warning: cyclomatic complexity 17 of function (*Schedule).Next() is high (> 15) (gocyclo)
    • config/ini.go
    • Line 61: warning: cyclomatic complexity 37 of function (*IniConfig).parseData() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 24 of function (*IniConfigContainer).SaveConfigFile() is high (> 15) (gocyclo)
    • orm/db_tables.go
    • Line 214: warning: cyclomatic complexity 29 of function (*dbTables).parseExprs() is high (> 15) (gocyclo)
    • parser.go
    • Line 255: warning: cyclomatic complexity 23 of function parseComment() is high (> 15) (gocyclo)
    • Line 411: warning: cyclomatic complexity 20 of function genRouterCode() is high (> 15) (gocyclo)
    • config.go
    • Line 294: warning: cyclomatic complexity 19 of function assignConfig() is high (> 15) (gocyclo)
    • templatefunc.go
    • Line 274: warning: cyclomatic complexity 46 of function parseFormToStruct() is high (> 15) (gocyclo)
    • Line 718: warning: cyclomatic complexity 16 of function MapGet() is high (> 15) (gocyclo)
    • orm/cmd.go
    • Line 100: warning: cyclomatic complexity 35 of function (*commandSyncDb).Run() is high (> 15) (gocyclo)
    • migration/ddl.go
    • Line 268: warning: cyclomatic complexity 31 of function (*Migration).GetSQL() is high (> 15) (gocyclo)
    • orm/cmd_utils.go
    • Line 137: warning: cyclomatic complexity 29 of function getDbCreateSQL() is high (> 15) (gocyclo)
    • Line 45: warning: cyclomatic complexity 27 of function getColumnTyp() is high (> 15) (gocyclo)
    • tree_test.go
    • Line 115: warning: cyclomatic complexity 23 of function TestAddTree() is high (> 15) (gocyclo)
    • context/output.go
    • Line 90: warning: cyclomatic complexity 20 of function (*BeegoOutput).Cookie() is high (> 15) (gocyclo)
    • orm/utils.go
    • Line 161: warning: cyclomatic complexity 16 of function ToStr() is high (> 15) (gocyclo)
    • template.go
    • Line 298: warning: cyclomatic complexity 17 of function _getTemplate() is high (> 15) (gocyclo)
    • orm/db.go
    • Line 1424: warning: cyclomatic complexity 73 of function (*dbBase).setFieldValue() is high (> 15) (gocyclo)
    • Line 1266: warning: cyclomatic complexity 51 of function (*dbBase).convertValueFromDB() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 50 of function (*dbBase).collectFieldValue() is high (> 15) (gocyclo)
    • Line 923: warning: cyclomatic complexity 49 of function (*dbBase).ReadBatch() is high (> 15) (gocyclo)
    • Line 1616: warning: cyclomatic complexity 30 of function (*dbBase).ReadValues() is high (> 15) (gocyclo)
    • Line 725: warning: cyclomatic complexity 22 of function (*dbBase).UpdateBatch() is high (> 15) (gocyclo)
    • Line 501: warning: cyclomatic complexity 20 of function (*dbBase).InsertOrUpdate() is high (> 15) (gocyclo)
    • Line 1179: warning: cyclomatic complexity 17 of function (*dbBase).GenerateOperatorSQL() is high (> 15) (gocyclo)
    • Line 843: warning: cyclomatic complexity 16 of function (*dbBase).DeleteBatch() is high (> 15) (gocyclo)
    • orm/db_utils.go
    • Line 57: warning: cyclomatic complexity 38 of function getFlatParams() is high (> 15) (gocyclo)
    • app.go
    • Line 63: warning: cyclomatic complexity 35 of function (*App).Run() is high (> 15) (gocyclo)
    • templatefunc_test.go
    • Line 247: warning: cyclomatic complexity 26 of function TestParseFormTag() is high (> 15) (gocyclo)
    • Line 112: warning: cyclomatic complexity 19 of function TestParseForm() is high (> 15) (gocyclo)
    • cache/cache_test.go
    • Line 46: warning: cyclomatic complexity 20 of function TestCache() is high (> 15) (gocyclo)
    • Line 123: warning: cyclomatic complexity 18 of function TestFileCache() is high (> 15) (gocyclo)
    • staticfile.go
    • Line 36: warning: cyclomatic complexity 17 of function serverStaticRouter() is high (> 15) (gocyclo)
    • context/input.go
    • Line 469: warning: cyclomatic complexity 16 of function (*BeegoInput).bind() is high (> 15) (gocyclo)
    • orm/orm_raw.go
    • Line 421: warning: cyclomatic complexity 34 of function (*rawSet).QueryRows() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 33 of function (*rawSet).setFieldValue() is high (> 15) (gocyclo)
    • Line 279: warning: cyclomatic complexity 29 of function (*rawSet).QueryRow() is high (> 15) (gocyclo)
    • Line 595: warning: cyclomatic complexity 26 of function (*rawSet).readValues() is high (> 15) (gocyclo)
    • Line 720: warning: cyclomatic complexity 22 of function (*rawSet).queryRowsTo() is high (> 15) (gocyclo)

golint92%

Golint is a linter for Go source code.

    • fs.go
    • Line 9: warning: exported type FileSystem should have comment or be unexported (golint)
    • Line 12: warning: exported method FileSystem.Open should have comment or be unexported (golint)
    • validation/util.go
    • Line 29: warning: exported const LabelTag should have comment (or a comment on this block) or be unexported (golint)
    • validation/validation.go
    • Line 299: warning: comment on exported method Validation.AddError should be of the form "AddError ..." (golint)
    • Line 452: warning: exported method Validation.CanSkipAlso should have comment or be unexported (golint)
    • orm/orm_log.go
    • Line 32: warning: comment on exported var LogFunc should be of the form "LogFunc ..." (golint)
    • logs/es/es.go
    • Line 95: warning: exported type LogDocument should have comment or be unexported (golint)
    • build_info.go
    • Line 18: warning: exported var BuildVersion should have comment or be unexported (golint)
    • orm/utils.go
    • Line 34: warning: exported var SnakeAcronymNameStrategy should have comment or be unexported (golint)
    • logs/log.go
    • Line 336: warning: comment on exported method BeeLogger.SetPrefix should be of the form "SetPrefix ..." (golint)
    • session/session.go
    • Line 84: warning: comment on exported function GetProvider should be of the form "GetProvider ..." (golint)
    • router.go
    • Line 125: warning: exported method ControllerInfo.GetPattern should have comment or be unexported (golint)
    • orm/db_alias.go
    • Line 109: warning: exported type DB should have comment or be unexported (golint)
    • Line 115: warning: exported method DB.Begin should have comment or be unexported (golint)
    • Line 119: warning: exported method DB.BeginTx should have comment or be unexported (golint)
    • Line 155: warning: exported method DB.Prepare should have comment or be unexported (golint)
    • Line 159: warning: exported method DB.PrepareContext should have comment or be unexported (golint)
    • Line 163: warning: exported method DB.Exec should have comment or be unexported (golint)
    • Line 173: warning: exported method DB.ExecContext should have comment or be unexported (golint)
    • Line 183: warning: exported method DB.Query should have comment or be unexported (golint)
    • Line 193: warning: exported method DB.QueryContext should have comment or be unexported (golint)
    • Line 203: warning: exported method DB.QueryRow should have comment or be unexported (golint)
    • Line 214: warning: exported method DB.QueryRowContext should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!