Preparing report...

Report for github.com/zbysir/go-vue-ssr

D    Needs lots of improvement    Found 36 issues across 56 files

Tweet

gofmt0%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

An error occurred while running this test (AddError: could not parse "_repos/src/github.com/zbysir/go-vue-ssr/internal/pkg/html/fatal error: runtime: out of memory:1::warning: file is not gofmted with -s (gofmt)" - strconv.Atoi: parsing " runtime": invalid syntax)


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!


gocyclo78%

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.

    • go-vue-ssr/internal/pkg/html/token.go
    • Line 392: warning: cyclomatic complexity 50 of function (*Tokenizer).readScript() is high (> 15) (gocyclo)
    • Line 949: warning: cyclomatic complexity 31 of function (*Tokenizer).Next() is high (> 15) (gocyclo)
    • Line 887: warning: cyclomatic complexity 16 of function (*Tokenizer).readTagAttrVal() is high (> 15) (gocyclo)
    • go-vue-ssr/internal/pkg/html/parse.go
    • Line 839: warning: cyclomatic complexity 114 of function inBodyIM() is high (> 15) (gocyclo)
    • Line 1391: warning: cyclomatic complexity 30 of function inTableIM() is high (> 15) (gocyclo)
    • Line 1755: warning: cyclomatic complexity 28 of function inSelectIM() is high (> 15) (gocyclo)
    • Line 1185: warning: cyclomatic complexity 27 of function (*parser).inBodyEndTagFormatting() is high (> 15) (gocyclo)
    • Line 2124: warning: cyclomatic complexity 25 of function parseForeignContent() is high (> 15) (gocyclo)
    • Line 622: warning: cyclomatic complexity 24 of function inHeadIM() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 24 of function (*parser).resetInsertionMode() is high (> 15) (gocyclo)
    • Line 109: warning: cyclomatic complexity 22 of function (*parser).indexOfElementInScope() is high (> 15) (gocyclo)
    • Line 161: warning: cyclomatic complexity 17 of function (*parser).clearStackToContext() is high (> 15) (gocyclo)
    • Line 1542: warning: cyclomatic complexity 17 of function inColumnGroupIM() is high (> 15) (gocyclo)
    • Line 1864: warning: cyclomatic complexity 17 of function inTemplateIM() is high (> 15) (gocyclo)
    • Line 2215: warning: cyclomatic complexity 16 of function (*parser).inForeignContent() is high (> 15) (gocyclo)
    • Line 762: warning: cyclomatic complexity 16 of function afterHeadIM() is high (> 15) (gocyclo)

golint48%

Golint is a linter for Go source code.

    • go-vue-ssr/internal/pkg/encoder/base64.go
    • Line 9: warning: exported function Base64Encode should have comment or be unexported (golint)
    • Line 15: warning: exported function Base64Decode should have comment or be unexported (golint)
    • Line 27: warning: comment on exported function Base64DecodeString should be of the form "Base64DecodeString ..." (golint)
    • Line 50: warning: exported function Base64EncodeString should have comment or be unexported (golint)
    • go-vue-ssr/internal/pkg/log/log.go
    • Line 11: warning: exported function Debug should have comment or be unexported (golint)
    • Line 12: warning: exported function Info should have comment or be unexported (golint)
    • Line 13: warning: exported function Warning should have comment or be unexported (golint)
    • Line 14: warning: exported function Error should have comment or be unexported (golint)
    • Line 15: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 16: warning: exported function Panic should have comment or be unexported (golint)
    • Line 18: warning: exported function Debugf should have comment or be unexported (golint)
    • Line 19: warning: exported function Infof should have comment or be unexported (golint)
    • Line 20: warning: exported function Warningf should have comment or be unexported (golint)
    • Line 21: warning: exported function Errorf should have comment or be unexported (golint)
    • Line 22: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 23: warning: exported function Panicf should have comment or be unexported (golint)
    • Line 25: warning: comment on exported function Errorf2 should be of the form "Errorf2 ..." (golint)
    • Line 31: warning: exported function Warningf2 should have comment or be unexported (golint)
    • Line 36: warning: exported function Native should have comment or be unexported (golint)
    • Line 44: warning: comment on exported function Init should be of the form "Init ..." (golint)
    • Line 49: warning: comment on exported function SetDebug should be of the form "SetDebug ..." (golint)
    • Line 55: warning: exported function New should have comment or be unexported (golint)
    • Line 75: warning: comment on exported function New2 should be of the form "New2 ..." (golint)
    • go-vue-ssr/pkg/ssrtool/rjson/json.go
    • Line 13: warning: exported function Get should have comment or be unexported (golint)
    • Line 36: warning: exported function GetBool should have comment or be unexported (golint)
    • Line 64: warning: exported function GetStr should have comment or be unexported (golint)
    • Line 72: warning: comment on exported function GetStrObscure should be of the form "GetStrObscure ..." (golint)
    • Line 92: warning: exported function GetNumber should have comment or be unexported (golint)
    • go-vue-ssr/internal/pkg/http/http.go
    • Line 14: warning: exported type Client should have comment or be unexported (golint)
    • Line 19: warning: comment on exported method Client.Request should be of the form "Request ..." (golint)
    • Line 62: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 69: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 73: warning: exported method Client.Post should have comment or be unexported (golint)
    • Line 77: warning: exported method Client.Put should have comment or be unexported (golint)
    • Line 81: warning: exported method Client.Delete should have comment or be unexported (golint)
    • Line 85: warning: exported function NewClient should have comment or be unexported (golint)
    • go-vue-ssr/internal/pkg/errors/coder.go
    • Line 13: warning: comment on exported type ErrorCoder should be of the form "ErrorCoder ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported type GRPCStatuser should be of the form "GRPCStatuser ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported type ErrorCode should be of the form "ErrorCode ..." (with optional leading article) (golint)
    • Line 40: warning: exported const Separator should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported function Unmarshal should have comment or be unexported (golint)
    • Line 71: warning: comment on exported method ErrorCode.Msg should be of the form "Msg ..." (golint)
    • Line 79: warning: exported method ErrorCode.Code should have comment or be unexported (golint)
    • Line 85: warning: exported method ErrorCode.Where should have comment or be unexported (golint)
    • Line 92: warning: exported type CallDepth should have comment or be unexported (golint)
    • Line 94: warning: exported type ExtendMsg should have comment or be unexported (golint)
    • Line 210: warning: exported function NewCoderWhere should have comment or be unexported (golint)
    • Line 214: warning: exported function NewCodere should have comment or be unexported (golint)
    • Line 224: warning: exported function Extend should have comment or be unexported (golint)
    • Line 228: warning: comment on exported function Concat should be of the form "Concat ..." (golint)
    • Line 275: warning: comment on exported function WrapWhere should be of the form "WrapWhere ..." (golint)
    • Line 294: warning: exported function New should have comment or be unexported (golint)
    • go-vue-ssr/internal/pkg/html/token.go
    • Line 24: warning: comment on exported const StartTagToken should be of the form "StartTagToken ..." (golint)
    • Line 26: warning: comment on exported const EndTagToken should be of the form "EndTagToken ..." (golint)
    • Line 28: warning: comment on exported const SelfClosingTagToken should be of the form "SelfClosingTagToken ..." (golint)
    • Line 30: warning: comment on exported const CommentToken should be of the form "CommentToken ..." (golint)
    • Line 32: warning: comment on exported const DoctypeToken should be of the form "DoctypeToken ..." (golint)
    • go-vue-ssr/pkg/ssrtool/rinterface/interface.go
    • Line 9: warning: comment on exported function ToStr should be of the form "ToStr ..." (golint)
    • Line 24: warning: exported function ToInt should have comment or be unexported (golint)
    • Line 43: warning: exported function ToSliceInt should have comment or be unexported (golint)
    • Line 52: warning: exported function ToSlice should have comment or be unexported (golint)
    • Line 90: warning: comment on exported function ToBool should be of the form "ToBool ..." (golint)
    • Line 107: warning: exported function ToFloat should have comment or be unexported (golint)
    • go-vue-ssr/pkg/vuessr/parser/html.go
    • Line 7: warning: exported type HtmlParser should have comment or be unexported (golint)
    • Line 11: warning: exported type Element should have comment or be unexported (golint)
    • Line 20: warning: exported type NodeType should have comment or be unexported (golint)
    • Line 23: warning: exported const TextNode should have comment (or a comment on this block) or be unexported (golint)
    • go-vue-ssr/internal/pkg/encoder/hash.go
    • Line 9: warning: exported function Sha256 should have comment or be unexported (golint)
    • Line 17: warning: exported function Hash should have comment or be unexported (golint)
    • Line 26: warning: exported function HashString should have comment or be unexported (golint)
    • go-vue-ssr/pkg/vuessr/generotor_builtin_source/source.go
    • Line 17: warning: exported type Render should have comment or be unexported (golint)
    • Line 34: warning: exported method Render.NewWriter should have comment or be unexported (golint)
    • Line 38: warning: comment on exported method Render.Render should be of the form "Render ..." (golint)
    • Line 47: warning: comment on exported type RenderCreator should be of the form "RenderCreator ..." (with optional leading article) (golint)
    • Line 59: warning: exported method RenderCreator.NewRender should have comment or be unexported (golint)
    • Line 69: warning: comment on exported method RenderCreator.Directive should be of the form "Directive ..." (golint)
    • Line 74: warning: comment on exported method RenderCreator.Func should be of the form "Func ..." (golint)
    • Line 100: warning: exported type Store should have comment or be unexported (golint)
    • Line 102: warning: exported method Store.Get should have comment or be unexported (golint)
    • Line 106: warning: exported method Store.Set should have comment or be unexported (golint)
    • Line 110: warning: exported type Global should have comment or be unexported (golint)
    • Line 114: warning: exported method Global.Func should have comment or be unexported (golint)
    • Line 118: warning: exported method Global.Var should have comment or be unexported (golint)
    • Line 122: warning: comment on exported type Function should be of the form "Function ..." (with optional leading article) (golint)
    • Line 128: warning: exported type DirectivesBinding should have comment or be unexported (golint)
    • Line 134: warning: exported type DirectivesFunc should have comment or be unexported (golint)
    • Line 143: warning: comment on exported type Scope should be of the form "Scope ..." (with optional leading article) (golint)
    • Line 149: warning: exported method Scope.ParentScope should have comment or be unexported (golint)
    • Line 153: warning: comment on exported method Scope.Set should be of the form "Set ..." (golint)
    • Line 159: warning: comment on exported method Scope.Find should be of the form "Find ..." (golint)
    • Line 173: warning: exported function NewScope should have comment or be unexported (golint)
    • Line 187: warning: comment on exported method Scope.Get should be of the form "Get ..." (golint)
    • Line 200: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 211: warning: exported type Writer should have comment or be unexported (golint)
    • Line 219: warning: exported type Span should have comment or be unexported (golint)
    • Line 223: warning: comment on exported type BufferSpan should be of the form "BufferSpan ..." (with optional leading article) (golint)
    • Line 228: warning: exported method BufferSpan.Result should have comment or be unexported (golint)
    • Line 232: warning: exported method BufferSpan.WriteString should have comment or be unexported (golint)
    • Line 236: warning: exported function NewBufferSpan should have comment or be unexported (golint)
    • Line 244: warning: comment on exported type BufferWriter should be of the form "BufferWriter ..." (with optional leading article) (golint)
    • Line 249: warning: exported method BufferWriter.WriteSpan should have comment or be unexported (golint)
    • Line 253: warning: exported method BufferWriter.WriteString should have comment or be unexported (golint)
    • Line 257: warning: exported method BufferWriter.Result should have comment or be unexported (golint)
    • Line 261: warning: exported function NewBufferSpans should have comment or be unexported (golint)
    • Line 268: warning: comment on exported type ListSpans should be of the form "ListSpans ..." (with optional leading article) (golint)
    • Line 275: warning: exported method ListSpans.WriteSpans should have comment or be unexported (golint)
    • Line 308: warning: exported method ListSpans.WriteString should have comment or be unexported (golint)
    • Line 308: warning: receiver name l should be consistent with previous receiver name p for ListSpans (golint)
    • Line 312: warning: exported method ListSpans.WriteSpan should have comment or be unexported (golint)
    • Line 336: warning: exported method ListSpans.Result should have comment or be unexported (golint)
    • Line 336: warning: receiver name l should be consistent with previous receiver name p for ListSpans (golint)
    • Line 350: warning: exported method ListSpans.Length should have comment or be unexported (golint)
    • Line 350: warning: receiver name l should be consistent with previous receiver name p for ListSpans (golint)
    • Line 363: warning: exported function NewListSpans should have comment or be unexported (golint)
    • Line 367: warning: exported type ChanSpan should have comment or be unexported (golint)
    • Line 374: warning: exported method ChanSpan.Result should have comment or be unexported (golint)
    • Line 381: warning: exported method ChanSpan.Done should have comment or be unexported (golint)
    • Line 387: warning: exported function NewChanSpan should have comment or be unexported (golint)
    • Line 498: warning: exported type Attribute should have comment or be unexported (golint)
    • Line 502: warning: exported type Attributes should have comment or be unexported (golint)
    • Line 504: warning: exported method Attributes.Get should have comment or be unexported (golint)
    • Line 514: warning: exported method Attributes.Append should have comment or be unexported (golint)
    • Line 518: warning: comment on exported type Options should be of the form "Options ..." (with optional leading article) (golint)
    • Line 545: warning: exported method Options.SetProvide should have comment or be unexported (golint)
    • Line 557: warning: comment on exported method Options.GetProvide should be of the form "GetProvide ..." (golint)
    • Line 600: warning: exported type Props should have comment or be unexported (golint)
    • Line 605: warning: exported method Props.Del should have comment or be unexported (golint)
    • Line 616: warning: exported method Props.Set should have comment or be unexported (golint)
    • Line 629: warning: exported method Props.Get should have comment or be unexported (golint)
    • Line 638: warning: comment on exported method Props.Map should be of the form "Map ..." (golint)
    • Line 643: warning: exported function NewProps should have comment or be unexported (golint)
    • Line 650: warning: comment on exported method Props.CanBeAttr should be of the form "CanBeAttr ..." (golint)
    • Line 674: warning: exported type Slots should have comment or be unexported (golint)
    • Line 676: warning: exported method Slots.Exec should have comment or be unexported (golint)
    • Line 688: warning: comment on exported type ComponentFunc should be of the form "ComponentFunc ..." (with optional leading article) (golint)
    • Line 691: warning: comment on exported type NamedSlotFunc should be of the form "NamedSlotFunc ..." (with optional leading article) (golint)
    • Line 695: warning: exported method NamedSlotFunc.Exec should have comment or be unexported (golint)
    • go-vue-ssr/internal/pkg/signal/context.go
    • Line 10: warning: exported type Context should have comment or be unexported (golint)
    • Line 15: warning: comment on exported function NewContext should be of the form "NewContext ..." (golint)
    • Line 32: warning: comment on exported function NewTermContext should be of the form "NewTermContext ..." (golint)
    • go-vue-ssr/pkg/vuessr/compiler.go
    • Line 13: warning: exported type Compiler should have comment or be unexported (golint)
    • Line 20: warning: exported type Prop should have comment or be unexported (golint)
    • Line 24: warning: exported type Props should have comment or be unexported (golint)
    • Line 26: warning: exported method Props.Get should have comment or be unexported (golint)
    • Line 35: warning: exported method Props.Del should have comment or be unexported (golint)
    • Line 44: warning: comment on exported type OptionsGen should be of the form "OptionsGen ..." (with optional leading article) (golint)
    • Line 147: warning: comment on exported method OptionsGen.ToGoCode should be of the form "ToGoCode ..." (golint)
    • Line 228: warning: comment on exported method OptionsGen.ToGoCodeForRoot should be of the form "ToGoCodeForRoot ..." (golint)
    • Line 317: warning: exported type Code should have comment or be unexported (golint)
    • Line 354: warning: comment on exported method Compiler.GenEleCode should be of the form "GenEleCode ..." (golint)
    • Line 625: warning: exported function NewCompiler should have comment or be unexported (golint)
    • Line 631: warning: exported method Compiler.AddComponent should have comment or be unexported (golint)
    • Line 631: warning: receiver name a should be consistent with previous receiver name c for Compiler (golint)
    • go-vue-ssr/pkg/vuessr/generator.go
    • Line 139: warning: exported type VueFile should have comment or be unexported (golint)
    • Line 145: warning: comment on exported function GenAllFile should be of the form "GenAllFile ..." (golint)
    • Line 279: warning: exported function GenAllFileWithWatch should have comment or be unexported (golint)
    • go-vue-ssr/pkg/ssrtool/rinterface/mapinterface.go
    • Line 8: warning: comment on exported function Get should be of the form "Get ..." (golint)
    • Line 64: warning: exported function GetStr should have comment or be unexported (golint)
    • Line 68: warning: exported function GetBool should have comment or be unexported (golint)
    • Line 72: warning: exported function GetInt should have comment or be unexported (golint)
    • Line 76: warning: exported function GetSlice should have comment or be unexported (golint)
    • Line 80: warning: exported function GetSliceInt should have comment or be unexported (golint)
    • Line 84: warning: exported function GetFloat should have comment or be unexported (golint)
    • go-vue-ssr/pkg/vuessr/vue_parse.go
    • Line 8: warning: exported type VueElement should have comment or be unexported (golint)
    • Line 40: warning: exported type Attribute should have comment or be unexported (golint)
    • Line 44: warning: exported type Directive should have comment or be unexported (golint)
    • Line 50: warning: comment on exported type VOnDirective should be of the form "VOnDirective ..." (with optional leading article) (golint)
    • Line 61: warning: exported type ElseIf should have comment or be unexported (golint)
    • Line 67: warning: exported type VIf should have comment or be unexported (golint)
    • Line 72: warning: exported method VIf.AddElseIf should have comment or be unexported (golint)
    • Line 76: warning: exported type VFor should have comment or be unexported (golint)
    • Line 82: warning: exported type VSlot should have comment or be unexported (golint)
    • Line 87: warning: exported method Props.Omit should have comment or be unexported (golint)
    • Line 103: warning: exported function ParseVue should have comment or be unexported (golint)
    • Line 135: warning: exported type VueElementParser should have comment or be unexported (golint)
    • Line 138: warning: exported method VueElementParser.Parse should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell98%

Misspell Finds commonly misspelled English words