Preparing report...

Report for github.com/wzshiming/gen

A+    Excellent!    Found 23 issues across 36 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!


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.

    • gen/openapi/openapi.go
    • Line 491: warning: cyclomatic complexity 58 of function (*GenOpenAPI).generateSchemas() is high (> 15) (gocyclo)
    • Line 75: warning: cyclomatic complexity 22 of function (*GenOpenAPI).generateComponents() is high (> 15) (gocyclo)
    • Line 166: warning: cyclomatic complexity 20 of function (*GenOpenAPI).generateRequests() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 17 of function (*GenOpenAPI).generateContents() is high (> 15) (gocyclo)
    • gen/parser/parser.go
    • Line 710: warning: cyclomatic complexity 43 of function (*Parser).addType() is high (> 15) (gocyclo)
    • Line 587: warning: cyclomatic complexity 31 of function (*Parser).addRequest() is high (> 15) (gocyclo)
    • Line 194: warning: cyclomatic complexity 21 of function (*Parser).addMethods() is high (> 15) (gocyclo)
    • Line 110: warning: cyclomatic complexity 17 of function (*Parser).importOnce() is high (> 15) (gocyclo)
    • gen/route/route.go
    • Line 203: warning: cyclomatic complexity 29 of function (*GenRoute).generateRoutes() is high (> 15) (gocyclo)

golint44%

Golint is a linter for Go source code.

    • gen/crud/crud.go
    • Line 13: warning: exported type GenCrud should have comment or be unexported (golint)
    • Line 16: warning: exported function NewGenCrud should have comment or be unexported (golint)
    • Line 22: warning: exported function TplNames should have comment or be unexported (golint)
    • Line 33: warning: exported method GenCrud.Generate should have comment or be unexported (golint)
    • gen/openapi/openapi.go
    • Line 14: warning: exported type GenOpenAPI should have comment or be unexported (golint)
    • Line 21: warning: exported function NewGenOpenAPI should have comment or be unexported (golint)
    • Line 32: warning: exported method GenOpenAPI.SetExplode should have comment or be unexported (golint)
    • Line 37: warning: exported method GenOpenAPI.SetInfo should have comment or be unexported (golint)
    • Line 42: warning: exported method GenOpenAPI.WithServices should have comment or be unexported (golint)
    • Line 49: warning: exported method GenOpenAPI.Generate should have comment or be unexported (golint)
    • gen/model/model.go
    • Line 21: warning: exported function NewGenModel should have comment or be unexported (golint)
    • Line 33: warning: exported method GenModel.TypesZero should have comment or be unexported (golint)
    • Line 70: warning: exported method GenModel.GetPkgPath should have comment or be unexported (golint)
    • Line 90: warning: exported method GenModel.PkgPath should have comment or be unexported (golint)
    • Line 102: warning: exported method GenModel.Paths should have comment or be unexported (golint)
    • Line 109: warning: exported method GenModel.Ptr should have comment or be unexported (golint)
    • Line 116: warning: exported method GenModel.PtrTypes should have comment or be unexported (golint)
    • Line 123: warning: exported method GenModel.Types should have comment or be unexported (golint)
    • Line 158: warning: exported method GenModel.TypesDefine should have comment or be unexported (golint)
    • gen/parser/util.go
    • Line 12: warning: exported function GetName should have comment or be unexported (golint)
    • Line 20: warning: exported function IsExported should have comment or be unexported (golint)
    • Line 24: warning: exported function GetTypeHash should have comment or be unexported (golint)
    • gen/route/route.go
    • Line 15: warning: comment on exported type GenRoute should be of the form "GenRoute ..." (with optional leading article) (golint)
    • Line 26: warning: exported function NewGenRoute should have comment or be unexported (golint)
    • Line 36: warning: exported method GenRoute.SetExplode should have comment or be unexported (golint)
    • Line 41: warning: exported method GenRoute.SetBuildIgnore should have comment or be unexported (golint)
    • Line 46: warning: exported method GenRoute.Generate should have comment or be unexported (golint)
    • Line 105: warning: exported method GenRoute.WithOpenAPI should have comment or be unexported (golint)
    • gen/model/convert_to.go
    • Line 160: warning: exported method GenModel.ConvertTo should have comment or be unexported (golint)
    • Line 207: warning: exported method GenModel.ConvertToMulti should have comment or be unexported (golint)
    • gen/model/convert_from.go
    • Line 146: warning: exported method GenModel.ConvertFrom should have comment or be unexported (golint)
    • Line 187: warning: exported method GenModel.ConvertFromMulti should have comment or be unexported (golint)
    • gen/spec/kind.go
    • Line 3: warning: comment on exported type Kind should be of the form "Kind ..." (with optional leading article) (golint)
    • Line 7: warning: exported const Invalid should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported method Kind.IsPredeclared should have comment or be unexported (golint)
    • gen/spec/spec.go
    • Line 7: warning: exported type API should have comment or be unexported (golint)
    • Line 19: warning: exported function NewAPI should have comment or be unexported (golint)
    • Line 30: warning: exported type Middleware should have comment or be unexported (golint)
    • Line 42: warning: exported type Wrapping should have comment or be unexported (golint)
    • Line 53: warning: exported type Security should have comment or be unexported (golint)
    • Line 65: warning: exported type Operation should have comment or be unexported (golint)
    • Line 84: warning: exported type Request should have comment or be unexported (golint)
    • Line 95: warning: exported type Response should have comment or be unexported (golint)
    • Line 107: warning: exported type Type should have comment or be unexported (golint)
    • Line 123: warning: exported type Field should have comment or be unexported (golint)
    • Line 132: warning: exported type Enum should have comment or be unexported (golint)
    • Line 139: warning: exported type Attr should have comment or be unexported (golint)
    • Line 142: warning: exported const AttrRoot should have comment (or a comment on this block) or be unexported (golint)
    • Line 151: warning: exported method Attr.HasOne should have comment or be unexported (golint)
    • Line 155: warning: exported method Attr.Has should have comment or be unexported (golint)
    • Line 159: warning: exported method Attr.Add should have comment or be unexported (golint)
    • gen/srcgen/file.go
    • Line 16: warning: exported type File should have comment or be unexported (golint)
    • Line 24: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 28: warning: exported method File.Save should have comment or be unexported (golint)
    • Line 56: warning: exported method File.WithPackname should have comment or be unexported (golint)
    • Line 61: warning: exported method File.WithFilename should have comment or be unexported (golint)
    • Line 66: warning: exported method File.AddImport should have comment or be unexported (golint)
    • Line 84: warning: exported method File.SetBuildIgnore should have comment or be unexported (golint)
    • Line 89: warning: exported method File.Bytes should have comment or be unexported (golint)
    • gen/utils/utils.go
    • Line 15: warning: exported function PackageOmitted should have comment or be unexported (golint)
    • Line 56: warning: exported function GetPackagePath should have comment or be unexported (golint)
    • Line 70: warning: exported function MergeLine should have comment or be unexported (golint)
    • Line 74: warning: exported function CommentLine should have comment or be unexported (golint)
    • Line 82: warning: exported function Hash should have comment or be unexported (golint)
    • gen/named/named.go
    • Line 7: warning: exported type Named should have comment or be unexported (golint)
    • Line 13: warning: exported function NewNamed should have comment or be unexported (golint)
    • Line 21: warning: exported method Named.GetName should have comment or be unexported (golint)
    • Line 39: warning: exported method Named.GetSubNamed should have comment or be unexported (golint)
    • gen/client/client.go
    • Line 22: warning: exported function NewGenClient should have comment or be unexported (golint)
    • Line 32: warning: exported method GenClient.SetExplode should have comment or be unexported (golint)
    • Line 37: warning: exported method GenClient.Generate should have comment or be unexported (golint)
    • gen/parser/parser.go
    • Line 30: warning: exported function NewParser should have comment or be unexported (golint)
    • Line 55: warning: exported method Parser.API should have comment or be unexported (golint)
    • Line 59: warning: exported method Parser.Import 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!