Preparing report...

Report for github.com/freemed/gokogiri

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


gocyclo97%

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.


golint46%

Golint is a linter for Go source code.

    • gokogiri/xml/document.go
    • Line 13: warning: should not use dot imports (golint)
    • Line 19: warning: exported type Document should have comment or be unexported (golint)
    • Line 51: warning: exported const XML_PARSE_RECOVER should have comment (or a comment on this block) or be unexported (golint)
    • Line 93: warning: error var ERR_FAILED_TO_PARSE_XML should have name of the form ErrFoo (golint)
    • Line 93: warning: exported var ERR_FAILED_TO_PARSE_XML should have comment or be unexported (golint)
    • Line 206: warning: comment on exported function CreateEmptyDocument should be of the form "CreateEmptyDocument ..." (golint)
    • Line 249: warning: comment on exported method XmlDocument.DocXPathCtx should be of the form "DocXPathCtx ..." (golint)
    • Line 259: warning: exported method XmlDocument.AddUnlinkedNode should have comment or be unexported (golint)
    • Line 264: warning: exported method XmlDocument.RemoveUnlinkedNode should have comment or be unexported (golint)
    • Line 273: warning: exported method XmlDocument.BookkeepFragment should have comment or be unexported (golint)
    • Line 290: warning: comment on exported method XmlDocument.NodeById should be of the form "NodeById ..." (golint)
    • Line 382: warning: exported method XmlDocument.ParseFragment should have comment or be unexported (golint)
    • Line 392: warning: comment on exported method XmlDocument.UnparsedEntityURI should be of the form "UnparsedEntityURI ..." (golint)
    • Line 449: warning: comment on exported method XmlDocument.Uri should be of the form "Uri ..." (golint)
    • gokogiri/xml/document_test.go
    • Line 238: warning: don't use underscores in Go names; var xml_no_namespace should be xmlNoNamespace (golint)
    • Line 245: warning: don't use underscores in Go names; var output_no_namespace should be outputNoNamespace (golint)
    • Line 262: warning: don't use underscores in Go names; var xml_no_namespace should be xmlNoNamespace (golint)
    • Line 276: warning: don't use underscores in Go names; var output_no_namespace should be outputNoNamespace (golint)
    • gokogiri/util/util.go
    • Line 3: warning: exported var EmptyStringBytes should have comment or be unexported (golint)
    • Line 5: warning: exported function AppendCStringTerminator should have comment or be unexported (golint)
    • Line 14: warning: exported function GetCString should have comment or be unexported (golint)
    • gokogiri/xpath/expression.go
    • Line 35: warning: should not use dot imports (golint)
    • Line 40: warning: exported type Expression should have comment or be unexported (golint)
    • Line 45: warning: exported function Check should have comment or be unexported (golint)
    • Line 56: warning: exported function Compile should have comment or be unexported (golint)
    • Line 76: warning: exported method Expression.Free should have comment or be unexported (golint)
    • gokogiri/xpath/util.go
    • Line 20: warning: should not use dot imports (golint)
    • Line 27: warning: exported function GetScope should have comment or be unexported (golint)
    • Line 34: warning: exported function SetScope should have comment or be unexported (golint)
    • Line 40: warning: exported function ClearScope should have comment or be unexported (golint)
    • Line 59: warning: comment on exported function ValueToXPathObject should be of the form "ValueToXPathObject ..." (golint)
    • gokogiri/xml/fragment.go
    • Line 7: warning: should not use dot imports (golint)
    • Line 11: warning: exported type DocumentFragment should have comment or be unexported (golint)
    • Line 22: warning: exported var ErrFailParseFragment should have comment or be unexported (golint)
    • Line 23: warning: exported var ErrEmptyFragment should have comment or be unexported (golint)
    • Line 74: warning: exported function ParseFragment should have comment or be unexported (golint)
    • Line 82: warning: exported method DocumentFragment.Remove should have comment or be unexported (golint)
    • Line 86: warning: exported method DocumentFragment.Children should have comment or be unexported (golint)
    • Line 95: warning: exported method DocumentFragment.ToBuffer should have comment or be unexported (golint)
    • gokogiri/xml/nodeset.go
    • Line 14: warning: exported type Nodeset should have comment or be unexported (golint)
    • Line 16: warning: comment on exported method Nodeset.ToPointers should be of the form "ToPointers ..." (golint)
    • Line 24: warning: comment on exported method Nodeset.ToXPathNodeset should be of the form "ToXPathNodeset ..." (golint)
    • Line 33: warning: comment on exported method Nodeset.ToXPathValueTree should be of the form "ToXPathValueTree ..." (golint)
    • gokogiri/help/help.go
    • Line 46: warning: exported function LibxmlInitParser should have comment or be unexported (golint)
    • Line 47: warning: don't use underscores in Go names; var called_clean should be calledClean (golint)
    • Line 54: warning: exported function LibxmlCleanUpParser should have comment or be unexported (golint)
    • Line 64: warning: exported function LibxmlGetMemoryAllocation should have comment or be unexported (golint)
    • Line 68: warning: exported function LibxmlCheckMemoryLeak should have comment or be unexported (golint)
    • Line 72: warning: exported function LibxmlReportMemoryLeak should have comment or be unexported (golint)
    • gokogiri/html/document.go
    • Line 15: warning: should not use dot imports (golint)
    • Line 34: warning: exported const EmptyHtmlDoc should have comment or be unexported (golint)
    • Line 36: warning: comment on exported var DefaultParseOption should be of the form "DefaultParseOption ..." (golint)
    • Line 42: warning: exported type HtmlDocument should have comment or be unexported (golint)
    • Line 46: warning: comment on exported var DefaultEncodingBytes should be of the form "DefaultEncodingBytes ..." (golint)
    • Line 50: warning: exported var ErrSetMetaEncoding should have comment or be unexported (golint)
    • Line 51: warning: error var ERR_FAILED_TO_PARSE_HTML should have name of the form ErrFoo (golint)
    • Line 51: warning: exported var ERR_FAILED_TO_PARSE_HTML should have comment or be unexported (golint)
    • Line 54: warning: comment on exported function NewDocument should be of the form "NewDocument ..." (golint)
    • Line 65: warning: comment on exported function Parse should be of the form "Parse ..." (golint)
    • Line 99: warning: exported function CreateEmptyDocument should have comment or be unexported (golint)
    • Line 106: warning: exported method HtmlDocument.ParseFragment should have comment or be unexported (golint)
    • Line 116: warning: exported method HtmlDocument.MetaEncoding should have comment or be unexported (golint)
    • Line 116: warning: receiver name doc should be consistent with previous receiver name document for HtmlDocument (golint)
    • Line 121: warning: exported method HtmlDocument.SetMetaEncoding should have comment or be unexported (golint)
    • Line 121: warning: receiver name doc should be consistent with previous receiver name document for HtmlDocument (golint)
    • gokogiri/xpath/xpath.go
    • Line 44: warning: should not use dot imports (golint)
    • Line 48: warning: exported type XPath should have comment or be unexported (golint)
    • Line 53: warning: exported type XPathObjectType should have comment or be unexported (golint)
    • Line 56: warning: exported const XPATH_UNDEFINED should have comment (or a comment on this block) or be unexported (golint)
    • Line 68: warning: exported type XPathFunction should have comment or be unexported (golint)
    • Line 70: warning: comment on exported type VariableScope should be of the form "VariableScope ..." (with optional leading article) (golint)
    • Line 80: warning: exported function NewXPath should have comment or be unexported (golint)
    • Line 89: warning: exported method XPath.RegisterNamespace should have comment or be unexported (golint)
    • Line 106: warning: comment on exported method XPath.EvaluateAsNodeset should be of the form "EvaluateAsNodeset ..." (golint)
    • Line 158: warning: comment on exported method XPath.ReturnType should be of the form "ReturnType ..." (golint)
    • Line 163: warning: comment on exported method XPath.ResultAsNodeset should be of the form "ResultAsNodeset ..." (golint)
    • Line 184: warning: comment on exported method XPath.ResultAsString should be of the form "ResultAsString ..." (golint)
    • Line 193: warning: comment on exported method XPath.ResultAsNumber should be of the form "ResultAsNumber ..." (golint)
    • Line 202: warning: comment on exported method XPath.ResultAsBoolean should be of the form "ResultAsBoolean ..." (golint)
    • Line 209: warning: comment on exported method XPath.SetResolver should be of the form "SetResolver ..." (golint)
    • Line 236: warning: exported method XPath.Free should have comment or be unexported (golint)
    • Line 248: warning: exported function XPathObjectToValue should have comment or be unexported (golint)
    • gokogiri/xml/cdata.go
    • Line 3: warning: comment on exported type CDataNode should be of the form "CDataNode ..." (with optional leading article) (golint)
    • gokogiri/xml/pi.go
    • Line 3: warning: exported type ProcessingInstructionNode should have comment or be unexported (golint)
    • gokogiri/html/fragment.go
    • Line 8: warning: should not use dot imports (golint)
    • Line 18: warning: exported var ErrFailParseFragment should have comment or be unexported (golint)
    • Line 19: warning: exported var ErrEmptyFragment should have comment or be unexported (golint)
    • Line 88: warning: exported function ParseFragment should have comment or be unexported (golint)
    • gokogiri/xml/node.go
    • Line 13: warning: should not use dot imports (golint)
    • Line 18: warning: error var ERR_UNDEFINED_COERCE_PARAM should have name of the form ErrFoo (golint)
    • Line 18: warning: exported var ERR_UNDEFINED_COERCE_PARAM should have comment or be unexported (golint)
    • Line 19: warning: error var ERR_UNDEFINED_SET_CONTENT_PARAM should have name of the form ErrFoo (golint)
    • Line 20: warning: error var ERR_UNDEFINED_SEARCH_PARAM should have name of the form ErrFoo (golint)
    • Line 21: warning: error var ERR_CANNOT_MAKE_DUCMENT_AS_CHILD should have name of the form ErrFoo (golint)
    • Line 22: warning: error var ERR_CANNOT_COPY_TEXT_NODE_WHEN_ADD_CHILD should have name of the form ErrFoo (golint)
    • Line 29: warning: exported const XML_ELEMENT_NODE should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported const XML_SAVE_FORMAT should have comment (or a comment on this block) or be unexported (golint)
    • Line 73: warning: exported type Node should have comment or be unexported (golint)
    • Line 150: warning: comment on exported var ErrTooLarge should be of the form "ErrTooLarge ..." (golint)
    • Line 165: warning: exported type WriteBuffer should have comment or be unexported (golint)
    • Line 225: warning: exported method XmlNode.Coerce should have comment or be unexported (golint)
    • Line 229: warning: comment on exported method XmlNode.AddChild should be of the form "AddChild ..." (golint)
    • Line 255: warning: comment on exported method XmlNode.AddPreviousSibling should be of the form "AddPreviousSibling ..." (golint)
    • Line 281: warning: comment on exported method XmlNode.AddNextSibling should be of the form "AddNextSibling ..." (golint)
    • Line 309: warning: exported method XmlNode.ResetNodePtr should have comment or be unexported (golint)
    • Line 314: warning: comment on exported method XmlNode.IsValid should be of the form "IsValid ..." (golint)
    • Line 320: warning: comment on exported method XmlNode.MyDocument should be of the form "MyDocument ..." (golint)
    • Line 333: warning: exported method XmlNode.NodeType should have comment or be unexported (golint)
    • Line 369: warning: exported method XmlNode.FirstChild should have comment or be unexported (golint)
    • Line 373: warning: exported method XmlNode.LastChild should have comment or be unexported (golint)
    • Line 389: warning: exported method XmlNode.ResetChildren should have comment or be unexported (golint)
    • Line 405: warning: exported method XmlNode.SetContent should have comment or be unexported (golint)
    • Line 421: warning: exported method XmlNode.InsertBefore should have comment or be unexported (golint)
    • Line 426: warning: exported method XmlNode.InsertAfter should have comment or be unexported (golint)
    • Line 431: warning: exported method XmlNode.InsertBegin should have comment or be unexported (golint)
    • Line 440: warning: exported method XmlNode.InsertEnd should have comment or be unexported (golint)
    • Line 449: warning: exported method XmlNode.SetChildren should have comment or be unexported (golint)
    • Line 459: warning: exported method XmlNode.SetInnerHtml should have comment or be unexported (golint)
    • Line 464: warning: exported method XmlNode.Replace should have comment or be unexported (golint)
    • Line 473: warning: comment on exported method XmlNode.AttributeList should be of the form "AttributeList ..." (golint)
    • Line 487: warning: comment on exported method XmlNode.Attributes should be of the form "Attributes ..." (golint)
    • Line 504: warning: comment on exported method XmlNode.Attribute should be of the form "Attribute ..." (golint)
    • Line 514: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 623: warning: comment on exported method XmlNode.SearchWithVariables should be of the form "SearchWithVariables ..." (golint)
    • Line 652: warning: comment on exported method XmlNode.EvalXPath should be of the form "EvalXPath ..." (golint)
    • Line 706: warning: comment on exported method XmlNode.EvalXPathAsBoolean should be of the form "EvalXPathAsBoolean ..." (golint)
    • Line 741: warning: comment on exported method XmlNode.Name should be of the form "Name ..." (golint)
    • Line 750: warning: comment on exported method XmlNode.Namespace should be of the form "Namespace ..." (golint)
    • Line 760: warning: comment on exported method XmlNode.SetName should be of the form "SetName ..." (golint)
    • Line 769: warning: exported method XmlNode.Duplicate should have comment or be unexported (golint)
    • Line 773: warning: exported method XmlNode.DuplicateTo should have comment or be unexported (golint)
    • Line 859: warning: exported method XmlNode.ToBuffer should have comment or be unexported (golint)
    • Line 878: warning: exported method XmlNode.Content should have comment or be unexported (golint)
    • Line 885: warning: exported method XmlNode.InnerHtml should have comment or be unexported (golint)
    • Line 894: warning: exported method XmlNode.Unlink should have comment or be unexported (golint)
    • Line 900: warning: exported method XmlNode.Remove should have comment or be unexported (golint)
    • Line 980: warning: exported method XmlNode.Wrap should have comment or be unexported (golint)
    • Line 990: warning: exported method XmlNode.ParseFragment should have comment or be unexported (golint)
    • Line 1002: warning: don't use underscores in Go names; func parameter data_len should be dataLen (golint)
    • Line 1063: warning: exported method XmlNode.RecursivelyRemoveNamespaces should have comment or be unexported (golint)
    • Line 1094: warning: exported method XmlNode.RemoveDefaultNamespace should have comment or be unexported (golint)
    • Line 1099: warning: comment on exported method XmlNode.DeclaredNamespaces should be of the form "DeclaredNamespaces ..." (golint)
    • Line 1119: warning: comment on exported method XmlNode.DeclareNamespace should be of the form "DeclareNamespace ..." (golint)
    • Line 1152: warning: comment on exported method XmlNode.SetNamespace should be of the form "SetNamespace ..." (golint)
    • Line 1182: warning: comment on exported method XmlNode.LineNumber should be of the form "LineNumber ..." (golint)
    • gokogiri/mem/mem.go
    • Line 12: warning: exported const LIBXML_VERSION should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported function AllocSize should have comment or be unexported (golint)
    • gokogiri/css/css.go
    • Line 12: warning: exported type Lexeme should have comment or be unexported (golint)
    • Line 15: warning: exported const SPACES should have comment (or a comment on this block) or be unexported (golint)
    • Line 59: warning: comment on exported const NUM_LEXEMES should be of the form "NUM_LEXEMES ..." (golint)
    • Line 112: warning: exported type Scope should have comment or be unexported (golint)
    • Line 115: warning: exported const GLOBAL should have comment (or a comment on this block) or be unexported (golint)
    • Line 119: warning: exported function Convert should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell95%

Misspell Finds commonly misspelled English words

    • gokogiri/xml/document.go
    • Line 61: warning: "substitition" is a misspelling of "substitution" (misspell)
    • Line 63: warning: "dictionnary" is a misspelling of "dictionary" (misspell)
    • Line 179: warning: "alogrithm" is a misspelling of "algorithm" (misspell)