Preparing report...

Report for github.com/ilibs/gosql

A+    Excellent!    Found 17 issues across 37 files

Tweet

gofmt97%

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.

    • gosql/util.go
    • Line 20: warning: cyclomatic complexity 16 of function IsZero() is high (> 15) (gocyclo)

golint56%

Golint is a linter for Go source code.

    • gosql/sql_builder.go
    • Line 8: warning: exported type SQLBuilder should have comment or be unexported (golint)
    • Line 113: warning: exported method SQLBuilder.Where should have comment or be unexported (golint)
    • gosql/internal/example/models/moment.go
    • Line 3: warning: exported type Moments should have comment or be unexported (golint)
    • Line 13: warning: exported method Moments.TableName should have comment or be unexported (golint)
    • Line 17: warning: exported method Moments.PK should have comment or be unexported (golint)
    • gosql/connection.go
    • Line 17: warning: comment on exported var FatalExit should be of the form "FatalExit ..." (golint)
    • Line 21: warning: comment on exported function Sqlx should be of the form "Sqlx ..." (golint)
    • gosql/model_wrapper.go
    • Line 3: warning: exported type ModelWrapper should have comment or be unexported (golint)
    • Line 8: warning: exported type ModelWrapperFactory should have comment or be unexported (golint)
    • Line 10: warning: exported function NewModelWrapper should have comment or be unexported (golint)
    • Line 14: warning: exported method ModelWrapper.GetRelationDB should have comment or be unexported (golint)
    • Line 18: warning: exported method ModelWrapper.UnWrap should have comment or be unexported (golint)
    • gosql/reflect.go
    • Line 9: warning: exported type ReflectMapper should have comment or be unexported (golint)
    • Line 13: warning: exported function NewReflectMapper should have comment or be unexported (golint)
    • gosql/internal/example/models/photo.go
    • Line 3: warning: exported type Photos should have comment or be unexported (golint)
    • Line 10: warning: exported method Photos.TableName should have comment or be unexported (golint)
    • Line 14: warning: exported method Photos.PK should have comment or be unexported (golint)
    • gosql/db.go
    • Line 13: warning: exported type ISqlx should have comment or be unexported (golint)
    • Line 25: warning: exported type BuilderChainFunc should have comment or be unexported (golint)
    • Line 27: warning: exported type DB should have comment or be unexported (golint)
    • Line 70: warning: exported method DB.ShowSql should have comment or be unexported (golint)
    • Line 75: warning: comment on exported method DB.Begin should be of the form "Begin ..." (golint)
    • Line 327: 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 332: warning: comment on exported method DB.WithContext should be of the form "WithContext ..." (golint)
    • Line 348: warning: comment on exported function Begin should be of the form "Begin ..." (golint)
    • Line 363: warning: comment on exported function NamedExec should be of the form "NamedExec ..." (golint)
    • gosql/model.go
    • Line 13: warning: comment on exported var AUTO_CREATE_TIME_FIELDS should be of the form "AUTO_CREATE_TIME_FIELDS ..." (golint)
    • Line 22: warning: comment on exported var AUTO_UPDATE_TIME_FIELDS should be of the form "AUTO_UPDATE_TIME_FIELDS ..." (golint)
    • Line 30: warning: comment on exported type IModel should be of the form "IModel ..." (with optional leading article) (golint)
    • Line 36: warning: exported type Builder should have comment or be unexported (golint)
    • Line 60: warning: comment on exported function WithContext should be of the form "WithContext ..." (golint)
    • Line 133: warning: comment on exported method Builder.ForceIndex should be of the form "ForceIndex ..." (golint)
    • Line 151: warning: comment on exported method Builder.Limit should be of the form "Limit ..." (golint)
    • Line 157: warning: comment on exported method Builder.Offset should be of the form "Offset ..." (golint)
    • Line 186: warning: comment on exported method Builder.Get should be of the form "Get ..." (golint)
    • Line 262: warning: comment on exported method Builder.Update should be of the form "Update ..." (golint)
    • Line 293: warning: comment on exported method Builder.Delete should be of the form "Delete ..." (golint)
    • Line 322: warning: comment on exported method Builder.Count should be of the form "Count ..." (golint)
    • gosql/relation.go
    • Line 21: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 140: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • gosql/util.go
    • Line 49: 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)
    • gosql/internal/example/models/user.go
    • Line 8: warning: exported type Users should have comment or be unexported (golint)
    • Line 17: warning: exported method Users.TableName should have comment or be unexported (golint)
    • Line 21: warning: exported method Users.PK should have comment or be unexported (golint)
    • gosql/json.go
    • Line 11: warning: exported function JsonObject should have comment or be unexported (golint)
    • Line 99: warning: exported method JSONText.UnmarshalBinary should have comment or be unexported (golint)
    • Line 103: warning: exported method JSONText.MarshalBinary should have comment or be unexported (golint)
    • gosql/mapper.go
    • Line 3: warning: exported type Mapper should have comment or be unexported (golint)
    • Line 14: warning: exported method Mapper.ShowSQL should have comment or be unexported (golint)
    • Line 19: warning: comment on exported method Mapper.Where should be of the form "Where ..." (golint)
    • gosql/hook.go
    • Line 11: warning: exported type Hook should have comment or be unexported (golint)
    • Line 17: warning: exported function NewHook should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!