Preparing report...

Report for github.com/jackc/pgx

A+    Excellent!    Found 26 issues across 50 files

Tweet

gofmt94%

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!


gocyclo80%

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.

    • pgx/large_objects_test.go
    • Line 161: warning: cyclomatic complexity 30 of function TestLargeObjectsMultipleTransactions() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 24 of function testLargeObjects() is high (> 15) (gocyclo)
    • pgx/conn.go
    • Line 567: warning: cyclomatic complexity 24 of function (*Conn).Query() is high (> 15) (gocyclo)
    • Line 729: warning: cyclomatic complexity 21 of function (*Conn).SendBatch() is high (> 15) (gocyclo)
    • pgx/rows.go
    • Line 232: warning: cyclomatic complexity 18 of function (*connRows).Values() is high (> 15) (gocyclo)
    • pgx/values.go
    • Line 27: warning: cyclomatic complexity 38 of function convertSimpleArgument() is high (> 15) (gocyclo)
    • Line 142: warning: cyclomatic complexity 18 of function encodePreparedStatementArgument() is high (> 15) (gocyclo)
    • pgx/bench_test.go
    • Line 211: warning: cyclomatic complexity 16 of function BenchmarkPointerPointerWithPresentValues() is high (> 15) (gocyclo)

golint66%

Golint is a linter for Go source code.

    • pgx/log/zapadapter/adapter.go
    • Line 12: warning: exported type Logger should have comment or be unexported (golint)
    • Line 16: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 20: warning: exported method Logger.Log should have comment or be unexported (golint)
    • pgx/pgxpool/stat.go
    • Line 9: warning: exported type Stat should have comment or be unexported (golint)
    • Line 53: warning: comment on exported method Stat.MaxConns should be of the form "MaxConns ..." (golint)
    • pgx/conn.go
    • Line 53: warning: exported method ConnConfig.ConnString should have comment or be unexported (golint)
    • Line 110: warning: comment on exported function ConnectConfig should be of the form "ConnectConfig ..." (golint)
    • Line 327: warning: exported method Conn.IsClosed should have comment or be unexported (golint)
    • Line 360: warning: exported method Conn.Ping should have comment or be unexported (golint)
    • Line 770: warning: should omit 2nd value from range; this loop is equivalent to `for sql := range ...` (golint)
    • pgx/rows.go
    • Line 187: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 308: warning: exported type ScanArgError should have comment or be unexported (golint)
    • pgx/tx.go
    • Line 13: warning: exported type TxIsoLevel should have comment or be unexported (golint)
    • Line 23: warning: exported type TxAccessMode should have comment or be unexported (golint)
    • Line 31: warning: exported type TxDeferrableMode should have comment or be unexported (golint)
    • Line 39: warning: exported type TxOptions should have comment or be unexported (golint)
    • Line 61: warning: exported var ErrTxClosed should have comment or be unexported (golint)
    • pgx/log/testingadapter/adapter.go
    • Line 18: warning: exported type Logger should have comment or be unexported (golint)
    • Line 22: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 26: warning: exported method Logger.Log should have comment or be unexported (golint)
    • pgx/log/kitlogadapter/adapter.go
    • Line 11: warning: exported type Logger should have comment or be unexported (golint)
    • Line 15: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 19: warning: exported method Logger.Log should have comment or be unexported (golint)
    • pgx/pgxpool/conn.go
    • Line 49: warning: exported method Conn.Exec should have comment or be unexported (golint)
    • Line 53: warning: exported method Conn.Query should have comment or be unexported (golint)
    • Line 57: warning: exported method Conn.QueryRow should have comment or be unexported (golint)
    • Line 61: warning: exported method Conn.QueryFunc should have comment or be unexported (golint)
    • Line 65: warning: exported method Conn.SendBatch should have comment or be unexported (golint)
    • Line 69: warning: exported method Conn.CopyFrom should have comment or be unexported (golint)
    • Line 73: warning: exported method Conn.Begin should have comment or be unexported (golint)
    • Line 77: warning: exported method Conn.BeginTx should have comment or be unexported (golint)
    • Line 81: warning: exported method Conn.BeginFunc should have comment or be unexported (golint)
    • Line 85: warning: exported method Conn.BeginTxFunc should have comment or be unexported (golint)
    • Line 89: warning: exported method Conn.Ping should have comment or be unexported (golint)
    • Line 93: warning: exported method Conn.Conn should have comment or be unexported (golint)
    • pgx/pgxpool/pool.go
    • Line 71: warning: exported type Pool should have comment or be unexported (golint)
    • Line 142: warning: exported method Config.ConnString should have comment or be unexported (golint)
    • Line 378: warning: exported method Pool.Acquire should have comment or be unexported (golint)
    • Line 427: warning: exported method Pool.Stat should have comment or be unexported (golint)
    • Line 431: warning: exported method Pool.Exec should have comment or be unexported (golint)
    • Line 441: warning: exported method Pool.Query should have comment or be unexported (golint)
    • Line 456: warning: exported method Pool.QueryRow should have comment or be unexported (golint)
    • Line 466: warning: exported method Pool.QueryFunc should have comment or be unexported (golint)
    • Line 476: warning: exported method Pool.SendBatch should have comment or be unexported (golint)
    • Line 486: warning: exported method Pool.Begin should have comment or be unexported (golint)
    • Line 489: warning: exported method Pool.BeginTx should have comment or be unexported (golint)
    • Line 504: warning: exported method Pool.BeginFunc should have comment or be unexported (golint)
    • Line 508: warning: exported method Pool.BeginTxFunc should have comment or be unexported (golint)
    • Line 518: warning: exported method Pool.CopyFrom should have comment or be unexported (golint)
    • Line 528: warning: exported method Pool.Ping should have comment or be unexported (golint)
    • pgx/pgxpool/tx.go
    • Line 10: warning: exported type Tx should have comment or be unexported (golint)
    • Line 15: warning: exported method Tx.Begin should have comment or be unexported (golint)
    • Line 19: warning: exported method Tx.BeginFunc should have comment or be unexported (golint)
    • Line 23: warning: exported method Tx.Commit should have comment or be unexported (golint)
    • Line 32: warning: exported method Tx.Rollback should have comment or be unexported (golint)
    • Line 41: warning: exported method Tx.CopyFrom should have comment or be unexported (golint)
    • Line 45: warning: exported method Tx.SendBatch should have comment or be unexported (golint)
    • Line 49: warning: exported method Tx.LargeObjects should have comment or be unexported (golint)
    • Line 53: warning: exported method Tx.Prepare should have comment or be unexported (golint)
    • Line 57: warning: exported method Tx.Exec should have comment or be unexported (golint)
    • Line 61: warning: exported method Tx.Query should have comment or be unexported (golint)
    • Line 65: warning: exported method Tx.QueryRow should have comment or be unexported (golint)
    • Line 69: warning: exported method Tx.QueryFunc should have comment or be unexported (golint)
    • Line 73: warning: exported method Tx.Conn should have comment or be unexported (golint)
    • pgx/large_objects.go
    • Line 17: warning: exported type LargeObjectMode should have comment or be unexported (golint)
    • Line 20: warning: exported const LargeObjectModeWrite should have comment (or a comment on this block) or be unexported (golint)
    • Line 111: warning: comment on exported method LargeObject.Truncate should be of the form "Truncate ..." (golint)
    • pgx/log/log15adapter/adapter.go
    • Line 21: warning: exported type Logger should have comment or be unexported (golint)
    • Line 25: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 29: warning: exported method Logger.Log should have comment or be unexported (golint)
    • pgx/stdlib/sql.go
    • Line 80: warning: exported var ErrNotPgx should have comment or be unexported (golint)
    • Line 157: warning: exported function OpenDB should have comment or be unexported (golint)
    • Line 214: warning: exported type Driver should have comment or be unexported (golint)
    • Line 220: warning: exported method Driver.Open should have comment or be unexported (golint)
    • Line 231: warning: exported method Driver.OpenConnector should have comment or be unexported (golint)
    • Line 293: warning: exported type Conn should have comment or be unexported (golint)
    • Line 305: warning: exported method Conn.Prepare should have comment or be unexported (golint)
    • Line 309: warning: exported method Conn.PrepareContext should have comment or be unexported (golint)
    • Line 325: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 331: warning: exported method Conn.Begin should have comment or be unexported (golint)
    • Line 335: warning: exported method Conn.BeginTx should have comment or be unexported (golint)
    • Line 372: warning: exported method Conn.ExecContext should have comment or be unexported (golint)
    • Line 389: warning: exported method Conn.QueryContext should have comment or be unexported (golint)
    • Line 414: warning: exported method Conn.Ping should have comment or be unexported (golint)
    • Line 430: warning: exported method Conn.CheckNamedValue should have comment or be unexported (golint)
    • Line 435: warning: exported method Conn.ResetSession should have comment or be unexported (golint)
    • Line 442: warning: exported type Stmt should have comment or be unexported (golint)
    • Line 447: warning: exported method Stmt.Close should have comment or be unexported (golint)
    • Line 453: warning: exported method Stmt.NumInput should have comment or be unexported (golint)
    • Line 457: warning: exported method Stmt.Exec should have comment or be unexported (golint)
    • Line 461: warning: exported method Stmt.ExecContext should have comment or be unexported (golint)
    • Line 465: warning: exported method Stmt.Query should have comment or be unexported (golint)
    • Line 469: warning: exported method Stmt.QueryContext should have comment or be unexported (golint)
    • Line 475: warning: exported type Rows should have comment or be unexported (golint)
    • Line 485: warning: exported method Rows.Columns should have comment or be unexported (golint)
    • Line 568: warning: exported method Rows.Close should have comment or be unexported (golint)
    • Line 573: warning: exported method Rows.Next should have comment or be unexported (golint)
    • Line 736: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • pgx/batch.go
    • Line 34: warning: exported type BatchResults should have comment or be unexported (golint)
    • pgx/log/logrusadapter/adapter.go
    • Line 12: warning: exported type Logger should have comment or be unexported (golint)
    • Line 16: warning: exported function NewLogger should have comment or be unexported (golint)
    • Line 20: warning: exported method Logger.Log should have comment or be unexported (golint)
    • pgx/internal/sanitize/sanitize.go
    • Line 17: warning: exported type Query should have comment or be unexported (golint)
    • Line 21: warning: exported method Query.Sanitize should have comment or be unexported (golint)
    • Line 69: warning: exported function NewQuery should have comment or be unexported (golint)
    • Line 84: warning: exported function QuoteString should have comment or be unexported (golint)
    • Line 88: warning: exported function QuoteBytes should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!