Preparing report...

Report for github.com/edwardhey/gorm

A+    Excellent!    Found 32 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!


gocyclo56%

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.

    • gorm/preload_test.go
    • Line 853: warning: cyclomatic complexity 16 of function TestManyToManyPreloadWithMultiPrimaryKeys() is high (> 15) (gocyclo)
    • gorm/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)
    • gorm/callback_save.go
    • Line 98: warning: cyclomatic complexity 29 of function saveAfterAssociationsCallback() is high (> 15) (gocyclo)
    • Line 16: warning: cyclomatic complexity 16 of function saveAssociationCheck() is high (> 15) (gocyclo)
    • gorm/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)
    • gorm/query_test.go
    • Line 639: warning: cyclomatic complexity 28 of function TestFindOrCreate() is high (> 15) (gocyclo)
    • Line 595: warning: cyclomatic complexity 24 of function TestFindOrInitialize() is high (> 15) (gocyclo)
    • gorm/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)
    • gorm/callback_query_preload.go
    • Line 12: warning: cyclomatic complexity 23 of function preloadCallback() is high (> 15) (gocyclo)
    • Line 286: warning: cyclomatic complexity 21 of function (*Scope).handleManyToManyPreload() is high (> 15) (gocyclo)
    • gorm/naming.go
    • Line 71: warning: cyclomatic complexity 16 of function defaultNamer() is high (> 15) (gocyclo)
    • gorm/scope.go
    • Line 528: warning: cyclomatic complexity 39 of function (*Scope).buildCondition() is high (> 15) (gocyclo)
    • Line 711: warning: cyclomatic complexity 16 of function (*Scope).whereSQL() is high (> 15) (gocyclo)
    • Line 1328: warning: cyclomatic complexity 16 of function (*Scope).getColumnAsArray() is high (> 15) (gocyclo)
    • gorm/association_test.go
    • Line 13: warning: cyclomatic complexity 32 of function TestBelongsTo() is high (> 15) (gocyclo)
    • Line 597: warning: cyclomatic complexity 25 of function TestManyToMany() is high (> 15) (gocyclo)
    • Line 226: warning: cyclomatic complexity 25 of function TestHasOne() 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)

golint84%

Golint is a linter for Go source code.

    • gorm/utils.go
    • Line 60: warning: comment on exported type SqlExpr should be of the form "SqlExpr ..." (with optional leading article) (golint)
    • gorm/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)
    • gorm/errors.go
    • Line 19: warning: comment on exported var ErrInvalidXATransaction should be of the form "ErrInvalidXATransaction ..." (golint)
    • Line 21: warning: exported var ErrXAMissingXID should have comment or be unexported (golint)
    • gorm/logger.go
    • Line 30: warning: exported var LogFormatter should have comment or be unexported (golint)
    • gorm/main.go
    • Line 871: warning: exported method DB.XAStart should have comment or be unexported (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!