Preparing report...

Report for github.com/noprom/migrate

(v3.5.4+incompatible)

A    Great!    Found 37 issues across 74 files

Tweet

gofmt78%

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!


gocyclo95%

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.

    • cli/main.go
    • Line 23: warning: cyclomatic complexity 38 of function main() is high (> 15) (gocyclo)
    • migrate.go
    • Line 393: warning: cyclomatic complexity 22 of function (*Migrate).read() is high (> 15) (gocyclo)
    • Line 597: warning: cyclomatic complexity 19 of function (*Migrate).readDown() is high (> 15) (gocyclo)
    • Line 505: warning: cyclomatic complexity 19 of function (*Migrate).readUp() is high (> 15) (gocyclo)

golint70%

Golint is a linter for Go source code.

    • database/driver.go
    • Line 15: warning: exported var ErrLocked should have comment or be unexported (golint)
    • Line 18: warning: exported const NilVersion should have comment or be unexported (golint)
    • source/godoc_vfs/vfs.go
    • Line 1: warning: package comment should be of the form "Package godoc_vfs ..." (golint)
    • Line 7: warning: don't use an underscore in package name (golint)
    • Line 101: warning: comment on exported method VFS.Next should be of the form "Next ..." (golint)
    • database/ql/ql.go
    • Line 12: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 21: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrDatabaseDirty should have comment or be unexported (golint)
    • Line 29: warning: exported type Config should have comment or be unexported (golint)
    • Line 34: warning: exported type Ql should have comment or be unexported (golint)
    • Line 41: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 82: warning: exported method Ql.Open should have comment or be unexported (golint)
    • Line 105: warning: exported method Ql.Close should have comment or be unexported (golint)
    • Line 108: warning: exported method Ql.Drop should have comment or be unexported (golint)
    • Line 142: warning: exported method Ql.Lock should have comment or be unexported (golint)
    • Line 149: warning: exported method Ql.Unlock should have comment or be unexported (golint)
    • Line 156: warning: exported method Ql.Run should have comment or be unexported (golint)
    • Line 179: warning: exported method Ql.SetVersion should have comment or be unexported (golint)
    • Line 205: warning: exported method Ql.Version should have comment or be unexported (golint)
    • database/testing/testing.go
    • Line 29: warning: exported function TestNilVersion should have comment or be unexported (golint)
    • Line 39: warning: exported function TestLockAndUnlock should have comment or be unexported (golint)
    • Line 82: warning: exported function TestRun should have comment or be unexported (golint)
    • Line 92: warning: exported function TestDrop should have comment or be unexported (golint)
    • Line 98: warning: exported function TestSetVersion should have comment or be unexported (golint)
    • database/sqlite3/sqlite3.go
    • Line 8: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 19: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 21: warning: exported var ErrDatabaseDirty should have comment or be unexported (golint)
    • Line 26: warning: exported type Config should have comment or be unexported (golint)
    • Line 31: warning: exported type Sqlite should have comment or be unexported (golint)
    • Line 38: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 73: warning: exported method Sqlite.Open should have comment or be unexported (golint)
    • Line 98: warning: exported method Sqlite.Close should have comment or be unexported (golint)
    • Line 102: warning: exported method Sqlite.Drop should have comment or be unexported (golint)
    • Line 140: warning: exported method Sqlite.Lock should have comment or be unexported (golint)
    • Line 148: warning: exported method Sqlite.Unlock should have comment or be unexported (golint)
    • Line 156: warning: exported method Sqlite.Run should have comment or be unexported (golint)
    • Line 181: warning: exported method Sqlite.SetVersion should have comment or be unexported (golint)
    • Line 207: warning: exported method Sqlite.Version should have comment or be unexported (golint)
    • database/postgres/postgres.go
    • Line 26: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 29: warning: exported var ErrNilConfig should have comment or be unexported (golint)
    • Line 35: warning: exported type Config should have comment or be unexported (golint)
    • Line 40: warning: exported type Postgres should have comment or be unexported (golint)
    • Line 50: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 94: warning: exported method Postgres.Open should have comment or be unexported (golint)
    • Line 121: warning: exported method Postgres.Close should have comment or be unexported (golint)
    • Line 130: warning: comment on exported method Postgres.Lock should be of the form "Lock ..." (golint)
    • Line 152: warning: exported method Postgres.Unlock should have comment or be unexported (golint)
    • Line 170: warning: exported method Postgres.Run should have comment or be unexported (golint)
    • Line 238: warning: exported method Postgres.SetVersion should have comment or be unexported (golint)
    • Line 265: warning: exported method Postgres.Version should have comment or be unexported (golint)
    • Line 285: warning: exported method Postgres.Drop should have comment or be unexported (golint)
    • testing/docker.go
    • Line 22: warning: exported function NewDockerContainer should have comment or be unexported (golint)
    • Line 65: warning: exported method DockerContainer.PullImage should have comment or be unexported (golint)
    • Line 90: warning: exported method DockerContainer.Start should have comment or be unexported (golint)
    • Line 129: warning: exported method DockerContainer.KeepForDebugging should have comment or be unexported (golint)
    • Line 137: warning: exported method DockerContainer.Remove should have comment or be unexported (golint)
    • Line 160: warning: exported method DockerContainer.Inspect should have comment or be unexported (golint)
    • Line 178: warning: exported method DockerContainer.Logs should have comment or be unexported (golint)
    • Line 217: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 222: warning: exported method DockerContainer.Host should have comment or be unexported (golint)
    • Line 233: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 238: warning: exported method DockerContainer.Port should have comment or be unexported (golint)
    • Line 249: warning: exported method DockerContainer.PortFor should have comment or be unexported (golint)
    • Line 260: warning: exported method DockerContainer.NetworkSettings should have comment or be unexported (golint)
    • migrate.go
    • Line 28: warning: exported var ErrNoChange should have comment or be unexported (golint)
    • Line 45: warning: exported type ErrDirty should have comment or be unexported (golint)
    • Line 53: warning: exported type Migrate should have comment or be unexported (golint)
    • database/cassandra/cassandra.go
    • Line 22: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 25: warning: exported var ErrNilConfig should have comment or be unexported (golint)
    • Line 31: warning: exported type Config should have comment or be unexported (golint)
    • Line 37: warning: exported type Cassandra should have comment or be unexported (golint)
    • Line 45: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 72: warning: exported method Cassandra.Open should have comment or be unexported (golint)
    • Line 135: warning: exported method Cassandra.Close should have comment or be unexported (golint)
    • Line 140: warning: exported method Cassandra.Lock should have comment or be unexported (golint)
    • Line 148: warning: exported method Cassandra.Unlock should have comment or be unexported (golint)
    • Line 153: warning: exported method Cassandra.Run should have comment or be unexported (golint)
    • Line 185: warning: exported method Cassandra.SetVersion should have comment or be unexported (golint)
    • Line 200: warning: comment on exported method Cassandra.Version should be of the form "Version ..." (golint)
    • Line 219: warning: exported method Cassandra.Drop should have comment or be unexported (golint)
    • database/stub/stub.go
    • Line 15: warning: exported type Stub should have comment or be unexported (golint)
    • Line 27: warning: exported method Stub.Open should have comment or be unexported (golint)
    • Line 36: warning: exported type Config should have comment or be unexported (golint)
    • Line 38: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 47: warning: exported method Stub.Close should have comment or be unexported (golint)
    • Line 51: warning: exported method Stub.Lock should have comment or be unexported (golint)
    • Line 59: warning: exported method Stub.Unlock should have comment or be unexported (golint)
    • Line 64: warning: exported method Stub.Run should have comment or be unexported (golint)
    • Line 74: warning: exported method Stub.SetVersion should have comment or be unexported (golint)
    • Line 80: warning: exported method Stub.Version should have comment or be unexported (golint)
    • Line 84: warning: exported const DROP should have comment or be unexported (golint)
    • Line 86: warning: exported method Stub.Drop should have comment or be unexported (golint)
    • Line 93: warning: exported method Stub.EqualSequence should have comment or be unexported (golint)
    • source/testing/testing.go
    • Line 29: warning: exported function TestFirst should have comment or be unexported (golint)
    • Line 39: warning: exported function TestPrev should have comment or be unexported (golint)
    • Line 68: warning: exported function TestNext should have comment or be unexported (golint)
    • Line 97: warning: exported function TestReadUp should have comment or be unexported (golint)
    • Line 134: warning: exported function TestReadDown should have comment or be unexported (golint)
    • source/stub/stub.go
    • Line 17: warning: exported type Config should have comment or be unexported (golint)
    • Line 22: warning: exported type Stub should have comment or be unexported (golint)
    • Line 29: warning: exported method Stub.Open should have comment or be unexported (golint)
    • Line 37: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 45: warning: exported method Stub.Close should have comment or be unexported (golint)
    • Line 49: warning: exported method Stub.First should have comment or be unexported (golint)
    • Line 52: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 57: warning: exported method Stub.Prev should have comment or be unexported (golint)
    • Line 60: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 65: warning: exported method Stub.Next should have comment or be unexported (golint)
    • Line 68: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 73: warning: exported method Stub.ReadUp should have comment or be unexported (golint)
    • Line 80: warning: exported method Stub.ReadDown should have comment or be unexported (golint)
    • source/migration.go
    • Line 11: warning: exported const Down should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported function NewMigrations should have comment or be unexported (golint)
    • Line 48: warning: exported method Migrations.Append should have comment or be unexported (golint)
    • Line 70: warning: should omit 2nd value from range; this loop is equivalent to `for version := range ...` (golint)
    • Line 76: warning: exported method Migrations.First should have comment or be unexported (golint)
    • Line 83: warning: exported method Migrations.Prev should have comment or be unexported (golint)
    • Line 91: warning: exported method Migrations.Next should have comment or be unexported (golint)
    • Line 99: warning: exported method Migrations.Up should have comment or be unexported (golint)
    • Line 108: warning: exported method Migrations.Down should have comment or be unexported (golint)
    • source/parse.go
    • Line 10: warning: exported var ErrParse should have comment or be unexported (golint)
    • Line 14: warning: exported var DefaultParse should have comment or be unexported (golint)
    • database/clickhouse/clickhouse.go
    • Line 16: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 18: warning: exported var ErrNilConfig should have comment or be unexported (golint)
    • Line 20: warning: exported type Config should have comment or be unexported (golint)
    • Line 30: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 51: warning: exported type ClickHouse should have comment or be unexported (golint)
    • Line 56: warning: exported method ClickHouse.Open should have comment or be unexported (golint)
    • Line 98: warning: exported method ClickHouse.Run should have comment or be unexported (golint)
    • Line 125: warning: exported method ClickHouse.Version should have comment or be unexported (golint)
    • Line 140: warning: exported method ClickHouse.SetVersion should have comment or be unexported (golint)
    • Line 189: warning: exported method ClickHouse.Drop should have comment or be unexported (golint)
    • Line 213: warning: exported method ClickHouse.Lock should have comment or be unexported (golint)
    • Line 214: warning: exported method ClickHouse.Unlock should have comment or be unexported (golint)
    • Line 215: warning: exported method ClickHouse.Close should have comment or be unexported (golint)
    • source/github/github.go
    • Line 23: warning: exported var ErrNoUserInfo should have comment or be unexported (golint)
    • Line 30: warning: exported type Github should have comment or be unexported (golint)
    • Line 41: warning: exported type Config should have comment or be unexported (golint)
    • Line 44: warning: exported method Github.Open should have comment or be unexported (golint)
    • Line 89: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 122: warning: exported method Github.Close should have comment or be unexported (golint)
    • Line 126: warning: exported method Github.First should have comment or be unexported (golint)
    • Line 129: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 134: warning: exported method Github.Prev should have comment or be unexported (golint)
    • Line 137: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 142: warning: exported method Github.Next should have comment or be unexported (golint)
    • Line 145: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 150: warning: exported method Github.ReadUp should have comment or be unexported (golint)
    • Line 167: warning: exported method Github.ReadDown should have comment or be unexported (golint)
    • database/cockroachdb/cockroachdb.go
    • Line 31: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 32: warning: exported var DefaultLockTable should have comment or be unexported (golint)
    • Line 35: warning: exported var ErrNilConfig should have comment or be unexported (golint)
    • Line 39: warning: exported type Config should have comment or be unexported (golint)
    • Line 46: warning: exported type CockroachDb should have comment or be unexported (golint)
    • Line 54: warning: exported function WithInstance should have comment or be unexported (golint)
    • Line 99: warning: exported method CockroachDb.Open should have comment or be unexported (golint)
    • Line 144: warning: exported method CockroachDb.Close should have comment or be unexported (golint)
    • Line 148: warning: comment on exported method CockroachDb.Lock should be of the form "Lock ..." (golint)
    • Line 180: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 186: warning: comment on exported method CockroachDb.Unlock should be of the form "Unlock ..." (golint)
    • Line 214: warning: exported method CockroachDb.Run should have comment or be unexported (golint)
    • Line 229: warning: exported method CockroachDb.SetVersion should have comment or be unexported (golint)
    • Line 245: warning: exported method CockroachDb.Version should have comment or be unexported (golint)
    • Line 268: warning: exported method CockroachDb.Drop should have comment or be unexported (golint)
    • cli/log.go
    • Line 9: warning: exported type Log should have comment or be unexported (golint)
    • Line 13: warning: exported method Log.Printf should have comment or be unexported (golint)
    • Line 21: warning: exported method Log.Println should have comment or be unexported (golint)
    • Line 29: warning: exported method Log.Verbose should have comment or be unexported (golint)
    • database/mysql/mysql.go
    • Line 31: warning: exported var DefaultMigrationsTable should have comment or be unexported (golint)
    • Line 34: warning: exported var ErrDatabaseDirty should have comment or be unexported (golint)
    • Line 41: warning: exported type Config should have comment or be unexported (golint)
    • Line 46: warning: exported type Mysql should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function WithInstance should be of the form "WithInstance ..." (golint)
    • Line 119: warning: exported method Mysql.Open should have comment or be unexported (golint)
    • Line 197: warning: exported method Mysql.Close should have comment or be unexported (golint)
    • Line 206: warning: exported method Mysql.Lock should have comment or be unexported (golint)
    • Line 231: warning: exported method Mysql.Unlock should have comment or be unexported (golint)
    • Line 255: warning: exported method Mysql.Run should have comment or be unexported (golint)
    • Line 269: warning: exported method Mysql.SetVersion should have comment or be unexported (golint)
    • Line 296: warning: exported method Mysql.Version should have comment or be unexported (golint)
    • Line 316: warning: exported method Mysql.Drop should have comment or be unexported (golint)
    • testing/testing.go
    • Line 13: warning: exported type IsReadyFunc should have comment or be unexported (golint)
    • Line 15: warning: exported type TestFunc should have comment or be unexported (golint)
    • Line 17: warning: exported type Version should have comment or be unexported (golint)
    • Line 23: warning: exported function ParallelTest should have comment or be unexported (golint)
    • Line 88: warning: exported type Instance should have comment or be unexported (golint)
    • source/file/file.go
    • Line 19: warning: exported type File should have comment or be unexported (golint)
    • Line 25: warning: exported method File.Open should have comment or be unexported (golint)
    • Line 78: warning: exported method File.Close should have comment or be unexported (golint)
    • Line 83: warning: exported method File.First should have comment or be unexported (golint)
    • Line 86: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 91: warning: exported method File.Prev should have comment or be unexported (golint)
    • Line 94: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 99: warning: exported method File.Next should have comment or be unexported (golint)
    • Line 102: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 107: warning: exported method File.ReadUp should have comment or be unexported (golint)
    • Line 118: warning: exported method File.ReadDown should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words

    • util.go
    • Line 26: warning: "Mulitple" is a misspelling of "Multiple" (misspell)