Preparing report...

Report for github.com/go-various/xorm

(v0.0.0-20220126094347-50de33934412)

A+    Excellent!    Found 56 issues across 150 files

Tweet

gofmt84%

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!


golint88%

Golint is a linter for Go source code.

    • dialects/dameng.go
    • Line 752: warning: context.Context should be the first parameter of a function (golint)
    • Line 776: warning: context.Context should be the first parameter of a function (golint)
    • Line 843: warning: context.Context should be the first parameter of a function (golint)
    • Line 995: warning: context.Context should be the first parameter of a function (golint)
    • Line 1021: warning: context.Context should be the first parameter of a function (golint)
    • session_pageable.go
    • Line 8: warning: exported var ErrPageableCannotBeNil should have comment or be unexported (golint)
    • Line 10: warning: exported method Session.FindPagination should have comment or be unexported (golint)
    • engine.go
    • Line 53: warning: exported method Engine.FindPagination should have comment or be unexported (golint)
    • engine_plus.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: exported var ErrInitEngine should have comment or be unexported (golint)
    • Line 12: warning: exported function NewEnginePlus should have comment or be unexported (golint)
    • integrations/session_schema_test.go
    • Line 331: warning: don't use underscores in Go names; struct field From_url should be FromURL (golint)
    • Line 332: warning: don't use underscores in Go names; struct field Pre_url should be PreURL (golint)
    • Line 419: warning: don't use underscores in Go names; struct field Passport_user_type should be PassportUserType (golint)
    • Line 420: warning: don't use underscores in Go names; struct field Id_delete should be IDDelete (golint)
    • dialects/mssql.go
    • Line 441: warning: context.Context should be the first parameter of a function (golint)
    • Line 447: warning: context.Context should be the first parameter of a function (golint)
    • Line 452: warning: context.Context should be the first parameter of a function (golint)
    • Line 542: warning: context.Context should be the first parameter of a function (golint)
    • Line 569: warning: context.Context should be the first parameter of a function (golint)
    • dialects/mysql.go
    • Line 378: warning: context.Context should be the first parameter of a function (golint)
    • Line 393: warning: context.Context should be the first parameter of a function (golint)
    • Line 520: warning: context.Context should be the first parameter of a function (golint)
    • Line 571: warning: context.Context should be the first parameter of a function (golint)
    • dialects/oracle.go
    • Line 664: warning: context.Context should be the first parameter of a function (golint)
    • Line 668: warning: context.Context should be the first parameter of a function (golint)
    • Line 675: warning: context.Context should be the first parameter of a function (golint)
    • Line 775: warning: context.Context should be the first parameter of a function (golint)
    • Line 801: warning: context.Context should be the first parameter of a function (golint)
    • dialects/sqlite3.go
    • Line 275: warning: context.Context should be the first parameter of a function (golint)
    • Line 298: warning: context.Context should be the first parameter of a function (golint)
    • Line 382: warning: context.Context should be the first parameter of a function (golint)
    • Line 441: warning: context.Context should be the first parameter of a function (golint)
    • Line 469: warning: context.Context should be the first parameter of a function (golint)
    • pageable/pageable.go
    • Line 31: warning: exported function NewPageable should have comment or be unexported (golint)
    • Line 35: warning: exported function DefaultPageable should have comment or be unexported (golint)
    • dialects/dialect.go
    • Line 157: warning: exported method Base.CreateSequenceSQL should have comment or be unexported (golint)
    • Line 167: warning: exported method Base.IsSequenceExist should have comment or be unexported (golint)
    • Line 171: warning: exported method Base.DropSequenceSQL should have comment or be unexported (golint)
    • Line 182: warning: context.Context should be the first parameter of a function (golint)
    • Line 196: warning: context.Context should be the first parameter of a function (golint)
    • dialects/time.go
    • Line 53: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • dialects/postgres.go
    • Line 985: warning: context.Context should be the first parameter of a function (golint)
    • Line 1047: warning: context.Context should be the first parameter of a function (golint)
    • Line 1069: warning: context.Context should be the first parameter of a function (golint)
    • Line 1222: warning: context.Context should be the first parameter of a function (golint)
    • Line 1265: warning: context.Context should be the first parameter of a function (golint)

gocyclo78%

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.

    • dialects/mysql.go
    • Line 393: warning: cyclomatic complexity 31 of function (*mysql).GetColumns() is high (> 15) (gocyclo)
    • Line 260: warning: cyclomatic complexity 24 of function (*mysql).SQLType() is high (> 15) (gocyclo)
    • engine.go
    • Line 463: warning: cyclomatic complexity 114 of function (*Engine).dumpTables() is high (> 15) (gocyclo)
    • session_update.go
    • Line 151: warning: cyclomatic complexity 81 of function (*Session).Update() is high (> 15) (gocyclo)
    • Line 26: warning: cyclomatic complexity 27 of function (*Session).cacheUpdate() is high (> 15) (gocyclo)
    • Line 480: warning: cyclomatic complexity 27 of function (*Session).genUpdateColumns() is high (> 15) (gocyclo)
    • internal/statements/query.go
    • Line 240: warning: cyclomatic complexity 34 of function (*Statement).genSelectSQL() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 16 of function (*Statement).GenExistSQL() is high (> 15) (gocyclo)
    • scan.go
    • Line 74: warning: cyclomatic complexity 19 of function genScanResultsByBean() is high (> 15) (gocyclo)
    • Line 21: warning: cyclomatic complexity 19 of function genScanResultsByBeanNullable() is high (> 15) (gocyclo)
    • internal/statements/insert.go
    • Line 30: warning: cyclomatic complexity 48 of function (*Statement).GenInsertSQL() is high (> 15) (gocyclo)
    • Line 184: warning: cyclomatic complexity 17 of function (*Statement).GenInsertMapSQL() is high (> 15) (gocyclo)
    • tags/parser.go
    • Line 179: warning: cyclomatic complexity 23 of function (*Parser).parseFieldWithTags() is high (> 15) (gocyclo)
    • convert/conversion.go
    • Line 48: warning: cyclomatic complexity 93 of function Assign() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 19 of function AssignValue() is high (> 15) (gocyclo)
    • session_schema.go
    • Line 254: warning: cyclomatic complexity 60 of function (*Session).Sync() is high (> 15) (gocyclo)
    • Line 480: warning: cyclomatic complexity 17 of function (*Session).Import() is high (> 15) (gocyclo)
    • session_insert.go
    • Line 261: warning: cyclomatic complexity 51 of function (*Session).insertStruct() is high (> 15) (gocyclo)
    • Line 68: warning: cyclomatic complexity 41 of function (*Session).insertMultipleStruct() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 24 of function (*Session).genInsertColumns() is high (> 15) (gocyclo)
    • session_find.go
    • Line 274: warning: cyclomatic complexity 44 of function (*Session).cacheFind() is high (> 15) (gocyclo)
    • Line 81: warning: cyclomatic complexity 27 of function (*Session).find() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 22 of function (*Session).noCacheFind() is high (> 15) (gocyclo)
    • dialects/mssql.go
    • Line 291: warning: cyclomatic complexity 31 of function (*mssql).SQLType() is high (> 15) (gocyclo)
    • Line 452: warning: cyclomatic complexity 16 of function (*mssql).GetColumns() is high (> 15) (gocyclo)
    • tags/tag.go
    • Line 22: warning: cyclomatic complexity 22 of function splitTag() is high (> 15) (gocyclo)
    • convert/int.go
    • Line 16: warning: cyclomatic complexity 20 of function AsInt64() is high (> 15) (gocyclo)
    • Line 65: warning: cyclomatic complexity 20 of function AsUint64() is high (> 15) (gocyclo)
    • internal/statements/update.go
    • Line 65: warning: cyclomatic complexity 80 of function (*Statement).BuildUpdates() is high (> 15) (gocyclo)
    • Line 21: warning: cyclomatic complexity 18 of function (*Statement).ifAddColUpdate() is high (> 15) (gocyclo)
    • dialects/dameng.go
    • Line 843: warning: cyclomatic complexity 32 of function (*dameng).GetColumns() is high (> 15) (gocyclo)
    • Line 569: warning: cyclomatic complexity 23 of function (*dameng).SQLType() is high (> 15) (gocyclo)
    • Line 666: warning: cyclomatic complexity 20 of function (*dameng).CreateTableSQL() is high (> 15) (gocyclo)
    • convert/float.go
    • Line 67: warning: cyclomatic complexity 23 of function AsBigFloat() is high (> 15) (gocyclo)
    • Line 16: warning: cyclomatic complexity 21 of function AsFloat64() is high (> 15) (gocyclo)
    • session_delete.go
    • Line 92: warning: cyclomatic complexity 42 of function (*Session).Delete() is high (> 15) (gocyclo)
    • Line 24: warning: cyclomatic complexity 17 of function (*Session).cacheDelete() is high (> 15) (gocyclo)
    • dialects/postgres.go
    • Line 1069: warning: cyclomatic complexity 35 of function (*postgres).GetColumns() is high (> 15) (gocyclo)
    • Line 1389: warning: cyclomatic complexity 25 of function parseOpts() is high (> 15) (gocyclo)
    • Line 879: warning: cyclomatic complexity 22 of function (*postgres).SQLType() is high (> 15) (gocyclo)
    • Line 1265: warning: cyclomatic complexity 17 of function (*postgres).GetIndexes() is high (> 15) (gocyclo)
    • session_get.go
    • Line 50: warning: cyclomatic complexity 25 of function (*Session).get() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 19 of function (*Session).cacheGet() is high (> 15) (gocyclo)
    • internal/statements/statement.go
    • Line 678: warning: cyclomatic complexity 54 of function (*Statement).asDBCond() is high (> 15) (gocyclo)
    • Line 814: warning: cyclomatic complexity 28 of function (*Statement).buildConds2() is high (> 15) (gocyclo)
    • session.go
    • Line 537: warning: cyclomatic complexity 42 of function (*Session).convertBeanField() is high (> 15) (gocyclo)
    • Line 499: warning: cyclomatic complexity 16 of function asKind() is high (> 15) (gocyclo)
    • convert/time.go
    • Line 18: warning: cyclomatic complexity 23 of function String2Time() is high (> 15) (gocyclo)
    • Line 72: warning: cyclomatic complexity 22 of function AsTime() is high (> 15) (gocyclo)

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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!