Preparing report...

Report for github.com/go-xorm/xorm

A    Great!    Found 42 issues across 102 files

Tweet

gofmt87%

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!


golint89%

Golint is a linter for Go source code.

    • xorm/session_schema_test.go
    • Line 176: warning: don't use underscores in Go names; struct field From_url should be FromURL (golint)
    • Line 177: warning: don't use underscores in Go names; struct field Pre_url should be PreURL (golint)
    • Line 278: warning: don't use underscores in Go names; struct field Passport_user_type should be PassportUserType (golint)
    • Line 279: warning: don't use underscores in Go names; struct field Id_delete should be IDDelete (golint)
    • xorm/types_test.go
    • Line 285: 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)
    • xorm/session_update_test.go
    • Line 437: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 455: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 479: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 486: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 524: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 531: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 811: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 826: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 848: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 855: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 880: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 887: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • xorm/cache_memory_store_test.go
    • Line 28: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 33: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • xorm/convert.go
    • Line 28: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • xorm/engine.go
    • Line 66: warning: exported method Engine.SetCacher should have comment or be unexported (golint)
    • Line 82: warning: exported method Engine.GetCacher should have comment or be unexported (golint)
    • Line 215: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • xorm/engine_group_policy.go
    • Line 54: warning: exported function RoundRobinPolicy should have comment or be unexported (golint)
    • Line 71: warning: exported function WeightRoundRobinPolicy should have comment or be unexported (golint)
    • xorm/tag_version_test.go
    • Line 59: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 173: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)

gocyclo74%

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.

    • xorm/session_insert.go
    • Line 323: warning: cyclomatic complexity 82 of function (*Session).innerInsert() is high (> 15) (gocyclo)
    • Line 100: warning: cyclomatic complexity 49 of function (*Session).innerInsertMulti() is high (> 15) (gocyclo)
    • Line 618: warning: cyclomatic complexity 29 of function (*Session).genInsertColumns() is high (> 15) (gocyclo)
    • Line 20: warning: cyclomatic complexity 21 of function (*Session).Insert() is high (> 15) (gocyclo)
    • Line 708: warning: cyclomatic complexity 20 of function (*Session).insertMapInterface() is high (> 15) (gocyclo)
    • Line 794: warning: cyclomatic complexity 20 of function (*Session).insertMapString() is high (> 15) (gocyclo)
    • xorm/session_get.go
    • Line 102: warning: cyclomatic complexity 50 of function (*Session).nocacheGet() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 19 of function (*Session).get() is high (> 15) (gocyclo)
    • Line 267: warning: cyclomatic complexity 18 of function (*Session).cacheGet() is high (> 15) (gocyclo)
    • xorm/session_update_test.go
    • Line 280: warning: cyclomatic complexity 34 of function TestUpdate1() is high (> 15) (gocyclo)
    • Line 602: warning: cyclomatic complexity 25 of function TestUpdateUpdated() is high (> 15) (gocyclo)
    • xorm/helpers.go
    • Line 19: warning: cyclomatic complexity 23 of function str2PKValue() is high (> 15) (gocyclo)
    • Line 122: warning: cyclomatic complexity 16 of function isZero() is high (> 15) (gocyclo)
    • xorm/session.go
    • Line 368: warning: cyclomatic complexity 127 of function (*Session).slice2Bean() is high (> 15) (gocyclo)
    • xorm/session_update.go
    • Line 146: warning: cyclomatic complexity 73 of function (*Session).Update() is high (> 15) (gocyclo)
    • Line 435: warning: cyclomatic complexity 33 of function (*Session).genUpdateColumns() is high (> 15) (gocyclo)
    • Line 18: warning: cyclomatic complexity 27 of function (*Session).cacheUpdate() is high (> 15) (gocyclo)
    • xorm/dialect_postgres.go
    • Line 953: warning: cyclomatic complexity 25 of function (*postgres).GetColumns() is high (> 15) (gocyclo)
    • Line 789: warning: cyclomatic complexity 22 of function (*postgres).SqlType() is high (> 15) (gocyclo)
    • xorm/statement.go
    • Line 231: warning: cyclomatic complexity 88 of function (*Statement).buildUpdates() is high (> 15) (gocyclo)
    • Line 1042: warning: cyclomatic complexity 37 of function (*Statement).genSelectSQL() is high (> 15) (gocyclo)
    • xorm/processors_test.go
    • Line 384: warning: cyclomatic complexity 84 of function TestProcessorsTx() is high (> 15) (gocyclo)
    • Line 124: warning: cyclomatic complexity 50 of function TestProcessors() is high (> 15) (gocyclo)
    • xorm/engine.go
    • Line 899: warning: cyclomatic complexity 42 of function (*Engine).mapType() is high (> 15) (gocyclo)
    • Line 456: warning: cyclomatic complexity 38 of function (*Engine).dumpTables() is high (> 15) (gocyclo)
    • Line 1231: warning: cyclomatic complexity 26 of function (*Engine).Sync() is high (> 15) (gocyclo)
    • xorm/session_find.go
    • Line 323: warning: cyclomatic complexity 40 of function (*Session).cacheFind() is high (> 15) (gocyclo)
    • Line 65: warning: cyclomatic complexity 35 of function (*Session).find() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 23 of function (*Session).noCacheFind() is high (> 15) (gocyclo)
    • xorm/dialect_mysql.go
    • Line 316: warning: cyclomatic complexity 26 of function (*mysql).GetColumns() is high (> 15) (gocyclo)
    • Line 202: warning: cyclomatic complexity 19 of function (*mysql).SqlType() is high (> 15) (gocyclo)
    • xorm/session_pk_test.go
    • Line 700: warning: cyclomatic complexity 21 of function TestCompositeKey() is high (> 15) (gocyclo)
    • Line 531: warning: cyclomatic complexity 16 of function TestUint64Id() is high (> 15) (gocyclo)
    • Line 924: warning: cyclomatic complexity 16 of function TestMyIntId() is high (> 15) (gocyclo)
    • Line 1012: warning: cyclomatic complexity 16 of function TestMyStringId() is high (> 15) (gocyclo)
    • xorm/session_convert.go
    • Line 92: warning: cyclomatic complexity 114 of function (*Session).bytes2Value() is high (> 15) (gocyclo)
    • Line 539: warning: cyclomatic complexity 37 of function (*Session).value2Interface() is high (> 15) (gocyclo)
    • Line 20: warning: cyclomatic complexity 20 of function (*Session).str2Time() is high (> 15) (gocyclo)
    • xorm/session_delete.go
    • Line 77: warning: cyclomatic complexity 38 of function (*Session).Delete() is high (> 15) (gocyclo)
    • Line 15: warning: cyclomatic complexity 16 of function (*Session).cacheDelete() is high (> 15) (gocyclo)
    • xorm/convert.go
    • Line 80: warning: cyclomatic complexity 47 of function convertAssign() is high (> 15) (gocyclo)

ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (exit status 2)


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)