Preparing report...

Report for github.com/avatardev/gorm

(v1.9.14)

A+    Excellent!    Found 30 issues across 53 files

Tweet

gofmt96%

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!


gocyclo54%

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.

    • multi_primary_keys_test.go
    • Line 238: warning: cyclomatic complexity 26 of function TestManyToManyWithCustomizedForeignKeys2() is high (> 15) (gocyclo)
    • Line 121: warning: cyclomatic complexity 20 of function TestManyToManyWithCustomizedForeignKeys() is high (> 15) (gocyclo)
    • association.go
    • Line 130: warning: cyclomatic complexity 24 of function (*Association).Delete() is high (> 15) (gocyclo)
    • Line 36: warning: cyclomatic complexity 20 of function (*Association).Replace() is high (> 15) (gocyclo)
    • Line 301: warning: cyclomatic complexity 16 of function (*Association).saveAssociations() is high (> 15) (gocyclo)
    • pointer_test.go
    • Line 17: warning: cyclomatic complexity 20 of function TestPointerFields() is high (> 15) (gocyclo)
    • dialect_common.go
    • Line 50: warning: cyclomatic complexity 18 of function (*commonDialect).DataTypeOf() is high (> 15) (gocyclo)
    • query_test.go
    • Line 707: warning: cyclomatic complexity 28 of function TestFindOrCreate() is high (> 15) (gocyclo)
    • Line 663: warning: cyclomatic complexity 24 of function TestFindOrInitialize() is high (> 15) (gocyclo)
    • callback_save.go
    • Line 98: warning: cyclomatic complexity 28 of function saveAfterAssociationsCallback() is high (> 15) (gocyclo)
    • Line 16: warning: cyclomatic complexity 16 of function saveAssociationCheck() is high (> 15) (gocyclo)
    • preload_test.go
    • Line 853: warning: cyclomatic complexity 16 of function TestManyToManyPreloadWithMultiPrimaryKeys() is high (> 15) (gocyclo)
    • callback_query_preload.go
    • Line 12: warning: cyclomatic complexity 22 of function preloadCallback() is high (> 15) (gocyclo)
    • Line 286: warning: cyclomatic complexity 21 of function (*Scope).handleManyToManyPreload() is high (> 15) (gocyclo)
    • association_test.go
    • Line 13: warning: cyclomatic complexity 32 of function TestBelongsTo() is high (> 15) (gocyclo)
    • Line 226: warning: cyclomatic complexity 25 of function TestHasOne() is high (> 15) (gocyclo)
    • Line 597: warning: cyclomatic complexity 25 of function TestManyToMany() is high (> 15) (gocyclo)
    • Line 415: warning: cyclomatic complexity 22 of function TestHasMany() is high (> 15) (gocyclo)
    • Line 725: warning: cyclomatic complexity 18 of function TestRelated() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 17 of function TestForeignKey() is high (> 15) (gocyclo)
    • polymorphic_test.go
    • Line 45: warning: cyclomatic complexity 32 of function TestPolymorphic() is high (> 15) (gocyclo)
    • Line 228: warning: cyclomatic complexity 28 of function TestNamedPolymorphic() is high (> 15) (gocyclo)
    • dialect_mysql.go
    • Line 33: warning: cyclomatic complexity 32 of function (*mysql).DataTypeOf() is high (> 15) (gocyclo)
    • naming.go
    • Line 71: warning: cyclomatic complexity 16 of function defaultNamer() is high (> 15) (gocyclo)
    • main_test.go
    • Line 320: warning: cyclomatic complexity 16 of function TestNullValues() is high (> 15) (gocyclo)
    • model_struct.go
    • Line 154: warning: cyclomatic complexity 114 of function (*Scope).GetModelStruct() is high (> 15) (gocyclo)
    • scope.go
    • Line 528: warning: cyclomatic complexity 37 of function (*Scope).buildCondition() is high (> 15) (gocyclo)
    • Line 711: warning: cyclomatic complexity 16 of function (*Scope).whereSQL() is high (> 15) (gocyclo)
    • Line 1326: warning: cyclomatic complexity 16 of function (*Scope).getColumnAsArray() is high (> 15) (gocyclo)
    • logger.go
    • Line 32: warning: cyclomatic complexity 18 of function LogFormatter() is high (> 15) (gocyclo)
    • callback.go
    • Line 161: warning: cyclomatic complexity 17 of function sortProcessors() is high (> 15) (gocyclo)

golint86%

Golint is a linter for Go source code.

    • dialects/postgres/postgres.go
    • Line 11: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported type Hstore should have comment or be unexported (golint)
    • callback_row_query.go
    • Line 13: warning: exported type RowQueryResult should have comment or be unexported (golint)
    • Line 17: warning: exported type RowsQueryResult should have comment or be unexported (golint)
    • logger.go
    • Line 32: warning: exported var LogFormatter should have comment or be unexported (golint)
    • Line 142: warning: exported method Logger.GetSQL should have comment or be unexported (golint)
    • utils.go
    • Line 60: warning: comment on exported type SqlExpr should be of the form "SqlExpr ..." (with optional leading article) (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!