Preparing report...

Report for github.com/src-d/go-kallax

A+    Excellent!    Found 30 issues across 67 files

Tweet

gofmt98%

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!


gocyclo86%

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.

    • go-kallax/generator/migration.go
    • Line 277: warning: cyclomatic complexity 17 of function (ChangeSet).sorted() is high (> 15) (gocyclo)
    • Line 914: warning: cyclomatic complexity 16 of function (*packageTransformer).transformType() is high (> 15) (gocyclo)
    • go-kallax/types/slices.go
    • Line 760: warning: cyclomatic complexity 34 of function parseArray() is high (> 15) (gocyclo)
    • Line 38: warning: cyclomatic complexity 22 of function Slice() is high (> 15) (gocyclo)

golint65%

Golint is a linter for Go source code.

    • go-kallax/generator/cli/kallax/cmd/migrate.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 15: warning: exported var Migrate should have comment or be unexported (golint)
    • Line 60: warning: exported var Up should have comment or be unexported (golint)
    • Line 70: warning: exported var Down should have comment or be unexported (golint)
    • go-kallax/benchmarks/kallax.go
    • Line 1: warning: package comment should be of the form "Package benchmark ..." (golint)
    • Line 487: warning: exported method PersonQuery.WithPets should have comment or be unexported (golint)
    • Line 1059: warning: exported var Schema should have comment or be unexported (golint)
    • go-kallax/schema.go
    • Line 59: warning: exported method BaseSchema.Alias should have comment or be unexported (golint)
    • Line 60: warning: exported method BaseSchema.Table should have comment or be unexported (golint)
    • Line 61: warning: exported method BaseSchema.ID should have comment or be unexported (golint)
    • Line 62: warning: exported method BaseSchema.Columns should have comment or be unexported (golint)
    • Line 63: warning: exported method BaseSchema.ForeignKey should have comment or be unexported (golint)
    • Line 67: warning: exported method BaseSchema.WithAlias should have comment or be unexported (golint)
    • Line 70: warning: exported method BaseSchema.New should have comment or be unexported (golint)
    • Line 113: warning: exported method BaseSchemaField.QualifiedName should have comment or be unexported (golint)
    • Line 173: warning: exported method JSONSchemaArray.QualifiedName should have comment or be unexported (golint)
    • Line 186: warning: exported method JSONSchemaKey.QualifiedName should have comment or be unexported (golint)
    • go-kallax/types/types.go
    • Line 713: warning: exported method URL.Scan should have comment or be unexported (golint)
    • Line 729: warning: exported method URL.Value should have comment or be unexported (golint)
    • go-kallax/generator/migration.go
    • Line 59: warning: exported method DBSchema.MarshalText should have comment or be unexported (golint)
    • Line 127: warning: comment on exported method TableSchema.Column should be of the form "Column ..." (golint)
    • Line 137: warning: exported method TableSchema.Equals should have comment or be unexported (golint)
    • Line 168: warning: exported method ColumnSchema.Equals should have comment or be unexported (golint)
    • Line 207: warning: exported const ByteaColumn should have comment (or a comment on this block) or be unexported (golint)
    • Line 223: warning: exported function NumericColumn should have comment or be unexported (golint)
    • Line 227: warning: exported function DecimalColumn should have comment or be unexported (golint)
    • Line 231: warning: exported function ArrayColumn should have comment or be unexported (golint)
    • Line 249: warning: exported method Reference.Equals should have comment or be unexported (golint)
    • Line 347: warning: exported method ChangeSet.MarshalText should have comment or be unexported (golint)
    • Line 397: warning: exported method CreateTable.Reverse should have comment or be unexported (golint)
    • Line 401: warning: exported method CreateTable.MarshalText should have comment or be unexported (golint)
    • Line 419: warning: exported method DropTable.Reverse should have comment or be unexported (golint)
    • Line 423: warning: exported method DropTable.MarshalText should have comment or be unexported (golint)
    • Line 439: warning: exported method AddColumn.Reverse should have comment or be unexported (golint)
    • Line 450: warning: exported method AddColumn.MarshalText should have comment or be unexported (golint)
    • Line 462: warning: exported method DropColumn.Reverse should have comment or be unexported (golint)
    • Line 473: warning: exported method DropColumn.MarshalText should have comment or be unexported (golint)
    • Line 487: warning: exported method CreateIndex.Reverse should have comment or be unexported (golint)
    • Line 499: warning: exported method CreateIndex.MarshalText should have comment or be unexported (golint)
    • Line 524: warning: exported method DropIndex.Reverse should have comment or be unexported (golint)
    • Line 536: warning: exported method DropIndex.MarshalText should have comment or be unexported (golint)
    • Line 546: warning: exported method ManualChange.Reverse should have comment or be unexported (golint)
    • Line 554: warning: exported method ManualChange.MarshalText should have comment or be unexported (golint)
    • go-kallax/tests/events.go
    • Line 5: warning: exported type EventsFixture should have comment or be unexported (golint)
    • Line 20: warning: exported method EventsFixture.BeforeInsert should have comment or be unexported (golint)
    • Line 29: warning: exported method EventsFixture.AfterInsert should have comment or be unexported (golint)
    • Line 38: warning: exported method EventsFixture.BeforeUpdate should have comment or be unexported (golint)
    • Line 47: warning: exported method EventsFixture.AfterUpdate should have comment or be unexported (golint)
    • Line 56: warning: exported type EventsSaveFixture should have comment or be unexported (golint)
    • Line 71: warning: exported method EventsSaveFixture.BeforeSave should have comment or be unexported (golint)
    • Line 80: warning: exported method EventsSaveFixture.AfterSave should have comment or be unexported (golint)
    • Line 89: warning: exported type EventsAllFixture should have comment or be unexported (golint)
    • Line 104: warning: exported method EventsAllFixture.BeforeInsert should have comment or be unexported (golint)
    • Line 113: warning: exported method EventsAllFixture.AfterInsert should have comment or be unexported (golint)
    • Line 122: warning: exported method EventsAllFixture.BeforeUpdate should have comment or be unexported (golint)
    • Line 131: warning: exported method EventsAllFixture.AfterUpdate should have comment or be unexported (golint)
    • Line 140: warning: exported method EventsAllFixture.BeforeSave should have comment or be unexported (golint)
    • Line 149: warning: exported method EventsAllFixture.AfterSave should have comment or be unexported (golint)
    • go-kallax/tests/query.go
    • Line 11: warning: exported type QueryFixture should have comment or be unexported (golint)
    • Line 51: warning: exported type AliasHereString should have comment or be unexported (golint)
    • Line 52: warning: exported type AliasHereArray should have comment or be unexported (golint)
    • Line 53: warning: exported type ScannerValuer should have comment or be unexported (golint)
    • Line 57: warning: exported type AliasID should have comment or be unexported (golint)
    • Line 63: warning: exported method QueryFixture.Eq should have comment or be unexported (golint)
    • Line 67: warning: exported type QueryRelationFixture should have comment or be unexported (golint)
    • go-kallax/tests/store.go
    • Line 9: warning: exported type A should have comment or be unexported (golint)
    • Line 20: warning: exported type B should have comment or be unexported (golint)
    • Line 34: warning: exported type C should have comment or be unexported (golint)
    • Line 47: warning: exported type AliasSliceString should have comment or be unexported (golint)
    • Line 49: warning: exported type StoreFixture should have comment or be unexported (golint)
    • Line 61: warning: exported type StoreWithConstructFixture should have comment or be unexported (golint)
    • Line 74: warning: exported type StoreWithNewFixture should have comment or be unexported (golint)
    • Line 85: warning: exported type MultiKeySortFixture should have comment or be unexported (golint)
    • Line 97: warning: exported type SomeJSON should have comment or be unexported (golint)
    • Line 101: warning: exported type Nullable should have comment or be unexported (golint)
    • Line 109: warning: exported type Parent should have comment or be unexported (golint)
    • Line 116: warning: exported type Child should have comment or be unexported (golint)
    • Line 122: warning: exported type ParentNoPtr should have comment or be unexported (golint)
    • go-kallax/common_test.go
    • Line 154: warning: receiver name m should be consistent with previous receiver name r for rel (golint)
    • Line 166: warning: receiver name m should be consistent with previous receiver name r for rel (golint)
    • Line 178: warning: receiver name m should be consistent with previous receiver name r for rel (golint)
    • Line 182: warning: receiver name m should be consistent with previous receiver name r for rel (golint)
    • go-kallax/tests/fixtures/fixtures.go
    • Line 5: warning: exported type AliasArray should have comment or be unexported (golint)
    • Line 6: warning: exported type AliasSlice should have comment or be unexported (golint)
    • Line 7: warning: exported type AliasString should have comment or be unexported (golint)
    • Line 8: warning: exported type AliasInt should have comment or be unexported (golint)
    • Line 9: warning: exported type AliasArrAliasSlice should have comment or be unexported (golint)
    • Line 10: warning: exported type AliasArrAliasString should have comment or be unexported (golint)
    • Line 11: warning: exported type AliasDummyParam should have comment or be unexported (golint)
    • Line 13: warning: exported type QueryDummy should have comment or be unexported (golint)
    • Line 17: warning: exported type InterfaceImplementation should have comment or be unexported (golint)
    • Line 22: warning: exported type ScannerValuer should have comment or be unexported (golint)
    • Line 24: warning: exported method ScannerValuer.Value should have comment or be unexported (golint)
    • Line 28: warning: exported method ScannerValuer.Scan should have comment or be unexported (golint)
    • go-kallax/benchmarks/models_gorm.go
    • Line 3: warning: exported type GORMPerson should have comment or be unexported (golint)
    • Line 9: warning: exported method GORMPerson.TableName should have comment or be unexported (golint)
    • Line 13: warning: exported type GORMPet should have comment or be unexported (golint)
    • Line 20: warning: exported method GORMPet.TableName should have comment or be unexported (golint)
    • go-kallax/benchmarks/models_kallax.go
    • Line 5: warning: exported type Person should have comment or be unexported (golint)
    • Line 12: warning: exported type Pet should have comment or be unexported (golint)
    • Line 19: warning: exported type PetKind should have comment or be unexported (golint)
    • Line 22: warning: exported const Cat should have comment (or a comment on this block) or be unexported (golint)
    • go-kallax/tests/relationships.go
    • Line 5: warning: exported type Car should have comment or be unexported (golint)
    • Line 14: warning: exported type Brand should have comment or be unexported (golint)
    • Line 26: warning: exported method Car.BeforeSave should have comment or be unexported (golint)
    • Line 32: warning: exported method Car.AfterSave should have comment or be unexported (golint)
    • Line 38: warning: exported method Car.BeforeDelete should have comment or be unexported (golint)
    • Line 44: warning: exported method Car.AfterDelete should have comment or be unexported (golint)
    • Line 50: warning: exported type Person should have comment or be unexported (golint)
    • Line 66: warning: exported method Person.BeforeSave should have comment or be unexported (golint)
    • Line 72: warning: exported method Person.AfterSave should have comment or be unexported (golint)
    • Line 78: warning: exported method Person.BeforeDelete should have comment or be unexported (golint)
    • Line 84: warning: exported method Person.AfterDelete should have comment or be unexported (golint)
    • Line 90: warning: exported type Pet should have comment or be unexported (golint)
    • Line 105: warning: exported method Pet.BeforeSave should have comment or be unexported (golint)
    • Line 111: warning: exported method Pet.AfterSave should have comment or be unexported (golint)
    • Line 117: warning: exported method Pet.BeforeDelete should have comment or be unexported (golint)
    • Line 123: warning: exported method Pet.AfterDelete should have comment or be unexported (golint)
    • go-kallax/tests/schema.go
    • Line 5: warning: exported type SchemaFixture should have comment or be unexported (golint)
    • Line 23: warning: exported type SchemaRelationshipFixture should have comment or be unexported (golint)
    • go-kallax/tests/json.go
    • Line 5: warning: exported type JSONModel should have comment or be unexported (golint)
    • Line 14: warning: exported type Bar should have comment or be unexported (golint)
    • Line 19: warning: exported type Baz should have comment or be unexported (golint)
    • Line 23: warning: exported type Qux should have comment or be unexported (golint)
    • go-kallax/model.go
    • Line 188: warning: exported var ErrEmptyVirtualColumn should have comment or be unexported (golint)
    • Line 281: warning: receiver name u should be consistent with previous receiver name id for ULID (golint)
    • Line 331: warning: exported method ULID.MarshalText should have comment or be unexported (golint)
    • go-kallax/generator/template.go
    • Line 49: warning: exported method TemplateData.GenTimeTruncations should have comment or be unexported (golint)
    • Line 127: warning: exported method TemplateData.IdentifierType should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words