Preparing report...

Report for github.com/loghole/database

(v0.6.0)

A+    Excellent!    Found 13 issues across 18 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


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!


gocyclo100%

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.

No problems detected. Good job!


golint27%

Golint is a linter for Go source code.

    • hooks/codes.go
    • Line 8: warning: exported const DatabaseError should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported type Code should have comment or be unexported (golint)
    • Line 15: warning: exported method Code.Int should have comment or be unexported (golint)
    • Line 19: warning: exported method Code.HTTP should have comment or be unexported (golint)
    • Line 30: warning: exported method Code.GRPC should have comment or be unexported (golint)
    • hooks/metrics.go
    • Line 16: warning: exported type MetricCollector should have comment or be unexported (golint)
    • Line 21: warning: exported type MetricsHook should have comment or be unexported (golint)
    • Line 28: warning: exported function NewMetricsHook should have comment or be unexported (golint)
    • Line 35: warning: exported method MetricsHook.Before should have comment or be unexported (golint)
    • Line 41: warning: exported method MetricsHook.After should have comment or be unexported (golint)
    • hooks/reconnect.go
    • Line 12: warning: exported type ReconnectHook should have comment or be unexported (golint)
    • Line 16: warning: exported var ErrCanRetry should have comment or be unexported (golint)
    • Line 18: warning: exported function NewReconnectHook should have comment or be unexported (golint)
    • hooks/tracing.go
    • Line 19: warning: exported type TracingHook should have comment or be unexported (golint)
    • Line 24: warning: exported function NewTracingHook should have comment or be unexported (golint)
    • Line 31: warning: exported method TracingHook.Before should have comment or be unexported (golint)
    • Line 51: warning: exported method TracingHook.After should have comment or be unexported (golint)
    • options.go
    • Line 14: warning: exported const DefaultRetryAttempts should have comment or be unexported (golint)
    • Line 16: warning: exported type Option should have comment or be unexported (golint)
    • Line 26: warning: exported function WithCustomHook should have comment or be unexported (golint)
    • Line 34: warning: exported function WithTracingHook should have comment or be unexported (golint)
    • Line 42: warning: exported function WithReconnectHook should have comment or be unexported (golint)
    • Line 50: warning: exported function WithSimplerrHook should have comment or be unexported (golint)
    • Line 58: warning: exported function WithMetricsHook should have comment or be unexported (golint)
    • Line 66: warning: exported function WithPrometheusMetrics should have comment or be unexported (golint)
    • Line 85: warning: exported function WithRetryFunc should have comment or be unexported (golint)
    • Line 93: warning: exported function WithPQRetryFunc should have comment or be unexported (golint)
    • Line 107: warning: exported function WithCockroachRetryFunc should have comment or be unexported (golint)
    • Line 111: warning: exported function WithDefaultOptions should have comment or be unexported (golint)
    • config.go
    • Line 9: warning: exported type DBType should have comment or be unexported (golint)
    • Line 12: warning: exported const PostgresDatabase should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type Config should have comment or be unexported (golint)
    • Line 31: warning: exported method Config.DSN should have comment or be unexported (golint)
    • db.go
    • Line 22: warning: exported type DB should have comment or be unexported (golint)
    • Line 30: warning: exported type TransactionFunc should have comment or be unexported (golint)
    • Line 31: warning: exported type QueryFunc should have comment or be unexported (golint)
    • Line 32: warning: exported type RetryFunc should have comment or be unexported (golint)
    • Line 35: warning: exported function New should have comment or be unexported (golint)
    • Line 65: warning: exported method DB.Close should have comment or be unexported (golint)
    • tx.go
    • Line 11: warning: exported method DB.RunTxx should have comment or be unexported (golint)
    • hooks/config.go
    • Line 3: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • hooks/simplerr.go
    • Line 12: warning: exported type SimplerrHook should have comment or be unexported (golint)
    • Line 14: warning: exported function NewSimplerrHook should have comment or be unexported (golint)
    • internal/metrics/metrics.go
    • Line 11: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 16: warning: comment on exported function NewMetrics should be of the form "NewMetrics ..." (golint)
    • Line 47: warning: exported method Metrics.SerializationFailureInc should have comment or be unexported (golint)
    • Line 55: warning: exported method Metrics.QueryDurationObserve 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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!