Preparing report...

Report for github.com/jbowtie/ratago

A    Great!    Found 10 issues across 16 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!


golint37%

Golint is a linter for Go source code.

    • ratago/xslt/stylesheet.go
    • Line 14: warning: exported const XSLT_NAMESPACE should have comment or be unexported (golint)
    • Line 15: warning: exported const XML_NAMESPACE should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function IsXsltName should be of the form "IsXsltName ..." (golint)
    • Line 67: warning: comment on exported function IsBlank should be of the form "IsBlank ..." (golint)
    • Line 305: warning: exported method Stylesheet.IsExcluded should have comment or be unexported (golint)
    • Line 322: warning: comment on exported method Stylesheet.Process should be of the form "Process ..." (golint)
    • Line 346: warning: don't use underscores in Go names; var gp_value should be gpValue (golint)
    • Line 346: warning: don't use underscores in Go names; var gp_ok should be gpOk (golint)
    • Line 348: warning: don't use underscores in Go names; var gp_var should be gpVar (golint)
    • Line 446: warning: comment on exported method Stylesheet.LookupTemplate should be of the form "LookupTemplate ..." (golint)
    • Line 550: warning: exported method Stylesheet.RegisterAttributeSet should have comment or be unexported (golint)
    • Line 557: warning: exported method Stylesheet.RegisterGlobalVariable should have comment or be unexported (golint)
    • Line 727: warning: comment on exported method Stylesheet.LookupAttributeSet should be of the form "LookupAttributeSet ..." (golint)
    • ratago/xpath2/lexer.go
    • Line 15: warning: comment on exported type XPathTokenType should be of the form "XPathTokenType ..." (with optional leading article) (golint)
    • Line 31: warning: exported const TT_END should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported type XPathToken should have comment or be unexported (golint)
    • Line 44: warning: don't use underscores in Go names; struct field Token_Type should be TokenType (golint)
    • Line 48: warning: exported method XPathToken.AsValue should have comment or be unexported (golint)
    • Line 52: warning: exported method XPathToken.TokenType should have comment or be unexported (golint)
    • Line 58: warning: exported type XPathLexer should have comment or be unexported (golint)
    • Line 66: warning: exported method XPathLexer.Run should have comment or be unexported (golint)
    • ratago/xslt/context.go
    • Line 27: warning: exported method ExecutionContext.EvalXPath should have comment or be unexported (golint)
    • Line 70: warning: comment on exported method ExecutionContext.RegisterXPathNamespaces should be of the form "RegisterXPathNamespaces ..." (golint)
    • Line 88: warning: comment on exported method ExecutionContext.LookupNamespace should be of the form "LookupNamespace ..." (golint)
    • Line 111: warning: exported method ExecutionContext.EvalXPathAsNodeset should have comment or be unexported (golint)
    • Line 128: warning: exported method ExecutionContext.EvalXPathAsBoolean should have comment or be unexported (golint)
    • Line 137: warning: exported method ExecutionContext.EvalXPathAsString should have comment or be unexported (golint)
    • Line 195: warning: exported method ExecutionContext.ResolveQName should have comment or be unexported (golint)
    • Line 209: warning: exported method ExecutionContext.UseCDataSection should have comment or be unexported (golint)
    • Line 227: warning: exported method ExecutionContext.ResolveVariable should have comment or be unexported (golint)
    • Line 245: warning: exported method ExecutionContext.FindVariable should have comment or be unexported (golint)
    • Line 261: warning: exported method ExecutionContext.DeclareLocalVariable should have comment or be unexported (golint)
    • Line 272: warning: exported method ExecutionContext.LookupLocalVariable should have comment or be unexported (golint)
    • Line 284: warning: comment on exported method ExecutionContext.PushStack should be of the form "PushStack ..." (golint)
    • Line 290: warning: comment on exported method ExecutionContext.PopStack should be of the form "PopStack ..." (golint)
    • Line 298: warning: exported method ExecutionContext.IsFunctionRegistered should have comment or be unexported (golint)
    • Line 304: warning: exported method ExecutionContext.ResolveFunction should have comment or be unexported (golint)
    • Line 313: warning: comment on exported method ExecutionContext.DefaultNamespace should be of the form "DefaultNamespace ..." (golint)
    • Line 326: warning: comment on exported method ExecutionContext.DeclareStylesheetNamespacesIfRoot should be of the form "DeclareStylesheetNamespacesIfRoot ..." (golint)
    • Line 343: warning: exported method ExecutionContext.FetchInputDocument should have comment or be unexported (golint)
    • ratago/xslt/functions.go
    • Line 12: warning: exported method Stylesheet.RegisterXsltFunctions should have comment or be unexported (golint)
    • Line 32: warning: exported type Key should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function XsltKey should be of the form "XsltKey ..." (golint)
    • Line 68: warning: comment on exported function XsltSystemProperty should be of the form "XsltSystemProperty ..." (golint)
    • Line 86: warning: comment on exported function XsltDocumentFn should be of the form "XsltDocumentFn ..." (golint)
    • Line 118: warning: comment on exported function XsltGenerateId should be of the form "XsltGenerateId ..." (golint)
    • Line 143: warning: comment on exported function XsltUnparsedEntityUri should be of the form "XsltUnparsedEntityUri ..." (golint)
    • Line 154: warning: comment on exported function XsltCurrent should be of the form "XsltCurrent ..." (golint)
    • Line 161: warning: comment on exported function XsltFunctionAvailable should be of the form "XsltFunctionAvailable ..." (golint)
    • Line 172: warning: comment on exported function XsltElementAvailable should be of the form "XsltElementAvailable ..." (golint)
    • Line 197: warning: exported function EXSLTnodeset should have comment or be unexported (golint)
    • Line 223: warning: exported function EXSLTmathconstant should have comment or be unexported (golint)
    • Line 255: warning: exported function EXSLTmathsin should have comment or be unexported (golint)
    • Line 263: warning: exported function EXSLTmathcos should have comment or be unexported (golint)
    • Line 271: warning: exported function EXSLTmathabs should have comment or be unexported (golint)
    • ratago/xslt/instruction.go
    • Line 10: warning: comment on exported type XsltInstruction should be of the form "XsltInstruction ..." (with optional leading article) (golint)
    • Line 55: warning: comment on exported method XsltInstruction.Apply should be of the form "Apply ..." (golint)
    • Line 378: warning: don't use underscores in Go names; var old_curr should be oldCurr (golint)
    • ratago/xslt/match.go
    • Line 12: warning: exported type StepOperation should have comment or be unexported (golint)
    • Line 15: warning: exported const OP_END should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: comment on exported type MatchStep should be of the form "MatchStep ..." (with optional leading article) (golint)
    • Line 40: warning: comment on exported type CompiledMatch should be of the form "CompiledMatch ..." (with optional leading article) (golint)
    • Line 126: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 354: warning: exported function CompileMatch should have comment or be unexported (golint)
    • Line 370: warning: comment on exported method CompiledMatch.EvalMatch should be of the form "EvalMatch ..." (golint)
    • Line 558: warning: exported method CompiledMatch.Hash should have comment or be unexported (golint)
    • Line 573: warning: exported method CompiledMatch.IsElement should have comment or be unexported (golint)
    • Line 581: warning: exported method CompiledMatch.IsAttr should have comment or be unexported (golint)
    • Line 586: warning: exported method CompiledMatch.IsNode should have comment or be unexported (golint)
    • Line 591: warning: exported method CompiledMatch.IsPI should have comment or be unexported (golint)
    • Line 596: warning: exported method CompiledMatch.IsIdKey should have comment or be unexported (golint)
    • Line 601: warning: exported method CompiledMatch.IsText should have comment or be unexported (golint)
    • Line 606: warning: exported method CompiledMatch.IsComment should have comment or be unexported (golint)
    • Line 622: warning: exported method CompiledMatch.DefaultPriority should have comment or be unexported (golint)
    • ratago/xslt/sort.go
    • Line 8: warning: exported method XsltInstruction.Sort should have comment or be unexported (golint)
    • Line 13: warning: exported type NodeSorter should have comment or be unexported (golint)
    • Line 77: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • ratago/xslt/template.go
    • Line 12: warning: exported type CompiledStep should have comment or be unexported (golint)
    • Line 17: warning: exported type Template should have comment or be unexported (golint)
    • Line 26: warning: comment on exported type LiteralResultElement should be of the form "LiteralResultElement ..." (with optional leading article) (golint)
    • Line 34: warning: comment on exported type TextOutput should be of the form "TextOutput ..." (with optional leading article) (golint)
    • Line 39: warning: comment on exported type Variable should be of the form "Variable ..." (with optional leading article) (golint)
    • Line 61: warning: comment on exported method Variable.Apply should be of the form "Apply ..." (golint)
    • Line 105: warning: exported method LiteralResultElement.Compile should have comment or be unexported (golint)
    • Line 115: warning: exported function ResolveAlias should have comment or be unexported (golint)
    • Line 129: warning: exported method LiteralResultElement.IsExtension should have comment or be unexported (golint)
    • Line 142: warning: exported method LiteralResultElement.Apply should have comment or be unexported (golint)
    • Line 269: warning: exported method TextOutput.Compile should have comment or be unexported (golint)
    • Line 272: warning: exported method TextOutput.Apply should have comment or be unexported (golint)
    • Line 282: warning: exported method Template.AddChild should have comment or be unexported (golint)
    • Line 286: warning: exported method Template.CompileContent should have comment or be unexported (golint)
    • Line 297: warning: exported function CompileSingleNode should have comment or be unexported (golint)
    • Line 334: warning: exported method Template.Apply should have comment or be unexported (golint)

gocyclo68%

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.

    • ratago/xpath2/lexer.go
    • Line 127: warning: cyclomatic complexity 34 of function lexTerminal() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 29 of function isNameStartChar() is high (> 15) (gocyclo)
    • ratago/xslt/instruction.go
    • Line 56: warning: cyclomatic complexity 96 of function (*XsltInstruction).Apply() is high (> 15) (gocyclo)
    • Line 498: warning: cyclomatic complexity 18 of function (*XsltInstruction).copyToOutput() is high (> 15) (gocyclo)
    • ratago/xslt/match.go
    • Line 371: warning: cyclomatic complexity 67 of function (*CompiledMatch).EvalMatch() is high (> 15) (gocyclo)
    • Line 107: warning: cyclomatic complexity 24 of function lexNodeTest() is high (> 15) (gocyclo)
    • Line 622: warning: cyclomatic complexity 23 of function (*CompiledMatch).DefaultPriority() is high (> 15) (gocyclo)
    • ratago/xslt/stylesheet.go
    • Line 153: warning: cyclomatic complexity 28 of function (*Stylesheet).parseChildren() is high (> 15) (gocyclo)
    • Line 447: warning: cyclomatic complexity 27 of function (*Stylesheet).LookupTemplate() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 18 of function (*Stylesheet).constructOutput() is high (> 15) (gocyclo)
    • ratago/xslt/template.go
    • Line 208: warning: cyclomatic complexity 16 of function evalAVT() is high (> 15) (gocyclo)
    • Line 142: warning: cyclomatic complexity 16 of function (*LiteralResultElement).Apply() is high (> 15) (gocyclo)

ineffassign87%

IneffAssign detects ineffectual assignments in Go code.

    • ratago/xslt/sort.go
    • Line 66: warning: ineffectual assignment to s1 (ineffassign)
    • Line 68: warning: ineffectual assignment to s2 (ineffassign)
    • Line 88: warning: ineffectual assignment to s1 (ineffassign)
    • Line 90: warning: ineffectual assignment to s2 (ineffassign)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell93%

Misspell Finds commonly misspelled English words