Preparing report...

Report for github.com/zbysir/vpl

A    Great!    Found 13 issues across 32 files

Tweet

gofmt87%

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!


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.

    • vpl/internal/lib/parse/html/lex.go
    • Line 97: warning: cyclomatic complexity 43 of function (*Lexer).Next() is high (> 15) (gocyclo)
    • Line 345: warning: cyclomatic complexity 41 of function (*Lexer).shiftAttribute() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 36 of function (*Lexer).shiftRawText() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 25 of function (*Lexer).shiftStartTag() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 19 of function (*Lexer).readMarkup() is high (> 15) (gocyclo)
    • Line 430: warning: cyclomatic complexity 18 of function (*Lexer).shiftXml() is high (> 15) (gocyclo)

golint71%

Golint is a linter for Go source code.

    • vpl/internal/lib/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)
    • vpl/internal/parser/parsevue.go
    • Line 10: warning: exported type Prop should have comment or be unexported (golint)
    • Line 18: warning: exported type Style should have comment or be unexported (golint)
    • Line 22: warning: exported type Attribute should have comment or be unexported (golint)
    • Line 26: warning: exported type Props should have comment or be unexported (golint)
    • Line 28: warning: exported type Styles should have comment or be unexported (golint)
    • Line 30: warning: exported method Styles.ToAttr should have comment or be unexported (golint)
    • Line 43: warning: exported method Styles.Add should have comment or be unexported (golint)
    • Line 48: warning: exported method Styles.Merge should have comment or be unexported (golint)
    • Line 55: warning: exported method Styles.Del should have comment or be unexported (golint)
    • Line 59: warning: exported type Class should have comment or be unexported (golint)
    • Line 61: warning: exported method Class.ToAttr should have comment or be unexported (golint)
    • Line 65: warning: exported method Class.Remove should have comment or be unexported (golint)
    • Line 74: warning: exported method Class.Merge should have comment or be unexported (golint)
    • Line 83: warning: exported method Class.Exist should have comment or be unexported (golint)
    • Line 92: warning: exported function NewClass should have comment or be unexported (golint)
    • Line 96: warning: exported type Attributes should have comment or be unexported (golint)
    • Line 97: warning: exported type Directives should have comment or be unexported (golint)
    • Line 99: warning: exported method Props.Get should have comment or be unexported (golint)
    • Line 108: warning: comment on exported method Props.IsStatic should be of the form "IsStatic ..." (golint)
    • Line 122: warning: exported method Props.Del should have comment or be unexported (golint)
    • Line 131: warning: exported type Directive should have comment or be unexported (golint)
    • Line 137: warning: exported type ElseIf should have comment or be unexported (golint)
    • Line 143: warning: exported type VIf should have comment or be unexported (golint)
    • Line 149: warning: exported method VIf.AddElseIf should have comment or be unexported (golint)
    • Line 153: warning: exported type VFor should have comment or be unexported (golint)
    • Line 159: warning: exported type VSlot should have comment or be unexported (golint)
    • Line 163: warning: exported type VBind should have comment or be unexported (golint)
    • Line 167: warning: exported type VueElement should have comment or be unexported (golint)
    • Line 196: warning: exported type ParseVueNodeOptions should have comment or be unexported (golint)
    • Line 201: warning: exported type VueElementParser should have comment or be unexported (golint)
    • Line 205: warning: exported method VueElementParser.Parse should have comment or be unexported (golint)
    • Line 525: warning: comment on exported function ToVueNode should be of the form "ToVueNode ..." (golint)
    • Line 548: warning: exported method VueElement.NicePrint should have comment or be unexported (golint)
    • vpl/internal/lib/parse/html/hash.go
    • Line 67: warning: don't use underscores in Go names; const _Hash_hash0 should be _HashHash0 (golint)
    • Line 68: warning: don't use underscores in Go names; const _Hash_maxLen should be _HashMaxLen (golint)
    • Line 69: warning: don't use underscores in Go names; const _Hash_text should be _HashText (golint)
    • Line 71: warning: don't use underscores in Go names; var _Hash_table should be _HashTable (golint)
    • vpl/jsexpression.go
    • Line 189: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 353: warning: exported type Function should have comment or be unexported (golint)
    • Line 362: warning: comment on exported function ShouldLookInterface should be of the form "ShouldLookInterface ..." (golint)
    • vpl/statement.go
    • Line 15: warning: comment on exported type Scope should be of the form "Scope ..." (with optional leading article) (golint)
    • Line 21: warning: exported method Scope.Get should have comment or be unexported (golint)
    • Line 25: warning: exported function NewScope should have comment or be unexported (golint)
    • Line 32: warning: comment on exported method Scope.GetDeep should be of the form "GetDeep ..." (golint)
    • Line 45: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 56: warning: exported method Scope.Extend should have comment or be unexported (golint)
    • Line 63: warning: comment on exported method Scope.Set should be of the form "Set ..." (golint)
    • Line 72: warning: comment on exported type RenderCtx should be of the form "RenderCtx ..." (with optional leading article) (golint)
    • Line 78: warning: exported type Directive should have comment or be unexported (golint)
    • Line 80: warning: exported type DirectivesBinding should have comment or be unexported (golint)
    • Line 144: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 149: warning: comment on exported type Prop should be of the form "Prop ..." (with optional leading article) (golint)
    • Line 161: warning: exported type AttrWay should have comment or be unexported (golint)
    • Line 164: warning: exported const MayBeAttr should have comment (or a comment on this block) or be unexported (golint)
    • Line 169: warning: exported type PropKeys should have comment or be unexported (golint)
    • Line 176: warning: exported method PropKeys.Append should have comment or be unexported (golint)
    • Line 192: warning: exported type Props should have comment or be unexported (golint)
    • Line 197: warning: exported function NewProps should have comment or be unexported (golint)
    • Line 204: warning: exported method Props.ForEach should have comment or be unexported (golint)
    • Line 218: warning: exported method Props.ToMap should have comment or be unexported (golint)
    • Line 257: warning: exported method Props.Append should have comment or be unexported (golint)
    • Line 264: warning: exported method Props.AppendClass should have comment or be unexported (golint)
    • Line 275: warning: exported method Props.AppendStyle should have comment or be unexported (golint)
    • Line 308: warning: comment on exported method Props.AppendMap should be of the form "AppendMap ..." (golint)
    • Line 332: warning: exported method Props.Get should have comment or be unexported (golint)
    • Line 471: warning: comment on exported type ComponentStruct should be of the form "ComponentStruct ..." (with optional leading article) (golint)
    • Line 512: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 567: warning: comment on exported type Statement should be of the form "Statement ..." (with optional leading article) (golint)
    • Line 573: warning: exported type FuncStatement should have comment or be unexported (golint)
    • Line 575: warning: exported method FuncStatement.Exec should have comment or be unexported (golint)
    • Line 579: warning: exported type Writer should have comment or be unexported (golint)
    • Line 587: warning: exported type Span should have comment or be unexported (golint)
    • Line 591: warning: comment on exported type StrStatement should be of the form "StrStatement ..." (with optional leading article) (golint)
    • Line 596: warning: exported method StrStatement.Exec should have comment or be unexported (golint)
    • Line 601: warning: exported type EmptyStatement should have comment or be unexported (golint)
    • Line 604: warning: exported method EmptyStatement.Exec should have comment or be unexported (golint)
    • Line 947: warning: exported type Class should have comment or be unexported (golint)
    • Line 948: warning: exported type Styles should have comment or be unexported (golint)
    • Line 950: warning: exported type NodeData should have comment or be unexported (golint)
    • Line 1145: warning: comment on exported type ComponentStatement should be of the form "ComponentStatement ..." (with optional leading article) (golint)
    • Line 1151: warning: comment on exported method ComponentStatement.Exec should be of the form "Exec ..." (golint)
    • Line 1242: warning: comment on exported type SlotC should be of the form "SlotC ..." (with optional leading article) (golint)
    • Line 1250: warning: comment on exported type Slot should be of the form "Slot ..." (with optional leading article) (golint)
    • Line 1259: warning: exported type ExecSlotOptions should have comment or be unexported (golint)
    • Line 1264: warning: exported method Slot.Exec should have comment or be unexported (golint)
    • Line 1335: warning: comment on exported type SlotsC should be of the form "SlotsC ..." (with optional leading article) (golint)
    • Line 1391: warning: exported type Slots should have comment or be unexported (golint)
    • Line 1396: warning: exported method Slots.Get should have comment or be unexported (golint)
    • Line 1406: warning: exported function ParseHtmlToStatement should have comment or be unexported (golint)
    • Line 1422: warning: comment on exported type StatementOptions should be of the form "StatementOptions ..." (with optional leading article) (golint)
    • Line 1442: warning: comment on exported type StatementCtx should be of the form "StatementCtx ..." (with optional leading article) (golint)
    • Line 1457: warning: exported method StatementCtx.NewScope should have comment or be unexported (golint)
    • Line 1461: warning: exported method StatementCtx.Clone should have comment or be unexported (golint)
    • Line 1473: warning: exported method StatementCtx.Set should have comment or be unexported (golint)
    • Line 1476: warning: exported method StatementCtx.Get should have comment or be unexported (golint)
    • Line 1480: warning: exported type Store should have comment or be unexported (golint)
    • Line 1485: warning: exported type MapStore should have comment or be unexported (golint)
    • Line 1487: warning: exported method MapStore.Get should have comment or be unexported (golint)
    • Line 1492: warning: exported method MapStore.Set should have comment or be unexported (golint)
    • vpl/util.go
    • Line 133: warning: comment on exported function NicePrintStatement should be of the form "NicePrintStatement ..." (golint)
    • vpl/internal/util/util.go
    • Line 14: warning: exported function GetSortedKey should have comment or be unexported (golint)
    • Line 47: warning: exported function CopyMap should have comment or be unexported (golint)
    • Line 58: warning: exported function UnsafeStrToBytes should have comment or be unexported (golint)
    • Line 67: warning: exported function UnsafeBytesToStr should have comment or be unexported (golint)
    • Line 71: warning: exported function InterfaceToStr should have comment or be unexported (golint)
    • Line 94: warning: exported function Escape should have comment or be unexported (golint)
    • Line 113: warning: comment on exported function InterfaceToBool should be of the form "InterfaceToBool ..." (golint)
    • Line 142: warning: exported function ForInterface should have comment or be unexported (golint)
    • Line 191: warning: exported function Interface2Slice should have comment or be unexported (golint)
    • vpl/internal/parser/parsehtml.go
    • Line 16: warning: exported const ErrorNode should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: comment on exported const RootNode should be of the form "RootNode ..." (golint)
    • Line 27: warning: exported type Node should have comment or be unexported (golint)
    • Line 36: warning: exported type Attr should have comment or be unexported (golint)
    • Line 41: warning: exported method Node.AddChild should have comment or be unexported (golint)
    • Line 47: warning: exported method Node.AddBor should have comment or be unexported (golint)
    • Line 53: warning: exported method Node.Add should have comment or be unexported (golint)
    • Line 67: warning: exported method Node.GetParent should have comment or be unexported (golint)
    • Line 79: warning: comment on exported var VoidElements should be of the form "VoidElements ..." (golint)
    • Line 98: warning: comment on exported method Node.Close should be of the form "Close ..." (golint)
    • Line 108: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 118: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 131: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 138: warning: exported method Node.NicePrint should have comment or be unexported (golint)
    • Line 166: warning: exported type NodeParser should have comment or be unexported (golint)
    • Line 169: warning: exported function NewNodeParser should have comment or be unexported (golint)
    • Line 176: warning: exported method NodeParser.Parse should have comment or be unexported (golint)
    • Line 271: warning: exported function ParseHtml should have comment or be unexported (golint)
    • vpl/vpl.go
    • Line 13: warning: comment on exported type Vpl should be of the form "Vpl ..." (with optional leading article) (golint)
    • Line 30: warning: exported type Options should have comment or be unexported (golint)
    • Line 32: warning: exported function WithCanBeAttrsKey should have comment or be unexported (golint)
    • Line 38: warning: exported function WithSkipComment should have comment or be unexported (golint)
    • Line 168: warning: exported var DefaultCanBeAttr should have comment or be unexported (golint)
    • Line 179: warning: exported method Vpl.Component should have comment or be unexported (golint)
    • Line 184: warning: comment on exported method Vpl.ComponentFile should be of the form "ComponentFile ..." (golint)
    • Line 194: warning: comment on exported method Vpl.ComponentTxt should be of the form "ComponentTxt ..." (golint)
    • Line 239: warning: exported method Vpl.NewScope should have comment or be unexported (golint)
    • Line 244: warning: comment on exported method Vpl.RenderTpl should be of the form "RenderTpl ..." (golint)
    • Line 304: warning: comment on exported method Vpl.RenderComponent should be of the form "RenderComponent ..." (golint)
    • Line 352: warning: comment on exported type ListWriter should be of the form "ListWriter ..." (with optional leading article) (golint)
    • Line 361: warning: exported method ListWriter.Result should have comment or be unexported (golint)
    • Line 381: warning: exported method ListWriter.WriteString should have comment or be unexported (golint)
    • Line 385: warning: exported method ListWriter.WriteSpan should have comment or be unexported (golint)
    • Line 393: warning: exported type StringSpan should have comment or be unexported (golint)
    • Line 397: warning: exported method StringSpan.Result should have comment or be unexported (golint)
    • Line 401: warning: exported function NewListWriter should have comment or be unexported (golint)
    • Line 405: warning: exported type ChanSpan should have comment or be unexported (golint)
    • Line 412: warning: exported method ChanSpan.Result should have comment or be unexported (golint)
    • Line 419: warning: exported method ChanSpan.Done should have comment or be unexported (golint)
    • Line 425: warning: exported function NewChanSpan should have comment or be unexported (golint)
    • Line 433: warning: exported type RenderParam 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!