Preparing report...

Report for github.com/DoOR-Team/gorm

A+    Excellent!    Found 30 issues across 52 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!


golint82%

Golint is a linter for Go source code.

    • gorm/callback.go
    • Line 61: warning: exported method Callback.BatchCreate 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 435: warning: comment on exported method DB.BatchCreate should be of the form "BatchCreate ..." (golint)
    • gorm/dialects/postgres/postgres.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported type Hstore should have comment or be unexported (golint)
    • gorm/callback_row_query.go
    • Line 10: warning: exported type RowQueryResult should have comment or be unexported (golint)
    • Line 14: warning: exported type RowsQueryResult should have comment or be unexported (golint)

gocyclo55%

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/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)
    • 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/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/preload_test.go
    • Line 827: warning: cyclomatic complexity 16 of function TestManyToManyPreloadWithMultiPrimaryKeys() 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 18 of function saveAssociationCheck() 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 300: warning: cyclomatic complexity 16 of function (*Association).saveAssociations() is high (> 15) (gocyclo)
    • gorm/callback_query_preload.go
    • Line 12: warning: cyclomatic complexity 21 of function preloadCallback() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 20 of function (*Scope).handleManyToManyPreload() is high (> 15) (gocyclo)
    • gorm/scope.go
    • Line 526: warning: cyclomatic complexity 39 of function (*Scope).buildCondition() is high (> 15) (gocyclo)
    • Line 709: warning: cyclomatic complexity 16 of function (*Scope).whereSQL() 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)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


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!