Preparing report...

Report for github.com/zhgo/db

C    Needs some work    Found 8 issues across 9 files

Tweet

gofmt22%

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!


gocyclo88%

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.

    • db/query.go
    • Line 554: warning: cyclomatic complexity 16 of function (*Query).Exec() is high (> 15) (gocyclo)

golint44%

Golint is a linter for Go source code.

    • db/define.go
    • Line 11: warning: comment on exported type Item should be of the form "Item ..." (with optional leading article) (golint)
    • Line 14: warning: comment on exported type Items should be of the form "Items ..." (with optional leading article) (golint)
    • Line 17: warning: comment on exported type Where should be of the form "Where ..." (with optional leading article) (golint)
    • Line 20: warning: comment on exported var Env should be of the form "Env ..." (golint)
    • Line 26: warning: comment on exported var Servers should be of the form "Servers ..." (golint)
    • db/model.go
    • Line 18: warning: comment on exported method Model.Insert should be of the form "Insert ..." (golint)
    • Line 26: warning: comment on exported method Model.Update should be of the form "Update ..." (golint)
    • Line 34: warning: comment on exported method Model.Delete should be of the form "Delete ..." (golint)
    • Line 42: warning: comment on exported method Model.Select should be of the form "Select ..." (golint)
    • Line 55: warning: comment on exported function NewModel should be of the form "NewModel ..." (golint)
    • db/query.go
    • Line 86: warning: comment on exported method Query.Eq should be of the form "Eq ..." (golint)
    • Line 91: warning: comment on exported method Query.Ge should be of the form "Ge ..." (golint)
    • Line 96: warning: comment on exported method Query.Gt should be of the form "Gt ..." (golint)
    • Line 101: warning: comment on exported method Query.Le should be of the form "Le ..." (golint)
    • Line 106: warning: comment on exported method Query.Lt should be of the form "Lt ..." (golint)
    • Line 111: warning: comment on exported method Query.Ne should be of the form "Ne ..." (golint)
    • Line 116: warning: comment on exported method Query.Like should be of the form "Like ..." (golint)
    • Line 121: warning: comment on exported method Query.In should be of the form "In ..." (golint)
    • Line 126: warning: comment on exported method Query.And should be of the form "And ..." (golint)
    • Line 136: warning: comment on exported method Query.AndEq should be of the form "AndEq ..." (golint)
    • Line 141: warning: comment on exported method Query.AndGe should be of the form "AndGe ..." (golint)
    • Line 146: warning: comment on exported method Query.AndGt should be of the form "AndGt ..." (golint)
    • Line 151: warning: comment on exported method Query.AndLe should be of the form "AndLe ..." (golint)
    • Line 156: warning: comment on exported method Query.AndLt should be of the form "AndLt ..." (golint)
    • Line 161: warning: comment on exported method Query.AndNe should be of the form "AndNe ..." (golint)
    • Line 166: warning: comment on exported method Query.AndLike should be of the form "AndLike ..." (golint)
    • Line 171: warning: comment on exported method Query.AndIn should be of the form "AndIn ..." (golint)
    • Line 176: warning: comment on exported method Query.Or should be of the form "Or ..." (golint)
    • Line 186: warning: comment on exported method Query.OrEq should be of the form "OrEq ..." (golint)
    • Line 191: warning: comment on exported method Query.OrGe should be of the form "OrGe ..." (golint)
    • Line 196: warning: comment on exported method Query.OrGt should be of the form "OrGt ..." (golint)
    • Line 201: warning: comment on exported method Query.OrLe should be of the form "OrLe ..." (golint)
    • Line 206: warning: comment on exported method Query.OrLt should be of the form "OrLt ..." (golint)
    • Line 211: warning: comment on exported method Query.OrNe should be of the form "OrNe ..." (golint)
    • Line 216: warning: comment on exported method Query.OrLike should be of the form "OrLike ..." (golint)
    • Line 221: warning: comment on exported method Query.OrIn should be of the form "OrIn ..." (golint)
    • Line 283: warning: comment on exported method Query.InsertInto should be of the form "InsertInto ..." (golint)
    • Line 291: warning: comment on exported method Query.SetPrimary should be of the form "SetPrimary ..." (golint)
    • Line 296: warning: comment on exported method Query.Fields should be of the form "Fields ..." (golint)
    • Line 303: warning: comment on exported method Query.Values should be of the form "Values ..." (golint)
    • Line 321: warning: comment on exported method Query.Update should be of the form "Update ..." (golint)
    • Line 329: warning: comment on exported method Query.Set should be of the form "Set ..." (golint)
    • Line 341: warning: comment on exported method Query.DeleteFrom should be of the form "DeleteFrom ..." (golint)
    • Line 364: warning: comment on exported method Query.From should be of the form "From ..." (golint)
    • Line 378: warning: comment on exported method Query.Join should be of the form "Join ..." (golint)
    • Line 383: warning: comment on exported method Query.InnerJoin should be of the form "InnerJoin ..." (golint)
    • Line 388: warning: comment on exported method Query.OuterJoin should be of the form "OuterJoin ..." (golint)
    • Line 393: warning: comment on exported method Query.LeftJoin should be of the form "LeftJoin ..." (golint)
    • Line 398: warning: comment on exported method Query.RightJoin should be of the form "RightJoin ..." (golint)
    • Line 403: warning: comment on exported method Query.On should be of the form "On ..." (golint)
    • Line 411: warning: comment on exported method Query.Where should be of the form "Where ..." (golint)
    • Line 419: warning: comment on exported method Query.GroupBy should be of the form "GroupBy ..." (golint)
    • Line 425: warning: comment on exported method Query.Having should be of the form "Having ..." (golint)
    • Line 440: warning: comment on exported method Query.OrderAsc should be of the form "OrderAsc ..." (golint)
    • Line 445: warning: comment on exported method Query.OrderDesc should be of the form "OrderDesc ..." (golint)
    • Line 450: warning: comment on exported method Query.Limit should be of the form "Limit ..." (golint)
    • Line 457: warning: comment on exported method Query.Parse should be of the form "Parse ..." (golint)
    • Line 496: warning: comment on exported method Query.ToString should be of the form "ToString ..." (golint)
    • Line 553: warning: comment on exported method Query.Exec should be of the form "Exec ..." (golint)
    • Line 576: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 613: warning: comment on exported method Query.Row should be of the form "Row ..." (golint)
    • Line 624: warning: comment on exported method Query.Rows should be of the form "Rows ..." (golint)
    • Line 635: warning: comment on exported function NewQuery should be of the form "NewQuery ..." (golint)
    • db/server.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 28: warning: comment on exported method Server.Exec should be of the form "Exec ..." (golint)
    • Line 46: warning: comment on exported method Server.Row should be of the form "Row ..." (golint)
    • Line 101: warning: comment on exported method Server.Rows should be of the form "Rows ..." (golint)
    • Line 156: warning: comment on exported method Server.NewQuery should be of the form "NewQuery ..." (golint)
    • Line 161: warning: comment on exported method Server.InsertInto should be of the form "InsertInto ..." (golint)
    • Line 166: warning: comment on exported method Server.Update should be of the form "Update ..." (golint)
    • Line 171: warning: comment on exported method Server.DeleteFrom should be of the form "DeleteFrom ..." (golint)
    • Line 176: warning: comment on exported method Server.Select should be of the form "Select ..." (golint)
    • Line 181: warning: exported method Server.Close should have comment or be unexported (golint)
    • Line 274: warning: comment on exported function NewServer should be of the form "NewServer ..." (golint)
    • Line 279: warning: comment on exported function Connect should be of the form "Connect ..." (golint)
    • db/table.go
    • Line 38: warning: comment on exported function NewTable should be of the form "NewTable ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign77%

IneffAssign detects ineffectual assignments in Go code.

    • db/init.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/zhgo/config (invalid package name: "") (ineffassign)
    • Line 8: warning: could not import github.com/zhgo/config (invalid package name: "") (ineffassign)
    • db/server.go
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 10: warning: cannot find package "." in: (ineffassign)
    • Line 11: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: could not import github.com/zhgo/mysql (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/zhgo/postgresql (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/zhgo/sqlite/sqlite3 (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/zhgo/mysql (invalid package name: "") (ineffassign)
    • Line 10: warning: could not import github.com/zhgo/postgresql (invalid package name: "") (ineffassign)
    • Line 11: warning: could not import github.com/zhgo/sqlite/sqlite3 (invalid package name: "") (ineffassign)

misspell88%

Misspell Finds commonly misspelled English words