Preparing report...

Report for github.com/go-ego/ego

A+    Excellent!    Found 41 issues across 107 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!


golint66%

Golint is a linter for Go source code.

    • ego/mid/render/yaml.go
    • Line 13: warning: exported type YAML should have comment or be unexported (golint)
    • Line 19: warning: exported method YAML.Render should have comment or be unexported (golint)
    • Line 31: warning: exported method YAML.WriteContentType should have comment or be unexported (golint)
    • ego/base.go
    • Line 28: warning: exported function Try should have comment or be unexported (golint)
    • Line 37: warning: exported function CheckErr should have comment or be unexported (golint)
    • Line 43: warning: exported function ListFile should have comment or be unexported (golint)
    • Line 62: warning: exported function ListDir should have comment or be unexported (golint)
    • Line 190: warning: exported var Url should have comment or be unexported (golint)
    • ego/examples/realtime-advanced/main.go
    • Line 16: warning: exported function ConfigRuntime should have comment or be unexported (golint)
    • Line 22: warning: exported function StartWorkers should have comment or be unexported (golint)
    • Line 26: warning: exported function StartEgo should have comment or be unexported (golint)
    • ego/mid/rego/color.go
    • Line 17: warning: exported function Colorize should have comment or be unexported (golint)
    • Line 36: warning: exported type ColorCode should have comment or be unexported (golint)
    • Line 64: warning: exported function Black should have comment or be unexported (golint)
    • Line 68: warning: exported function RedArr should have comment or be unexported (golint)
    • Line 76: warning: exported function Red should have comment or be unexported (golint)
    • Line 80: warning: exported function Dred should have comment or be unexported (golint)
    • Line 84: warning: exported function Green should have comment or be unexported (golint)
    • Line 88: warning: exported function Btextn should have comment or be unexported (golint)
    • Line 92: warning: exported function Navy should have comment or be unexported (golint)
    • Line 96: warning: exported function Purple should have comment or be unexported (golint)
    • Line 100: warning: exported function Cyan should have comment or be unexported (golint)
    • Line 104: warning: exported function Gray should have comment or be unexported (golint)
    • Line 108: warning: exported function Dim should have comment or be unexported (golint)
    • Line 112: warning: exported function Orange should have comment or be unexported (golint)
    • Line 116: warning: exported function Lime should have comment or be unexported (golint)
    • Line 120: warning: exported function Yellow should have comment or be unexported (golint)
    • Line 124: warning: exported function Blue should have comment or be unexported (golint)
    • Line 128: warning: exported function Pink should have comment or be unexported (golint)
    • Line 132: warning: exported function Aqua should have comment or be unexported (golint)
    • Line 136: warning: exported function Lblue should have comment or be unexported (golint)
    • Line 140: warning: exported function White should have comment or be unexported (golint)
    • Line 148: warning: exported function Uline should have comment or be unexported (golint)
    • Line 152: warning: exported function Display should have comment or be unexported (golint)
    • ego/mid/render/data.go
    • Line 9: warning: exported type Data should have comment or be unexported (golint)
    • Line 21: warning: exported method Data.WriteContentType should have comment or be unexported (golint)
    • ego/mid/render/json.go
    • Line 16: warning: exported type JSON should have comment or be unexported (golint)
    • Line 20: warning: exported type IndentedJSON should have comment or be unexported (golint)
    • Line 24: warning: exported type SecureJSON should have comment or be unexported (golint)
    • Line 29: warning: exported type JsonpJSON should have comment or be unexported (golint)
    • Line 34: warning: exported type AsciiJSON should have comment or be unexported (golint)
    • Line 38: warning: exported type SecureJSONPrefix should have comment or be unexported (golint)
    • Line 46: warning: exported method JSON.Render should have comment or be unexported (golint)
    • Line 53: warning: exported method JSON.WriteContentType should have comment or be unexported (golint)
    • Line 57: warning: exported function WriteJSON should have comment or be unexported (golint)
    • Line 67: warning: exported method IndentedJSON.Render should have comment or be unexported (golint)
    • Line 77: warning: exported method IndentedJSON.WriteContentType should have comment or be unexported (golint)
    • Line 81: warning: exported method SecureJSON.Render should have comment or be unexported (golint)
    • Line 95: warning: exported method SecureJSON.WriteContentType should have comment or be unexported (golint)
    • Line 99: warning: exported method JsonpJSON.Render should have comment or be unexported (golint)
    • Line 120: warning: exported method JsonpJSON.WriteContentType should have comment or be unexported (golint)
    • Line 124: warning: exported method AsciiJSON.Render should have comment or be unexported (golint)
    • Line 146: warning: exported method AsciiJSON.WriteContentType should have comment or be unexported (golint)
    • ego/mid/render/xml.go
    • Line 12: warning: exported type XML should have comment or be unexported (golint)
    • Line 18: warning: exported method XML.Render should have comment or be unexported (golint)
    • Line 23: warning: exported method XML.WriteContentType should have comment or be unexported (golint)
    • ego/mid/rego/trim.go
    • Line 19: warning: exported function TrimNotes should have comment or be unexported (golint)
    • Line 27: warning: exported function TrimSlot should have comment or be unexported (golint)
    • Line 33: warning: exported function TrimQ should have comment or be unexported (golint)
    • Line 44: warning: exported function TrimTVal should have comment or be unexported (golint)
    • Line 61: warning: exported function TrimVal should have comment or be unexported (golint)
    • Line 74: warning: exported function Quotation should have comment or be unexported (golint)
    • Line 80: warning: exported function TrimQt should have comment or be unexported (golint)
    • Line 85: warning: exported function TrimB should have comment or be unexported (golint)
    • Line 90: warning: comment on exported function TrimBlank should be of the form "TrimBlank ..." (golint)
    • Line 97: warning: exported function TrimIs should have comment or be unexported (golint)
    • Line 107: warning: exported function TrimS should have comment or be unexported (golint)
    • Line 113: warning: exported function TrimBrace should have comment or be unexported (golint)
    • Line 119: warning: exported function TBrace should have comment or be unexported (golint)
    • ego/mid/util/errors.go
    • Line 15: warning: exported type Map should have comment or be unexported (golint)
    • Line 17: warning: exported type ErrorType should have comment or be unexported (golint)
    • Line 20: warning: exported const ErrorTypeBind should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type Error should have comment or be unexported (golint)
    • Line 36: warning: exported type ErrorMsgs should have comment or be unexported (golint)
    • Line 41: warning: exported method Error.SetType should have comment or be unexported (golint)
    • Line 46: warning: exported method Error.SetMeta should have comment or be unexported (golint)
    • Line 51: warning: exported method Error.JSON should have comment or be unexported (golint)
    • Line 83: warning: exported method Error.IsType should have comment or be unexported (golint)
    • Line 133: warning: exported method ErrorMsgs.JSON should have comment or be unexported (golint)
    • Line 148: warning: exported method ErrorMsgs.MarshalJSON should have comment or be unexported (golint)
    • ego/mid/render/msgpack.go
    • Line 13: warning: exported type MsgPack should have comment or be unexported (golint)
    • Line 19: warning: exported method MsgPack.WriteContentType should have comment or be unexported (golint)
    • Line 23: warning: exported method MsgPack.Render should have comment or be unexported (golint)
    • Line 27: warning: exported function WriteMsgPack should have comment or be unexported (golint)
    • ego/mid/rego/tag.go
    • Line 115: warning: exported function FindDiv should have comment or be unexported (golint)
    • Line 121: warning: exported function FindLabel should have comment or be unexported (golint)
    • Line 127: warning: exported function FindTag should have comment or be unexported (golint)
    • ego/mid/render/redirect.go
    • Line 12: warning: exported type Redirect should have comment or be unexported (golint)
    • Line 18: warning: exported method Redirect.Render should have comment or be unexported (golint)
    • Line 26: warning: exported method Redirect.WriteContentType should have comment or be unexported (golint)
    • ego/mid/render/text.go
    • Line 13: warning: exported type String should have comment or be unexported (golint)
    • Line 20: warning: exported method String.Render should have comment or be unexported (golint)
    • Line 25: warning: exported method String.WriteContentType should have comment or be unexported (golint)
    • Line 29: warning: exported function WriteString should have comment or be unexported (golint)
    • ego/mid/render/ffjson.go
    • Line 11: warning: exported type FFJSON should have comment or be unexported (golint)
    • Line 15: warning: exported type FFIndentedJSON should have comment or be unexported (golint)
    • Line 20: warning: exported method FFJSON.Render should have comment or be unexported (golint)
    • Line 27: warning: exported method FFJSON.WriteContentType should have comment or be unexported (golint)
    • Line 31: warning: exported function FFWriteJSON should have comment or be unexported (golint)
    • Line 41: warning: exported method FFIndentedJSON.Render should have comment or be unexported (golint)
    • Line 51: warning: exported method FFIndentedJSON.WriteContentType should have comment or be unexported (golint)
    • ego/routergroup.go
    • Line 28: warning: exported type IRouter should have comment or be unexported (golint)
    • Line 33: warning: exported type IRoutes should have comment or be unexported (golint)
    • Line 82: warning: exported method RouterGroup.BasePath should have comment or be unexported (golint)
    • Line 185: warning: exported method RouterGroup.StaticT should have comment or be unexported (golint)
    • Line 252: warning: comment on exported method RouterGroup.GoGroup should be of the form "GoGroup ..." (golint)
    • Line 259: warning: exported function UseRenders should have comment or be unexported (golint)
    • Line 290: warning: comment on exported method RouterGroup.EgoGroup should be of the form "EgoGroup ..." (golint)
    • ego/egoS/egos.go
    • Line 5: warning: don't use MixedCaps in package name; egoS should be egos (golint)
    • Line 27: warning: exported function LoadHTMLGlob should have comment or be unexported (golint)
    • Line 31: warning: exported function LoadHTMLFiles should have comment or be unexported (golint)
    • Line 35: warning: exported function SetHTMLTemplate should have comment or be unexported (golint)
    • Line 55: warning: exported function Handle should have comment or be unexported (golint)
    • Line 94: warning: exported function Any should have comment or be unexported (golint)
    • Line 98: warning: exported function StaticFile should have comment or be unexported (golint)
    • Line 112: warning: exported function StaticFS should have comment or be unexported (golint)
    • ego/mid/rego/find.go
    • Line 19: warning: exported function FindIf should have comment or be unexported (golint)
    • Line 25: warning: exported function FindS should have comment or be unexported (golint)
    • Line 31: warning: exported function FindSty should have comment or be unexported (golint)
    • Line 37: warning: exported function FindScr should have comment or be unexported (golint)
    • Line 43: warning: exported function Brace should have comment or be unexported (golint)
    • Line 49: warning: exported function KeyBrace should have comment or be unexported (golint)
    • Line 55: warning: exported function ImpBrace should have comment or be unexported (golint)
    • Line 61: warning: exported function FindaKey should have comment or be unexported (golint)
    • Line 72: warning: exported function FindKey should have comment or be unexported (golint)
    • Line 86: warning: exported function FindNoVal should have comment or be unexported (golint)
    • Line 92: warning: exported function FindBVal should have comment or be unexported (golint)
    • Line 109: warning: exported function FindQVal should have comment or be unexported (golint)
    • Line 121: warning: exported function FindVal should have comment or be unexported (golint)
    • Line 136: warning: exported function FindArrVal should have comment or be unexported (golint)
    • ego/mid/rego/fn.go
    • Line 20: warning: exported type Map should have comment or be unexported (golint)
    • Line 79: warning: exported function ReRegOne should have comment or be unexported (golint)
    • Line 95: warning: exported function ReRegNil should have comment or be unexported (golint)
    • Line 113: warning: exported function ReReg should have comment or be unexported (golint)
    • Line 129: warning: exported function ReArro should have comment or be unexported (golint)
    • Line 143: warning: exported function ReArrOne should have comment or be unexported (golint)
    • Line 157: warning: exported function ReArr should have comment or be unexported (golint)
    • Line 185: warning: exported function PrintErr should have comment or be unexported (golint)
    • ego/mid/render/reader.go
    • Line 9: warning: exported type Reader should have comment or be unexported (golint)
    • Line 25: warning: exported method Reader.WriteContentType should have comment or be unexported (golint)
    • ego/context.go
    • Line 658: warning: exported method Context.RequestHeader should have comment or be unexported (golint)
    • Line 746: warning: exported method Context.Render should have comment or be unexported (golint)
    • Line 889: warning: exported method Context.Stream should have comment or be unexported (golint)
    • Line 910: warning: exported type Negotiate should have comment or be unexported (golint)
    • Line 919: warning: exported method Context.Negotiate should have comment or be unexported (golint)
    • Line 938: warning: exported method Context.NegotiateFormat should have comment or be unexported (golint)
    • Line 957: warning: exported method Context.SetAccepted should have comment or be unexported (golint)
    • ego/ego.go
    • Line 54: warning: exported type HandlerFunc should have comment or be unexported (golint)
    • Line 55: warning: exported type HandlersChain should have comment or be unexported (golint)
    • Line 57: warning: exported type RoutesInfo should have comment or be unexported (golint)
    • Line 68: warning: exported type RouteInfo should have comment or be unexported (golint)
    • Line 189: warning: exported method Engine.Delims should have comment or be unexported (golint)
    • ego/mid/render/html.go
    • Line 12: warning: exported type Delims should have comment or be unexported (golint)
    • Line 17: warning: exported type HTMLRender should have comment or be unexported (golint)
    • Line 21: warning: exported type HTMLProduction should have comment or be unexported (golint)
    • Line 26: warning: exported type HTMLDebug should have comment or be unexported (golint)
    • Line 33: warning: exported type HTML should have comment or be unexported (golint)
    • Line 41: warning: exported method HTMLProduction.Instance should have comment or be unexported (golint)
    • Line 49: warning: exported method HTMLDebug.Instance should have comment or be unexported (golint)
    • Line 69: warning: exported method HTML.Render should have comment or be unexported (golint)
    • Line 78: warning: exported method HTML.WriteContentType should have comment or be unexported (golint)
    • ego/mid/render/jsoniter.go
    • Line 12: warning: exported type IJSON should have comment or be unexported (golint)
    • Line 16: warning: exported type IIndentedJSON should have comment or be unexported (golint)
    • Line 20: warning: exported type ISecureJSON should have comment or be unexported (golint)
    • Line 25: warning: exported type ISecureJSONPrefix should have comment or be unexported (golint)
    • Line 29: warning: exported method IJSON.Render should have comment or be unexported (golint)
    • Line 36: warning: exported method IJSON.WriteContentType should have comment or be unexported (golint)
    • Line 40: warning: exported function IWriteJSON should have comment or be unexported (golint)
    • Line 50: warning: exported method IIndentedJSON.Render should have comment or be unexported (golint)
    • Line 60: warning: exported method IIndentedJSON.WriteContentType should have comment or be unexported (golint)
    • Line 64: warning: exported method ISecureJSON.Render should have comment or be unexported (golint)
    • Line 78: warning: exported method ISecureJSON.WriteContentType should have comment or be unexported (golint)
    • ego/mid/rego/file.go
    • Line 28: warning: exported function PathExists should have comment or be unexported (golint)
    • Line 39: warning: exported function CopyFile should have comment or be unexported (golint)
    • Line 58: warning: exported function CopyOFile should have comment or be unexported (golint)
    • Line 73: warning: exported function Readfile should have comment or be unexported (golint)
    • Line 99: warning: exported function Writefile should have comment or be unexported (golint)
    • Line 112: warning: exported function ListFile should have comment or be unexported (golint)
    • Line 131: warning: exported function ListDir should have comment or be unexported (golint)
    • Line 150: warning: exported function WalkFile should have comment or be unexported (golint)
    • Line 166: warning: exported function WalkDir should have comment or be unexported (golint)
    • ego/utils.go
    • Line 18: warning: exported const BindKey should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported function Bind should have comment or be unexported (golint)
    • ego/docs/doc.go
    • Line 6: warning: package comment is detached; there should be no blank lines between it and the package statement (golint)
    • ego/mid/rego/import.go
    • Line 22: warning: exported function FindImp should have comment or be unexported (golint)
    • Line 30: warning: exported function IsImp should have comment or be unexported (golint)
    • Line 43: warning: exported type Tag should have comment or be unexported (golint)
    • Line 145: warning: exported function ImpMap should have comment or be unexported (golint)
    • Line 277: warning: exported function UnuseRand should have comment or be unexported (golint)
    • Line 281: warning: comment on exported function ImpClass should be of the form "ImpClass ..." (golint)
    • Line 301: warning: exported function ImpName should have comment or be unexported (golint)
    • Line 309: warning: exported function TrimName should have comment or be unexported (golint)
    • Line 321: warning: exported function ImpStr should have comment or be unexported (golint)
    • Line 336: warning: exported function WHtml should have comment or be unexported (golint)
    • Line 377: warning: exported function ImpHtml should have comment or be unexported (golint)
    • ego/mode.go
    • Line 18: warning: exported const DebugMode should have comment (or a comment on this block) or be unexported (golint)
    • Line 38: warning: exported var DefaultErrorWriter should have comment or be unexported (golint)
    • Line 67: warning: exported function DisableBindValidation should have comment or be unexported (golint)
    • Line 71: warning: exported function EnableJsonDecoderUseNumber should have comment or be unexported (golint)
    • Line 75: warning: exported function Mode should have comment or be unexported (golint)

gocyclo92%

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.

    • ego/tree.go
    • Line 365: warning: cyclomatic complexity 38 of function (*node).getValue() is high (> 15) (gocyclo)
    • Line 507: warning: cyclomatic complexity 38 of function (*node).findCaseInsensitivePath() is high (> 15) (gocyclo)
    • Line 125: warning: cyclomatic complexity 26 of function (*node).addRoute() is high (> 15) (gocyclo)
    • Line 247: warning: cyclomatic complexity 18 of function (*node).insertChild() is high (> 15) (gocyclo)
    • ego/tree_test.go
    • Line 520: warning: cyclomatic complexity 19 of function TestTreeFindCaseInsensitivePath() is high (> 15) (gocyclo)
    • ego/ego.go
    • Line 393: warning: cyclomatic complexity 16 of function (*Engine).handleHTTPRequest() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!