Preparing report...

Report for github.com/hidevopsio/gorm

A    Great!    Found 34 issues across 52 files

Tweet

gofmt88%

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/fake.go
    • Line 24: warning: exported type Mocker should have comment or be unexported (golint)
    • Line 29: warning: comment on exported type FakeRepository should be of the form "FakeRepository ..." (with optional leading article) (golint)
    • Line 64: warning: comment on exported method FakeRepository.SqlDB should be of the form "SqlDB ..." (golint)
    • Line 208: warning: exported method FakeRepository.Scopes should have comment or be unexported (golint)
    • Line 518: warning: exported method FakeRepository.Value should have comment or be unexported (golint)
    • Line 522: warning: exported method FakeRepository.SetValue should have comment or be unexported (golint)
    • Line 531: warning: exported method FakeRepository.SetError should have comment or be unexported (golint)
    • Line 536: warning: exported method FakeRepository.RowsAffected should have comment or be unexported (golint)
    • Line 540: warning: exported method FakeRepository.SetRowsAffected should have comment or be unexported (golint)
    • Line 545: warning: exported method FakeRepository.Search should have comment or be unexported (golint)
    • Line 549: warning: exported method FakeRepository.SetSearch should have comment or be unexported (golint)
    • Line 554: warning: exported method FakeRepository.Parent should have comment or be unexported (golint)
    • Line 558: warning: exported method FakeRepository.SetParent should have comment or be unexported (golint)
    • Line 563: warning: exported method FakeRepository.SQLCommonDB should have comment or be unexported (golint)
    • Line 567: warning: exported method FakeRepository.SetSQLCommonDB should have comment or be unexported (golint)
    • Line 572: warning: exported method FakeRepository.Callbacks should have comment or be unexported (golint)
    • Line 576: warning: exported method FakeRepository.SetCallbacks should have comment or be unexported (golint)
    • Line 581: warning: exported method FakeRepository.IsSingularTable should have comment or be unexported (golint)
    • Line 585: warning: exported method FakeRepository.SetIsSingularTable should have comment or be unexported (golint)
    • Line 589: warning: exported method FakeRepository.Values should have comment or be unexported (golint)
    • Line 593: warning: exported method FakeRepository.SetValues should have comment or be unexported (golint)
    • Line 598: warning: exported method FakeRepository.SetDialect should have comment or be unexported (golint)
    • Line 607: warning: exported method FakeRepository.Clone should have comment or be unexported (golint)
    • Line 634: warning: exported method FakeRepository.Print should have comment or be unexported (golint)
    • Line 638: warning: exported method FakeRepository.Log should have comment or be unexported (golint)
    • Line 644: warning: exported method FakeRepository.Slog should have comment or be unexported (golint)
    • Line 650: warning: exported method FakeRepository.Mock should have comment or be unexported (golint)
    • Line 659: warning: exported method FakeRepository.Expect should have comment or be unexported (golint)
    • gorm/logger.go
    • Line 30: warning: exported var LogFormatter should have comment or be unexported (golint)
    • Line 102: warning: exported type Logger should have comment or be unexported (golint)
    • gorm/main.go
    • Line 12: warning: exported type Repository should have comment or be unexported (golint)
    • gorm/search.go
    • Line 7: warning: exported type Search should have comment or be unexported (golint)
    • Line 39: warning: exported method Search.Where should have comment or be unexported (golint)
    • Line 44: warning: exported method Search.Not should have comment or be unexported (golint)
    • Line 49: warning: exported method Search.Or should have comment or be unexported (golint)
    • Line 54: warning: exported method Search.Attrs should have comment or be unexported (golint)
    • Line 59: warning: exported method Search.Assign should have comment or be unexported (golint)
    • Line 64: warning: exported method Search.Order should have comment or be unexported (golint)
    • Line 75: warning: exported method Search.Select should have comment or be unexported (golint)
    • Line 80: warning: exported method Search.Omit should have comment or be unexported (golint)
    • Line 85: warning: exported method Search.Limit should have comment or be unexported (golint)
    • Line 90: warning: exported method Search.Offset should have comment or be unexported (golint)
    • Line 95: warning: exported method Search.Group should have comment or be unexported (golint)
    • Line 100: warning: exported method Search.Having should have comment or be unexported (golint)
    • Line 109: warning: exported method Search.Joins should have comment or be unexported (golint)
    • Line 114: warning: exported method Search.Preload should have comment or be unexported (golint)
    • Line 126: warning: exported method Search.Raw should have comment or be unexported (golint)
    • Line 136: warning: exported method Search.Table should have comment or be unexported (golint)
    • gorm/utils.go
    • Line 121: warning: comment on exported type Expression should be of the form "Expression ..." (with optional leading article) (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/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/utils.go
    • Line 71: warning: cyclomatic complexity 16 of function ToDBName() 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_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)
    • gorm/association.go
    • Line 134: warning: cyclomatic complexity 24 of function (*Association).Delete() is high (> 15) (gocyclo)
    • Line 40: warning: cyclomatic complexity 20 of function (*Association).Replace() is high (> 15) (gocyclo)
    • Line 304: 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/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/preload_test.go
    • Line 827: warning: cyclomatic complexity 16 of function TestManyToManyPreloadWithMultiPrimaryKeys() 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!