Preparing report...

Report for github.com/NeowayLabs/nash

A    Great!    Found 46 issues across 92 files

Tweet

gofmt82%

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!


gocyclo92%

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.

    • nash/scanner/lex.go
    • Line 206: warning: cyclomatic complexity 71 of function lexStart() is high (> 15) (gocyclo)
    • Line 573: warning: cyclomatic complexity 16 of function isArgument() is high (> 15) (gocyclo)
    • Line 466: warning: cyclomatic complexity 16 of function lexQuote() is high (> 15) (gocyclo)
    • nash/parser/parse.go
    • Line 357: warning: cyclomatic complexity 25 of function (*Parser).parseCommand() is high (> 15) (gocyclo)
    • Line 465: warning: cyclomatic complexity 18 of function (*Parser).parseRedirection() is high (> 15) (gocyclo)
    • Line 1325: warning: cyclomatic complexity 18 of function (*Parser).parseReturn() is high (> 15) (gocyclo)
    • Line 1416: warning: cyclomatic complexity 17 of function (*Parser).parseFor() is high (> 15) (gocyclo)
    • Line 629: warning: cyclomatic complexity 16 of function (*Parser).getArgument() is high (> 15) (gocyclo)
    • nash/internal/sh/shell.go
    • Line 1281: warning: cyclomatic complexity 25 of function (*Shell).buildRedirect() is high (> 15) (gocyclo)
    • Line 1028: warning: cyclomatic complexity 21 of function (*Shell).executePipe() is high (> 15) (gocyclo)
    • Line 812: warning: cyclomatic complexity 19 of function (*Shell).executeNode() is high (> 15) (gocyclo)
    • Line 2322: warning: cyclomatic complexity 18 of function (*Shell).executeFor() is high (> 15) (gocyclo)
    • Line 738: warning: cyclomatic complexity 17 of function (*Shell).evalConcat() is high (> 15) (gocyclo)
    • Line 1718: warning: cyclomatic complexity 16 of function (*Shell).evalArgExpr() is high (> 15) (gocyclo)
    • Line 1776: warning: cyclomatic complexity 16 of function (*Shell).evalExpr() is high (> 15) (gocyclo)

golint67%

Golint is a linter for Go source code.

    • nash/scanner/lex.go
    • Line 14: warning: exported type Token should have comment or be unexported (golint)
    • Line 50: warning: exported method Token.Type should have comment or be unexported (golint)
    • Line 51: warning: exported method Token.Value should have comment or be unexported (golint)
    • Line 194: warning: exported function Lex should have comment or be unexported (golint)
    • nash/internal/sh/shell.go
    • Line 34: warning: exported type Var should have comment or be unexported (golint)
    • Line 35: warning: exported type Fns should have comment or be unexported (golint)
    • Line 37: warning: exported type StatusCode should have comment or be unexported (golint)
    • Line 87: warning: exported const ESuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 118: warning: exported function NewAbortShell should have comment or be unexported (golint)
    • Line 194: warning: exported method Shell.NashPath should have comment or be unexported (golint)
    • Line 275: warning: exported method Shell.Interactive should have comment or be unexported (golint)
    • Line 283: warning: exported method Shell.SetName should have comment or be unexported (golint)
    • Line 287: warning: exported method Shell.Name should have comment or be unexported (golint)
    • Line 289: warning: exported method Shell.SetParent should have comment or be unexported (golint)
    • Line 293: warning: exported method Shell.Environ should have comment or be unexported (golint)
    • Line 301: warning: exported method Shell.Getenv should have comment or be unexported (golint)
    • Line 310: warning: exported method Shell.Setenv should have comment or be unexported (golint)
    • Line 322: warning: exported method Shell.SetEnviron should have comment or be unexported (golint)
    • Line 376: warning: exported method Shell.Setbindfn should have comment or be unexported (golint)
    • Line 380: warning: exported method Shell.Getbindfn should have comment or be unexported (golint)
    • Line 414: warning: exported method Shell.IsFn should have comment or be unexported (golint)
    • Line 415: warning: exported method Shell.SetIsFn should have comment or be unexported (golint)
    • Line 437: warning: exported method Shell.Stdout should have comment or be unexported (golint)
    • Line 438: warning: exported method Shell.Stderr should have comment or be unexported (golint)
    • Line 439: warning: exported method Shell.Stdin should have comment or be unexported (golint)
    • Line 574: warning: comment on exported method Shell.ExecFile should be of the form "ExecFile ..." (golint)
    • Line 869: warning: exported method Shell.ExecuteTree should have comment or be unexported (golint)
    • nash/sh/obj.go
    • Line 15: warning: exported type Obj should have comment or be unexported (golint)
    • Line 20: warning: exported type ListObj should have comment or be unexported (golint)
    • Line 25: warning: exported type FnObj should have comment or be unexported (golint)
    • Line 30: warning: exported type StrObj should have comment or be unexported (golint)
    • Line 35: warning: exported type Collection should have comment or be unexported (golint)
    • Line 40: warning: exported type WriteableCollection should have comment or be unexported (golint)
    • Line 45: warning: exported function NewCollection should have comment or be unexported (golint)
    • Line 56: warning: exported function NewWriteableCollection should have comment or be unexported (golint)
    • Line 71: warning: exported function NewStrObj should have comment or be unexported (golint)
    • Line 78: warning: exported method StrObj.Str should have comment or be unexported (golint)
    • Line 82: warning: exported method StrObj.Get should have comment or be unexported (golint)
    • Line 94: warning: exported method StrObj.Len should have comment or be unexported (golint)
    • Line 98: warning: exported function NewFnObj should have comment or be unexported (golint)
    • Line 105: warning: exported method FnObj.Fn should have comment or be unexported (golint)
    • Line 109: warning: exported function NewListObj should have comment or be unexported (golint)
    • Line 116: warning: exported method ListObj.Len should have comment or be unexported (golint)
    • Line 120: warning: exported method ListObj.Set should have comment or be unexported (golint)
    • Line 132: warning: exported method ListObj.Get should have comment or be unexported (golint)
    • Line 143: warning: exported method ListObj.List should have comment or be unexported (golint)
    • nash/internal/testing/fixture/io.go
    • Line 90: warning: exported function WorkingDir should have comment or be unexported (golint)
    • Line 100: warning: exported function ChangeDir should have comment or be unexported (golint)
    • Line 109: warning: exported function Chmod should have comment or be unexported (golint)
    • nash/internal/sh/builtin/glob.go
    • Line 26: warning: receiver name g should be consistent with previous receiver name p for globFn (golint)
    • Line 41: warning: receiver name g should be consistent with previous receiver name p for globFn (golint)
    • nash/internal/sh/cmd.go
    • Line 41: warning: exported function NewCmd should have comment or be unexported (golint)
    • Line 64: warning: exported method Cmd.Stdin should have comment or be unexported (golint)
    • Line 65: warning: exported method Cmd.Stdout should have comment or be unexported (golint)
    • Line 66: warning: exported method Cmd.Stderr should have comment or be unexported (golint)
    • Line 68: warning: exported method Cmd.SetStdin should have comment or be unexported (golint)
    • Line 69: warning: exported method Cmd.SetStdout should have comment or be unexported (golint)
    • Line 70: warning: exported method Cmd.SetStderr should have comment or be unexported (golint)
    • Line 72: warning: exported method Cmd.SetArgs should have comment or be unexported (golint)
    • Line 103: warning: exported method Cmd.Args should have comment or be unexported (golint)
    • Line 105: warning: exported method Cmd.SetEnviron should have comment or be unexported (golint)
    • Line 109: warning: exported method Cmd.Wait should have comment or be unexported (golint)
    • Line 119: warning: exported method Cmd.Start should have comment or be unexported (golint)
    • Line 127: warning: exported method Cmd.Results should have comment or be unexported (golint)
    • nash/token/token.go
    • Line 6: warning: exported type Token should have comment or be unexported (golint)
    • Line 8: warning: exported type FileInfo should have comment or be unexported (golint)
    • Line 14: warning: exported const Illegal should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: don't use underscores in Go names; const literal_beg should be literalBeg (golint)
    • Line 25: warning: don't use underscores in Go names; const literal_end should be literalEnd (golint)
    • Line 27: warning: don't use underscores in Go names; const operator_beg should be operatorBeg (golint)
    • Line 41: warning: don't use underscores in Go names; const operator_end should be operatorEnd (golint)
    • Line 56: warning: don't use underscores in Go names; const keyword_beg should be keywordBeg (golint)
    • Line 71: warning: don't use underscores in Go names; const keyword_end should be keywordEnd (golint)
    • Line 132: warning: exported function Lookup should have comment or be unexported (golint)
    • Line 140: warning: exported function IsKeyword should have comment or be unexported (golint)
    • Line 148: warning: exported function NewFileInfo should have comment or be unexported (golint)
    • Line 149: warning: exported method FileInfo.Line should have comment or be unexported (golint)
    • Line 150: warning: exported method FileInfo.Column should have comment or be unexported (golint)
    • nash/cmd/nash/env.go
    • Line 9: warning: exported function NashPath should have comment or be unexported (golint)
    • Line 18: warning: exported function NashRoot should have comment or be unexported (golint)
    • nash/ast/tree.go
    • Line 18: warning: exported method Tree.IsEqual should have comment or be unexported (golint)
    • Line 26: warning: receiver name tree should be consistent with previous receiver name t for Tree (golint)
    • nash/internal/sh/fncall.go
    • Line 14: warning: exported type FnArg should have comment or be unexported (golint)
    • Line 19: warning: exported type UserFn should have comment or be unexported (golint)
    • Line 39: warning: exported function NewUserFn should have comment or be unexported (golint)
    • Line 62: warning: exported method UserFn.ArgNames should have comment or be unexported (golint)
    • Line 64: warning: exported method UserFn.AddArgName should have comment or be unexported (golint)
    • Line 68: warning: exported method UserFn.SetArgs should have comment or be unexported (golint)
    • Line 140: warning: exported method UserFn.Name should have comment or be unexported (golint)
    • Line 142: warning: exported method UserFn.SetRepr should have comment or be unexported (golint)
    • Line 160: warning: exported method UserFn.Start should have comment or be unexported (golint)
    • Line 170: warning: exported method UserFn.Results should have comment or be unexported (golint)
    • Line 172: warning: exported method UserFn.Wait should have comment or be unexported (golint)
    • Line 180: warning: exported method UserFn.SetEnviron should have comment or be unexported (golint)
    • Line 184: warning: exported method UserFn.SetStderr should have comment or be unexported (golint)
    • Line 188: warning: exported method UserFn.SetStdout should have comment or be unexported (golint)
    • Line 192: warning: exported method UserFn.SetStdin should have comment or be unexported (golint)
    • Line 196: warning: exported method UserFn.Stdin should have comment or be unexported (golint)
    • Line 197: warning: exported method UserFn.Stdout should have comment or be unexported (golint)
    • Line 198: warning: exported method UserFn.Stderr should have comment or be unexported (golint)
    • Line 207: warning: exported method UserFn.StdoutPipe should have comment or be unexported (golint)
    • nash/ast/node.go
    • Line 16: warning: exported const RforkFlags should have comment (or a comment on this block) or be unexported (golint)
    • Line 79: warning: exported type NameNode should have comment or be unexported (golint)
    • Line 396: warning: exported const NodeFnArg should have comment (or a comment on this block) or be unexported (golint)
    • Line 401: warning: comment on exported const NodeVarExecAssignDecl should be of the form "NodeVarExecAssignDecl ..." (golint)
    • Line 418: warning: exported var DebugCmp should have comment or be unexported (golint)
    • Line 572: warning: exported function NewNameNode should have comment or be unexported (golint)
    • Line 581: warning: exported method NameNode.IsEqual should have comment or be unexported (golint)
    • Line 709: warning: exported method ExecAssignNode.IsEqual should have comment or be unexported (golint)
    • Line 754: warning: exported method CommandNode.IsMulti should have comment or be unexported (golint)
    • Line 755: warning: exported method CommandNode.SetMulti should have comment or be unexported (golint)
    • Line 843: warning: exported method PipeNode.IsMulti should have comment or be unexported (golint)
    • Line 844: warning: exported method PipeNode.SetMulti should have comment or be unexported (golint)
    • Line 971: warning: exported method RforkNode.IsEqual should have comment or be unexported (golint)
    • Line 1005: warning: exported method CommentNode.IsEqual should have comment or be unexported (golint)
    • Line 1133: warning: exported function NewFnArgNode should have comment or be unexported (golint)
    • Line 1143: warning: exported method FnArgNode.IsEqual should have comment or be unexported (golint)
    • Line 1158: warning: exported function NewVarAssignDecl should have comment or be unexported (golint)
    • Line 1165: warning: exported method VarAssignDeclNode.IsEqual should have comment or be unexported (golint)
    • Line 1178: warning: exported function NewVarExecAssignDecl should have comment or be unexported (golint)
    • Line 1185: warning: exported method VarExecAssignDeclNode.IsEqual should have comment or be unexported (golint)
    • Line 1238: warning: exported method FnDeclNode.IsEqual should have comment or be unexported (golint)
    • Line 1332: warning: exported method BindFnNode.IsEqual should have comment or be unexported (golint)
    • Line 1354: warning: exported method ReturnNode.IsEqual should have comment or be unexported (golint)
    • Line 1401: warning: comment on exported method ForNode.InExpr should be of the form "InExpr ..." (golint)
    • Line 1404: warning: comment on exported method ForNode.SetInExpr should be of the form "SetInExpr ..." (golint)
    • Line 1415: warning: exported method ForNode.IsEqual should have comment or be unexported (golint)
    • nash/sh/shell.go
    • Line 6: warning: exported type Runner should have comment or be unexported (golint)
    • Line 24: warning: exported type FnArg should have comment or be unexported (golint)
    • Line 29: warning: exported type Fn should have comment or be unexported (golint)
    • Line 38: warning: exported type FnDef should have comment or be unexported (golint)
    • Line 45: warning: exported function NewFnArg should have comment or be unexported (golint)
    • nash/internal/sh/internal/fixture/fixture.go
    • Line 12: warning: exported type NashDirs should have comment or be unexported (golint)
    • Line 20: warning: exported var MkdirAll should have comment or be unexported (golint)
    • Line 22: warning: exported var Tmpdir should have comment or be unexported (golint)
    • Line 24: warning: exported function SetupShell should have comment or be unexported (golint)
    • Line 37: warning: exported function SetupNashDirs should have comment or be unexported (golint)
    • nash/nash.go
    • Line 61: warning: exported method Shell.NashPath should have comment or be unexported (golint)
    • nash/cmd/nash/completer.go
    • Line 15: warning: exported type Completer should have comment or be unexported (golint)
    • Line 21: warning: exported function NewCompleter should have comment or be unexported (golint)
    • Line 25: warning: exported method Completer.Do should have comment or be unexported (golint)
    • nash/ast/node_args.go
    • Line 10: warning: comment on exported function ExprFromToken should be of the form "ExprFromToken ..." (golint)
    • Line 24: warning: comment on exported function NewStringExpr should be of the form "NewStringExpr ..." (golint)
    • Line 40: warning: exported method StringExpr.SetValue should have comment or be unexported (golint)
    • Line 44: warning: exported method StringExpr.IsEqual should have comment or be unexported (golint)
    • Line 62: warning: exported function NewIntExpr should have comment or be unexported (golint)
    • Line 71: warning: exported method IntExpr.Value should have comment or be unexported (golint)
    • Line 73: warning: exported method IntExpr.IsEqual should have comment or be unexported (golint)
    • Line 87: warning: exported function NewListExpr should have comment or be unexported (golint)
    • Line 91: warning: exported function NewListVariadicExpr should have comment or be unexported (golint)
    • Line 106: warning: exported method ListExpr.IsEqual should have comment or be unexported (golint)
    • Line 133: warning: exported function NewConcatExpr should have comment or be unexported (golint)
    • Line 147: warning: comment on exported method ConcatExpr.SetConcat should be of the form "SetConcat ..." (golint)
    • Line 152: warning: exported method ConcatExpr.List should have comment or be unexported (golint)
    • Line 154: warning: exported method ConcatExpr.IsEqual should have comment or be unexported (golint)
    • Line 178: warning: exported function NewVarExpr should have comment or be unexported (golint)
    • Line 182: warning: exported function NewVarVariadicExpr should have comment or be unexported (golint)
    • Line 191: warning: exported method VarExpr.IsEqual should have comment or be unexported (golint)
    • Line 205: warning: exported function NewIndexExpr should have comment or be unexported (golint)
    • Line 209: warning: exported function NewIndexVariadicExpr should have comment or be unexported (golint)
    • Line 220: warning: exported method IndexExpr.IsEqual should have comment or be unexported (golint)
    • nash/cmd/nash/cli.go
    • Line 18: warning: exported type Interrupted should have comment or be unexported (golint)
    • Line 22: warning: exported type Ignored should have comment or be unexported (golint)
    • Line 26: warning: exported type BlockNotFinished should have comment or be unexported (golint)
    • nash/cmd/nash/install.go
    • Line 11: warning: exported function NashLibDir should have comment or be unexported (golint)
    • Line 16: warning: exported function InstallLib should have comment or be unexported (golint)
    • nash/errors/error.go
    • Line 11: warning: exported type NashError should have comment or be unexported (golint)
    • Line 34: warning: exported function NewError should have comment or be unexported (golint)
    • Line 40: warning: exported function NewEvalError should have comment or be unexported (golint)
    • Line 45: warning: exported method NashError.SetReason should have comment or be unexported (golint)
    • Line 53: warning: exported function NewUnfinishedBlockError should have comment or be unexported (golint)
    • Line 60: warning: exported function NewUnfinishedListError should have comment or be unexported (golint)
    • Line 67: warning: exported function NewUnfinishedCmdError should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell97%

Misspell Finds commonly misspelled English words