Preparing report...

Report for github.com/mvdan/sh

A+    Excellent!    Found 12 issues across 56 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!


gocyclo89%

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.

    • sh/cmd/shfmt/main.go
    • Line 74: warning: cyclomatic complexity 37 of function main1() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 19 of function formatBytes() is high (> 15) (gocyclo)
    • sh/expand/expand.go
    • Line 208: warning: cyclomatic complexity 48 of function Format() is high (> 15) (gocyclo)
    • Line 514: warning: cyclomatic complexity 31 of function (*Config).wordFields() is high (> 15) (gocyclo)
    • Line 429: warning: cyclomatic complexity 26 of function (*Config).wordField() is high (> 15) (gocyclo)
    • Line 732: warning: cyclomatic complexity 22 of function (*Config).glob() is high (> 15) (gocyclo)
    • Line 859: warning: cyclomatic complexity 18 of function ReadFields() is high (> 15) (gocyclo)
    • sh/expand/arith.go
    • Line 13: warning: cyclomatic complexity 25 of function Arithm() is high (> 15) (gocyclo)
    • Line 164: warning: cyclomatic complexity 23 of function binArit() is high (> 15) (gocyclo)

golint83%

Golint is a linter for Go source code.

    • sh/pattern/pattern.go
    • Line 24: warning: exported const Shortest should have comment (or a comment on this block) or be unexported (golint)
    • sh/syntax/nodes.go
    • Line 30: warning: exported method File.Pos should have comment or be unexported (golint)
    • Line 31: warning: exported method File.End should have comment or be unexported (golint)
    • Line 144: warning: exported method Comment.Pos should have comment or be unexported (golint)
    • Line 145: warning: exported method Comment.End should have comment or be unexported (golint)
    • Line 162: warning: exported method Stmt.Pos should have comment or be unexported (golint)
    • Line 163: warning: exported method Stmt.End should have comment or be unexported (golint)
    • Line 232: warning: exported method Assign.Pos should have comment or be unexported (golint)
    • Line 239: warning: exported method Assign.End should have comment or be unexported (golint)
    • Line 264: warning: exported method Redirect.Pos should have comment or be unexported (golint)
    • Line 271: warning: exported method Redirect.End should have comment or be unexported (golint)
    • Line 288: warning: exported method CallExpr.Pos should have comment or be unexported (golint)
    • Line 295: warning: exported method CallExpr.End should have comment or be unexported (golint)
    • Line 311: warning: exported method Subshell.Pos should have comment or be unexported (golint)
    • Line 312: warning: exported method Subshell.End should have comment or be unexported (golint)
    • Line 323: warning: exported method Block.Pos should have comment or be unexported (golint)
    • Line 324: warning: exported method Block.End should have comment or be unexported (golint)
    • Line 342: warning: exported method IfClause.Pos should have comment or be unexported (golint)
    • Line 343: warning: exported method IfClause.End should have comment or be unexported (golint)
    • Line 356: warning: exported method WhileClause.Pos should have comment or be unexported (golint)
    • Line 357: warning: exported method WhileClause.End should have comment or be unexported (golint)
    • Line 371: warning: exported method ForClause.Pos should have comment or be unexported (golint)
    • Line 372: warning: exported method ForClause.End should have comment or be unexported (golint)
    • Line 392: warning: exported method WordIter.Pos should have comment or be unexported (golint)
    • Line 393: warning: exported method WordIter.End should have comment or be unexported (golint)
    • Line 410: warning: exported method CStyleLoop.Pos should have comment or be unexported (golint)
    • Line 411: warning: exported method CStyleLoop.End should have comment or be unexported (golint)
    • Line 420: warning: exported method BinaryCmd.Pos should have comment or be unexported (golint)
    • Line 421: warning: exported method BinaryCmd.End should have comment or be unexported (golint)
    • Line 432: warning: exported method FuncDecl.Pos should have comment or be unexported (golint)
    • Line 433: warning: exported method FuncDecl.End should have comment or be unexported (golint)
    • Line 442: warning: exported method Word.Pos should have comment or be unexported (golint)
    • Line 443: warning: exported method Word.End should have comment or be unexported (golint)
    • Line 496: warning: exported method Lit.Pos should have comment or be unexported (golint)
    • Line 497: warning: exported method Lit.End should have comment or be unexported (golint)
    • Line 506: warning: exported method SglQuoted.Pos should have comment or be unexported (golint)
    • Line 507: warning: exported method SglQuoted.End should have comment or be unexported (golint)
    • Line 516: warning: exported method DblQuoted.Pos should have comment or be unexported (golint)
    • Line 517: warning: exported method DblQuoted.End should have comment or be unexported (golint)
    • Line 531: warning: exported method CmdSubst.Pos should have comment or be unexported (golint)
    • Line 532: warning: exported method CmdSubst.End should have comment or be unexported (golint)
    • Line 550: warning: exported method ParamExp.Pos should have comment or be unexported (golint)
    • Line 551: warning: exported method ParamExp.End should have comment or be unexported (golint)
    • Line 594: warning: exported method ArithmExp.Pos should have comment or be unexported (golint)
    • Line 595: warning: exported method ArithmExp.End should have comment or be unexported (golint)
    • Line 612: warning: exported method ArithmCmd.Pos should have comment or be unexported (golint)
    • Line 613: warning: exported method ArithmCmd.End should have comment or be unexported (golint)
    • Line 642: warning: exported method BinaryArithm.Pos should have comment or be unexported (golint)
    • Line 643: warning: exported method BinaryArithm.End should have comment or be unexported (golint)
    • Line 657: warning: exported method UnaryArithm.Pos should have comment or be unexported (golint)
    • Line 664: warning: exported method UnaryArithm.End should have comment or be unexported (golint)
    • Line 678: warning: exported method ParenArithm.Pos should have comment or be unexported (golint)
    • Line 679: warning: exported method ParenArithm.End should have comment or be unexported (golint)
    • Line 691: warning: exported method CaseClause.Pos should have comment or be unexported (golint)
    • Line 692: warning: exported method CaseClause.End should have comment or be unexported (golint)
    • Line 705: warning: exported method CaseItem.Pos should have comment or be unexported (golint)
    • Line 706: warning: exported method CaseItem.End should have comment or be unexported (golint)
    • Line 722: warning: exported method TestClause.Pos should have comment or be unexported (golint)
    • Line 723: warning: exported method TestClause.End should have comment or be unexported (golint)
    • Line 745: warning: exported method BinaryTest.Pos should have comment or be unexported (golint)
    • Line 746: warning: exported method BinaryTest.End should have comment or be unexported (golint)
    • Line 756: warning: exported method UnaryTest.Pos should have comment or be unexported (golint)
    • Line 757: warning: exported method UnaryTest.End should have comment or be unexported (golint)
    • Line 766: warning: exported method ParenTest.Pos should have comment or be unexported (golint)
    • Line 767: warning: exported method ParenTest.End should have comment or be unexported (golint)
    • Line 782: warning: exported method DeclClause.Pos should have comment or be unexported (golint)
    • Line 783: warning: exported method DeclClause.End should have comment or be unexported (golint)
    • Line 800: warning: exported method ArrayExpr.Pos should have comment or be unexported (golint)
    • Line 801: warning: exported method ArrayExpr.End should have comment or be unexported (golint)
    • Line 814: warning: exported method ArrayElem.Pos should have comment or be unexported (golint)
    • Line 821: warning: exported method ArrayElem.End should have comment or be unexported (golint)
    • Line 838: warning: exported method ExtGlob.Pos should have comment or be unexported (golint)
    • Line 839: warning: exported method ExtGlob.End should have comment or be unexported (golint)
    • Line 852: warning: exported method ProcSubst.Pos should have comment or be unexported (golint)
    • Line 853: warning: exported method ProcSubst.End should have comment or be unexported (golint)
    • Line 865: warning: exported method TimeClause.Pos should have comment or be unexported (golint)
    • Line 866: warning: exported method TimeClause.End should have comment or be unexported (golint)
    • Line 882: warning: exported method CoprocClause.Pos should have comment or be unexported (golint)
    • Line 883: warning: exported method CoprocClause.End should have comment or be unexported (golint)
    • Line 893: warning: exported method LetClause.Pos should have comment or be unexported (golint)
    • Line 894: warning: exported method LetClause.End should have comment or be unexported (golint)
    • Line 904: warning: exported method BraceExp.Pos should have comment or be unexported (golint)
    • Line 908: warning: exported method BraceExp.End should have comment or be unexported (golint)
    • Line 919: warning: exported method TestDecl.Pos should have comment or be unexported (golint)
    • Line 920: warning: exported method TestDecl.End should have comment or be unexported (golint)
    • sh/expand/environ.go
    • Line 49: warning: exported type ValueKind should have comment or be unexported (golint)
    • Line 52: warning: exported const Unset should have comment (or a comment on this block) or be unexported (golint)
    • sh/syntax/tokens.go
    • Line 155: warning: exported type RedirOperator should have comment or be unexported (golint)
    • Line 158: warning: exported const RdrOut should have comment (or a comment on this block) or be unexported (golint)
    • Line 172: warning: exported type ProcOperator should have comment or be unexported (golint)
    • Line 175: warning: exported const CmdIn should have comment (or a comment on this block) or be unexported (golint)
    • Line 179: warning: exported type GlobOperator should have comment or be unexported (golint)
    • Line 182: warning: exported const GlobZeroOrOne should have comment (or a comment on this block) or be unexported (golint)
    • Line 189: warning: exported type BinCmdOperator should have comment or be unexported (golint)
    • Line 192: warning: exported const AndStmt should have comment (or a comment on this block) or be unexported (golint)
    • Line 198: warning: exported type CaseOperator should have comment or be unexported (golint)
    • Line 201: warning: exported const Break should have comment (or a comment on this block) or be unexported (golint)
    • Line 207: warning: exported type ParNamesOperator should have comment or be unexported (golint)
    • Line 210: warning: exported const NamesPrefix should have comment (or a comment on this block) or be unexported (golint)
    • Line 214: warning: exported type ParExpOperator should have comment or be unexported (golint)
    • Line 217: warning: exported const AlternateUnset should have comment (or a comment on this block) or be unexported (golint)
    • Line 236: warning: exported type UnAritOperator should have comment or be unexported (golint)
    • Line 239: warning: exported const Not should have comment (or a comment on this block) or be unexported (golint)
    • Line 247: warning: exported type BinAritOperator should have comment or be unexported (golint)
    • Line 250: warning: exported const Add should have comment (or a comment on this block) or be unexported (golint)
    • Line 287: warning: exported type UnTestOperator should have comment or be unexported (golint)
    • Line 290: warning: exported const TsExists should have comment (or a comment on this block) or be unexported (golint)
    • Line 317: warning: exported type BinTestOperator should have comment or be unexported (golint)
    • Line 320: warning: exported const TsReMatch should have comment (or a comment on this block) or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.

    • sh/syntax/parser.go
    • Line 682: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 709: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 724: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 729: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 1274: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 1404: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 682: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 709: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 724: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 729: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 1274: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 1404: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • sh/syntax/parser_arithm.go
    • Line 26: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 33: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 52: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 133: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 141: warning: op.String undefined (type token has no field or method String) (ineffassign)
    • Line 175: warning: token(ue.Op).String undefined (type token has no field or method String) (ineffassign)
    • Line 222: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 253: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 274: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 311: warning: ftok.String undefined (type token has no field or method String) (ineffassign)
    • Line 26: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 33: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 52: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 133: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 141: warning: op.String undefined (type token has no field or method String) (ineffassign)
    • Line 175: warning: token(ue.Op).String undefined (type token has no field or method String) (ineffassign)
    • Line 222: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 253: warning: tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 274: warning: p.tok.String undefined (type token has no field or method String) (ineffassign)
    • Line 311: warning: ftok.String undefined (type token has no field or method String) (ineffassign)
    • sh/syntax/tokens.go
    • Line 339: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 340: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 341: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 342: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 343: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 344: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 345: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 346: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 347: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 348: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 349: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 339: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 340: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 341: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 342: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 343: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 344: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 345: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 346: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 347: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 348: warning: token(o).String undefined (type token has no field or method String) (ineffassign)
    • Line 349: warning: token(o).String undefined (type token has no field or method String) (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!