Preparing report...

Report for github.com/lovego/bsql

(v0.1.4)

A+    Excellent!    Found 19 issues across 34 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!


gocyclo94%

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.

    • columns_defs.go
    • Line 88: warning: cyclomatic complexity 18 of function getColumnType() is high (> 15) (gocyclo)

golint52%

Golint is a linter for Go source code.

    • position/position.go
    • Line 9: warning: exported function Get should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function OffsetToLineAndColumn should be of the form "OffsetToLineAndColumn ..." (golint)
    • Line 51: warning: exported function GetLineContent should have comment or be unexported (golint)
    • Line 60: warning: exported function GetLineEnd should have comment or be unexported (golint)
    • scan/field_by_name.go
    • Line 5: warning: exported function FieldByName should have comment or be unexported (golint)
    • Line 12: warning: exported function FieldByIndex should have comment or be unexported (golint)
    • db_or_tx.go
    • Line 20: warning: exported type DbOrTx should have comment or be unexported (golint)
    • Line 28: warning: exported function IsNil should have comment or be unexported (golint)
    • Line 52: warning: exported function WrapError should have comment or be unexported (golint)
    • Line 65: warning: exported function ErrorWithPosition should have comment or be unexported (golint)
    • Line 72: warning: exported function GetPosition should have comment or be unexported (golint)
    • Line 97: warning: exported function PrettyPrint should have comment or be unexported (golint)
    • fields.go
    • Line 11: warning: comment on exported function Field2Column should be of the form "Field2Column ..." (golint)
    • Line 39: warning: exported function Fields2Columns should have comment or be unexported (golint)
    • Line 46: warning: exported function Fields2ColumnsStr should have comment or be unexported (golint)
    • Line 50: warning: exported function FieldsToColumns should have comment or be unexported (golint)
    • Line 59: warning: exported function FieldsToColumnsStr should have comment or be unexported (golint)
    • Line 63: warning: exported function FieldsFromStruct should have comment or be unexported (golint)
    • v.go
    • Line 29: warning: exported function V should have comment or be unexported (golint)
    • Line 55: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 65: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 86: warning: exported function Json should have comment or be unexported (golint)
    • Line 112: 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)
    • scan/scan.go
    • Line 10: warning: comment on exported function Scan should be of the form "Scan ..." (golint)
    • Line 61: warning: comment on exported function ScanRow should be of the form "ScanRow ..." (golint)
    • columns.go
    • Line 11: warning: exported function Columns2Fields should have comment or be unexported (golint)
    • Line 18: warning: exported function ColumnsFromStruct should have comment or be unexported (golint)
    • Line 22: warning: exported function ColumnsStrFromStruct should have comment or be unexported (golint)
    • Line 26: warning: exported function ColumnsComments should have comment or be unexported (golint)
    • db.go
    • Line 13: warning: exported type DB should have comment or be unexported (golint)
    • Line 19: warning: exported function New should have comment or be unexported (golint)
    • Line 26: warning: exported method DB.GetDB should have comment or be unexported (golint)
    • Line 30: warning: exported method DB.SetTimeout should have comment or be unexported (golint)
    • Line 36: warning: exported method DB.Query should have comment or be unexported (golint)
    • Line 40: warning: exported method DB.QueryT should have comment or be unexported (golint)
    • Line 46: warning: exported method DB.QueryCtx should have comment or be unexported (golint)
    • Line 75: warning: exported method DB.Exec should have comment or be unexported (golint)
    • Line 79: warning: exported method DB.ExecT should have comment or be unexported (golint)
    • Line 92: warning: exported method DB.ExecCtx should have comment or be unexported (golint)
    • Line 109: warning: exported method DB.RunInTransaction should have comment or be unexported (golint)
    • Line 113: warning: exported method DB.RunInTransactionT should have comment or be unexported (golint)
    • Line 137: warning: exported method DB.RunInTransactionCtx should have comment or be unexported (golint)
    • scan/column_type.go
    • Line 8: warning: exported type ColumnType should have comment or be unexported (golint)
    • Line 13: warning: exported function ColumnTypes should have comment or be unexported (golint)
    • Line 27: warning: exported function Column2Field should have comment or be unexported (golint)
    • scan/scanners.go
    • Line 33: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • columns_defs.go
    • Line 36: warning: exported function ColumnsDefs should have comment or be unexported (golint)
    • Line 99: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 105: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 111: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • struct_values.go
    • Line 11: warning: exported function StructValues should have comment or be unexported (golint)
    • Line 31: warning: exported function StructFields should have comment or be unexported (golint)
    • Line 35: warning: exported function StructFieldsReflect should have comment or be unexported (golint)
    • Line 53: warning: exported function StructValuesWithType should have comment or be unexported (golint)
    • Line 68: warning: exported function StructFieldsWithType should have comment or be unexported (golint)
    • Line 97: warning: exported function StructFieldValues should have comment or be unexported (golint)
    • tx.go
    • Line 13: warning: exported type Tx should have comment or be unexported (golint)
    • Line 19: warning: exported function NewTx should have comment or be unexported (golint)
    • Line 26: warning: exported method Tx.GetTx should have comment or be unexported (golint)
    • Line 30: warning: exported method Tx.SetTimeout should have comment or be unexported (golint)
    • Line 36: warning: exported method Tx.Query should have comment or be unexported (golint)
    • Line 40: warning: exported method Tx.QueryT should have comment or be unexported (golint)
    • Line 46: warning: exported method Tx.QueryCtx should have comment or be unexported (golint)
    • Line 75: warning: exported method Tx.Exec should have comment or be unexported (golint)
    • Line 79: warning: exported method Tx.ExecT should have comment or be unexported (golint)
    • Line 92: warning: exported method Tx.ExecCtx should have comment or be unexported (golint)
    • utils.go
    • Line 11: warning: exported function UpsertSql should have comment or be unexported (golint)
    • Line 48: warning: exported function ConflictedUniqueIndex should have comment or be unexported (golint)
    • schema.go
    • Line 9: warning: exported type Table should have comment or be unexported (golint)
    • values.go
    • Line 43: warning: exported function SingleColumnValues should have comment or be unexported (golint)
    • Line 57: warning: exported function SliceContents should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.

    • fields.go
    • Line 24: warning: ineffectual assignment to end (ineffassign)
    • Line 29: warning: ineffectual assignment to end (ineffassign)
    • Line 24: warning: ineffectual assignment to end (ineffassign)
    • Line 29: warning: ineffectual assignment to end (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!