Preparing report...

Report for github.com/go-courier/codegen

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


gocyclo89%

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.


golint47%

Golint is a linter for Go source code.

    • codegen/snippet_basic.go
    • Line 12: warning: exported function Stringify should have comment or be unexported (golint)
    • Line 16: warning: exported type Snippet should have comment or be unexported (golint)
    • Line 20: warning: exported function Block should have comment or be unexported (golint)
    • Line 24: warning: exported type Body should have comment or be unexported (golint)
    • Line 26: warning: exported method Body.Bytes should have comment or be unexported (golint)
    • Line 45: warning: exported type SnippetBuiltIn should have comment or be unexported (golint)
    • Line 47: warning: exported method SnippetBuiltIn.Bytes should have comment or be unexported (golint)
    • Line 52: warning: exported const Iota should have comment (or a comment on this block) or be unexported (golint)
    • Line 61: warning: exported function Comments should have comment or be unexported (golint)
    • Line 71: warning: exported type SnippetComments should have comment or be unexported (golint)
    • Line 73: warning: exported method SnippetComments.Bytes should have comment or be unexported (golint)
    • Line 85: warning: exported var Val should have comment or be unexported (golint)
    • Line 151: warning: exported function Compose should have comment or be unexported (golint)
    • Line 158: warning: exported type SnippetCompositeLit should have comment or be unexported (golint)
    • Line 163: warning: exported method SnippetCompositeLit.Bytes should have comment or be unexported (golint)
    • Line 184: warning: exported function Lit should have comment or be unexported (golint)
    • Line 189: warning: exported type SnippetLit should have comment or be unexported (golint)
    • Line 191: warning: exported method SnippetLit.Bytes should have comment or be unexported (golint)
    • codegen/snippet_decl.go
    • Line 11: warning: exported type SnippetSpec should have comment or be unexported (golint)
    • Line 16: warning: exported function DeclConst should have comment or be unexported (golint)
    • Line 23: warning: exported function DeclVar should have comment or be unexported (golint)
    • Line 30: warning: exported function DeclType should have comment or be unexported (golint)
    • Line 37: warning: exported type SnippetTypeDecl should have comment or be unexported (golint)
    • Line 42: warning: exported method SnippetTypeDecl.Bytes should have comment or be unexported (golint)
    • Line 70: warning: exported function Var should have comment or be unexported (golint)
    • Line 77: warning: exported type SnippetField should have comment or be unexported (golint)
    • Line 87: warning: exported method SnippetField.AsAlias should have comment or be unexported (golint)
    • Line 92: warning: exported method SnippetField.WithComments should have comment or be unexported (golint)
    • Line 97: warning: exported method SnippetField.WithTag should have comment or be unexported (golint)
    • Line 102: warning: exported method SnippetField.WithTags should have comment or be unexported (golint)
    • Line 132: warning: exported method SnippetField.WithoutTag should have comment or be unexported (golint)
    • Line 137: warning: exported method SnippetField.Bytes should have comment or be unexported (golint)
    • codegen/snippet_expr.go
    • Line 9: warning: exported type SnippetExpr should have comment or be unexported (golint)
    • Line 11: warning: exported method SnippetExpr.Bytes should have comment or be unexported (golint)
    • Line 15: warning: exported var Expr should have comment or be unexported (golint)
    • Line 35: warning: exported function KeyValue should have comment or be unexported (golint)
    • Line 42: warning: exported type SnippetKeyValueExpr should have comment or be unexported (golint)
    • Line 48: warning: exported method SnippetKeyValueExpr.Bytes should have comment or be unexported (golint)
    • Line 59: warning: exported function Sel should have comment or be unexported (golint)
    • Line 66: warning: exported type SnippetSelectorExpr should have comment or be unexported (golint)
    • Line 71: warning: exported method SnippetSelectorExpr.Bytes should have comment or be unexported (golint)
    • Line 84: warning: exported type SnippetCanAddr should have comment or be unexported (golint)
    • Line 89: warning: exported function Star should have comment or be unexported (golint)
    • Line 95: warning: exported type SnippetStarExpr should have comment or be unexported (golint)
    • Line 101: warning: exported method SnippetStarExpr.Bytes should have comment or be unexported (golint)
    • Line 110: warning: exported function Unary should have comment or be unexported (golint)
    • Line 116: warning: exported type SnippetUnaryExpr should have comment or be unexported (golint)
    • Line 120: warning: exported method SnippetUnaryExpr.Bytes should have comment or be unexported (golint)
    • Line 129: warning: exported function Paren should have comment or be unexported (golint)
    • Line 135: warning: exported type SnippetParenExpr should have comment or be unexported (golint)
    • Line 140: warning: exported method SnippetParenExpr.Bytes should have comment or be unexported (golint)
    • Line 150: warning: exported function Convert should have comment or be unexported (golint)
    • Line 154: warning: exported function CallWith should have comment or be unexported (golint)
    • Line 161: warning: exported function Call should have comment or be unexported (golint)
    • Line 174: warning: exported type SnippetCallExpr should have comment or be unexported (golint)
    • Line 181: warning: exported method SnippetCallExpr.AsDefer should have comment or be unexported (golint)
    • Line 186: warning: exported method SnippetCallExpr.AsGo should have comment or be unexported (golint)
    • Line 191: warning: exported method SnippetCallExpr.WithEllipsis should have comment or be unexported (golint)
    • Line 196: warning: exported method SnippetCallExpr.Bytes should have comment or be unexported (golint)
    • Line 224: warning: exported function TypeAssert should have comment or be unexported (golint)
    • Line 231: warning: exported type SnippetTypeAssertExpr should have comment or be unexported (golint)
    • Line 236: warning: exported method SnippetTypeAssertExpr.Bytes should have comment or be unexported (golint)
    • codegen/snippet_ident.go
    • Line 10: warning: exported function Id should have comment or be unexported (golint)
    • Line 27: warning: exported function IdsFromNames should have comment or be unexported (golint)
    • Line 37: warning: exported type SnippetIdent should have comment or be unexported (golint)
    • Line 41: warning: exported method SnippetIdent.Bytes should have comment or be unexported (golint)
    • Line 45: warning: exported function IsValidIdent should have comment or be unexported (golint)
    • Line 151: warning: exported method SnippetIdent.UpperCamelCase should have comment or be unexported (golint)
    • Line 155: warning: exported method SnippetIdent.LowerCamelCase should have comment or be unexported (golint)
    • Line 159: warning: exported method SnippetIdent.UpperSnakeCase should have comment or be unexported (golint)
    • Line 163: warning: exported method SnippetIdent.LowerSnakeCase should have comment or be unexported (golint)
    • Line 167: warning: exported function UpperSnakeCase should have comment or be unexported (golint)
    • Line 177: warning: exported function LowerSnakeCase should have comment or be unexported (golint)
    • Line 187: warning: exported function UpperCamelCase should have comment or be unexported (golint)
    • Line 193: warning: exported function LowerCamelCase should have comment or be unexported (golint)
    • codegen/formatx/format.go
    • Line 12: warning: exported type Process should have comment or be unexported (golint)
    • Line 14: warning: exported function MustFormat should have comment or be unexported (golint)
    • Line 22: warning: exported function Format should have comment or be unexported (golint)
    • Line 44: warning: exported function ParseFile should have comment or be unexported (golint)
    • codegen/snippet_types.go
    • Line 10: warning: exported type SnippetType should have comment or be unexported (golint)
    • Line 15: warning: exported type ImportPathAliaser should have comment or be unexported (golint)
    • Line 17: warning: exported var TypeOf should have comment or be unexported (golint)
    • Line 57: warning: exported function Ellipsis should have comment or be unexported (golint)
    • Line 63: warning: exported type EllipsisType should have comment or be unexported (golint)
    • Line 68: warning: exported method EllipsisType.Bytes should have comment or be unexported (golint)
    • Line 77: warning: exported function Chan should have comment or be unexported (golint)
    • Line 83: warning: exported type ChanType should have comment or be unexported (golint)
    • Line 88: warning: exported method ChanType.Bytes should have comment or be unexported (golint)
    • Line 97: warning: exported function Type should have comment or be unexported (golint)
    • Line 103: warning: exported type NamedType should have comment or be unexported (golint)
    • Line 110: warning: exported method NamedType.Bytes should have comment or be unexported (golint)
    • Line 114: warning: exported function Func should have comment or be unexported (golint)
    • Line 120: warning: exported type FuncType should have comment or be unexported (golint)
    • Line 137: warning: exported method FuncType.Do should have comment or be unexported (golint)
    • Line 142: warning: exported method FuncType.Named should have comment or be unexported (golint)
    • Line 147: warning: exported method FuncType.MethodOf should have comment or be unexported (golint)
    • Line 152: warning: exported method FuncType.Return should have comment or be unexported (golint)
    • Line 157: warning: exported method FuncType.Bytes should have comment or be unexported (golint)
    • Line 211: warning: exported function Struct should have comment or be unexported (golint)
    • Line 217: warning: exported type StructType should have comment or be unexported (golint)
    • Line 222: warning: exported method StructType.Bytes should have comment or be unexported (golint)
    • Line 238: warning: exported function Interface should have comment or be unexported (golint)
    • Line 244: warning: exported type SnippetCanBeInterfaceMethod should have comment or be unexported (golint)
    • Line 248: warning: exported type InterfaceType should have comment or be unexported (golint)
    • Line 253: warning: exported method InterfaceType.Bytes should have comment or be unexported (golint)
    • Line 277: warning: exported function Map should have comment or be unexported (golint)
    • Line 284: warning: exported type MapType should have comment or be unexported (golint)
    • Line 290: warning: exported method MapType.Bytes should have comment or be unexported (golint)
    • Line 301: warning: exported function Slice should have comment or be unexported (golint)
    • Line 307: warning: exported type SliceType should have comment or be unexported (golint)
    • Line 312: warning: exported method SliceType.Bytes should have comment or be unexported (golint)
    • Line 321: warning: exported function Array should have comment or be unexported (golint)
    • Line 328: warning: exported type ArrayType should have comment or be unexported (golint)
    • Line 334: warning: exported method ArrayType.Bytes should have comment or be unexported (golint)
    • Line 343: warning: exported type BuiltInType should have comment or be unexported (golint)
    • Line 347: warning: exported method BuiltInType.Bytes should have comment or be unexported (golint)
    • Line 352: warning: exported const Bool should have comment (or a comment on this block) or be unexported (golint)
    • codegen/utils.go
    • Line 10: warning: exported function IsGoFile should have comment or be unexported (golint)
    • Line 14: warning: exported function IsGoTestFile should have comment or be unexported (golint)
    • Line 18: warning: exported function GeneratedFileSuffix should have comment or be unexported (golint)
    • Line 32: warning: exported function IsEmptyValue should have comment or be unexported (golint)
    • Line 56: warning: exported function TryCatch should have comment or be unexported (golint)
    • codegen/file.go
    • Line 17: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 24: warning: exported type File should have comment or be unexported (golint)
    • Line 31: warning: exported method File.WriteBlock should have comment or be unexported (golint)
    • Line 38: warning: exported method File.Bytes should have comment or be unexported (golint)
    • Line 63: warning: exported method File.Expr should have comment or be unexported (golint)
    • Line 67: warning: exported method File.TypeOf should have comment or be unexported (golint)
    • Line 71: warning: exported method File.Val should have comment or be unexported (golint)
    • Line 93: warning: exported method File.Use should have comment or be unexported (golint)
    • Line 102: warning: exported method File.WriteFile should have comment or be unexported (golint)
    • codegen/snippet_stmt.go
    • Line 8: warning: exported function Select should have comment or be unexported (golint)
    • Line 14: warning: exported type SnippetSelectStmt should have comment or be unexported (golint)
    • Line 18: warning: exported method SnippetSelectStmt.Bytes should have comment or be unexported (golint)
    • Line 34: warning: exported function Switch should have comment or be unexported (golint)
    • Line 40: warning: exported type SnippetSwitchStmt should have comment or be unexported (golint)
    • Line 46: warning: exported method SnippetSwitchStmt.InitWith should have comment or be unexported (golint)
    • Line 51: warning: exported method SnippetSwitchStmt.When should have comment or be unexported (golint)
    • Line 56: warning: exported method SnippetSwitchStmt.Bytes should have comment or be unexported (golint)
    • Line 83: warning: exported function Clause should have comment or be unexported (golint)
    • Line 89: warning: exported type SnippetClause should have comment or be unexported (golint)
    • Line 94: warning: exported method SnippetClause.Do should have comment or be unexported (golint)
    • Line 99: warning: exported method SnippetClause.Bytes should have comment or be unexported (golint)
    • Line 126: warning: exported function ForRange should have comment or be unexported (golint)
    • Line 144: warning: exported type SnippetRangeStmt should have comment or be unexported (golint)
    • Line 151: warning: exported method SnippetRangeStmt.Do should have comment or be unexported (golint)
    • Line 156: warning: exported method SnippetRangeStmt.Bytes should have comment or be unexported (golint)
    • Line 185: warning: exported function For should have comment or be unexported (golint)
    • Line 193: warning: exported type SnippetForStmt should have comment or be unexported (golint)
    • Line 200: warning: exported method SnippetForStmt.Do should have comment or be unexported (golint)
    • Line 205: warning: exported method SnippetForStmt.Bytes should have comment or be unexported (golint)
    • Line 233: warning: exported function If should have comment or be unexported (golint)
    • Line 239: warning: exported type SnippetIfStmt should have comment or be unexported (golint)
    • Line 247: warning: exported method SnippetIfStmt.InitWith should have comment or be unexported (golint)
    • Line 252: warning: exported method SnippetIfStmt.WithoutInit should have comment or be unexported (golint)
    • Line 257: warning: exported method SnippetIfStmt.Else should have comment or be unexported (golint)
    • Line 262: warning: exported method SnippetIfStmt.Do should have comment or be unexported (golint)
    • Line 267: warning: exported method SnippetIfStmt.Bytes should have comment or be unexported (golint)
    • Line 299: warning: exported function Define should have comment or be unexported (golint)
    • Line 306: warning: exported function Assign should have comment or be unexported (golint)
    • Line 313: warning: exported function AssignWith should have comment or be unexported (golint)
    • Line 320: warning: exported type SnippetAssignStmt should have comment or be unexported (golint)
    • Line 327: warning: exported method SnippetAssignStmt.By should have comment or be unexported (golint)
    • Line 332: warning: exported method SnippetAssignStmt.Bytes should have comment or be unexported (golint)
    • Line 360: warning: exported function Return should have comment or be unexported (golint)
    • Line 366: warning: exported type SnippetReturnStmt should have comment or be unexported (golint)
    • Line 370: warning: exported method SnippetReturnStmt.Bytes 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!