Preparing report...

Report for github.com/hscells/transmute

A+    Excellent!    Found 12 issues across 25 files

Tweet

gofmt96%

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!


gocyclo72%

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.

    • transmute/parser/medline.go
    • Line 310: warning: cyclomatic complexity 19 of function (MedlineTransformer).ParseInfixKeywords() is high (> 15) (gocyclo)
    • Line 169: warning: cyclomatic complexity 16 of function (MedlineTransformer).TransformPrefixGroupToQueryGroup() is high (> 15) (gocyclo)
    • transmute/backend/elasticsearch.go
    • Line 165: warning: cyclomatic complexity 28 of function (ElasticsearchBooleanQuery).traverseGroup() is high (> 15) (gocyclo)
    • Line 52: warning: cyclomatic complexity 25 of function (ElasticsearchCompiler).Compile() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • transmute/template.go
    • Line 12: warning: exported var Medline2Cqr should have comment or be unexported (golint)
    • Line 54: warning: exported function CompileMedline2Cqr should have comment or be unexported (golint)
    • Line 68: warning: exported function CompilePubmed2Cqr should have comment or be unexported (golint)
    • Line 82: warning: exported function CompileCqr2PubMed should have comment or be unexported (golint)
    • Line 101: warning: exported function CompileCqr2Medline should have comment or be unexported (golint)
    • Line 120: warning: exported function CompileCqr2String should have comment or be unexported (golint)
    • Line 124: warning: exported function CompileString2Cqr should have comment or be unexported (golint)
    • transmute/lexer/lexer.go
    • Line 52: warning: comment on exported function ProcessPrefixOperators should be of the form "ProcessPrefixOperators ..." (golint)
    • Line 129: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 198: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • transmute/fields/fields.go
    • Line 1: warning: package comment should be of the form "Package fields ..." (golint)
    • Line 5: warning: exported var Affiliation should have comment or be unexported (golint)
    • transmute/backend/medline.go
    • Line 14: warning: exported type MedlineBackend should have comment or be unexported (golint)
    • Line 17: warning: exported type MedlineQuery should have comment or be unexported (golint)
    • Line 21: warning: exported method MedlineQuery.Representation should have comment or be unexported (golint)
    • Line 29: warning: exported method MedlineQuery.StringPretty should have comment or be unexported (golint)
    • Line 141: warning: exported method MedlineBackend.Compile should have comment or be unexported (golint)
    • Line 146: warning: exported function NewMedlineBackend should have comment or be unexported (golint)
    • transmute/backend/pubmed.go
    • Line 13: warning: exported type PubmedBackend should have comment or be unexported (golint)
    • Line 17: warning: exported type PubmedQuery should have comment or be unexported (golint)
    • Line 21: warning: exported method PubmedQuery.Representation should have comment or be unexported (golint)
    • Line 29: warning: exported method PubmedQuery.StringPretty should have comment or be unexported (golint)
    • Line 174: warning: exported method PubmedBackend.Compile should have comment or be unexported (golint)
    • Line 179: warning: exported function NewPubmedBackend should have comment or be unexported (golint)
    • transmute/backend/terrier.go
    • Line 106: warning: exported function NewTerrierBackend should have comment or be unexported (golint)
    • Line 110: warning: exported function NewTerierQuery should have comment or be unexported (golint)
    • transmute/parser/cochranelibrary.go
    • Line 9: warning: exported type CochraneLibParser should have comment or be unexported (golint)
    • Line 12: warning: exported method CochraneLibParser.TransformSingle should have comment or be unexported (golint)
    • Line 16: warning: exported method CochraneLibParser.TransformNested should have comment or be unexported (golint)
    • transmute/parser/medline.go
    • Line 13: warning: exported var MedlineFieldMapping should have comment or be unexported (golint)
    • Line 69: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 167: warning: comment on exported method MedlineTransformer.TransformPrefixGroupToQueryGroup should be of the form "TransformPrefixGroupToQueryGroup ..." (golint)
    • Line 426: warning: exported function NewMedlineParser should have comment or be unexported (golint)
    • transmute/parser/pubmed.go
    • Line 11: warning: exported type PubMedTransformer should have comment or be unexported (golint)
    • Line 13: warning: exported var PubMedFieldMapping should have comment or be unexported (golint)
    • Line 134: warning: exported method PubMedTransformer.TransformSingle should have comment or be unexported (golint)
    • Line 195: warning: exported method PubMedTransformer.TransformNested should have comment or be unexported (golint)
    • Line 200: warning: exported method PubMedTransformer.RemoveParenthesis should have comment or be unexported (golint)
    • Line 438: warning: comment on exported method PubMedTransformer.TransformPrefixGroupToQueryGroup should be of the form "TransformPrefixGroupToQueryGroup ..." (golint)
    • Line 474: warning: exported function NewPubMedParser should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign92%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!