Preparing report...

Report for github.com/chzyer/readline

A+    Excellent!    Found 26 issues across 39 files

Tweet

gofmt97%

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!


gocyclo79%

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.

    • readline/vim.go
    • Line 40: warning: cyclomatic complexity 25 of function (*opVim).handleVimNormalMovement() is high (> 15) (gocyclo)
    • readline/complete.go
    • Line 121: warning: cyclomatic complexity 17 of function (*opCompleter).HandleCompleteSelect() is high (> 15) (gocyclo)

golint53%

Golint is a linter for Go source code.

    • readline/complete.go
    • Line 10: warning: exported type AutoCompleter should have comment or be unexported (golint)
    • Line 21: warning: exported type TabCompleter should have comment or be unexported (golint)
    • Line 23: warning: exported method TabCompleter.Do should have comment or be unexported (golint)
    • readline/complete_segment.go
    • Line 3: warning: exported type SegmentCompleter should have comment or be unexported (golint)
    • Line 28: warning: exported function SegmentFunc should have comment or be unexported (golint)
    • Line 32: warning: exported function SegmentAutoComplete should have comment or be unexported (golint)
    • Line 38: warning: exported type SegmentComplete should have comment or be unexported (golint)
    • Line 42: warning: exported function RetSegment should have comment or be unexported (golint)
    • Line 54: warning: exported function SplitSegment should have comment or be unexported (golint)
    • Line 72: warning: exported method SegmentComplete.Do should have comment or be unexported (golint)
    • readline/terminal.go
    • Line 12: warning: exported type Terminal should have comment or be unexported (golint)
    • Line 26: warning: exported function NewTerminal should have comment or be unexported (golint)
    • Line 56: warning: exported method Terminal.EnterRawMode should have comment or be unexported (golint)
    • Line 60: warning: exported method Terminal.ExitRawMode should have comment or be unexported (golint)
    • Line 79: warning: exported method Terminal.GetOffset should have comment or be unexported (golint)
    • Line 86: warning: exported method Terminal.Print should have comment or be unexported (golint)
    • Line 90: warning: exported method Terminal.PrintRune should have comment or be unexported (golint)
    • Line 94: warning: exported method Terminal.Readline should have comment or be unexported (golint)
    • Line 98: warning: comment on exported method Terminal.ReadRune should be of the form "ReadRune ..." (golint)
    • Line 107: warning: exported method Terminal.IsReading should have comment or be unexported (golint)
    • Line 111: warning: exported method Terminal.KickRead should have comment or be unexported (golint)
    • Line 200: warning: exported method Terminal.Bell should have comment or be unexported (golint)
    • Line 204: warning: exported method Terminal.Close should have comment or be unexported (golint)
    • Line 216: warning: exported method Terminal.GetConfig should have comment or be unexported (golint)
    • Line 230: warning: exported method Terminal.SetConfig should have comment or be unexported (golint)
    • readline/vim.go
    • Line 4: warning: exported const VIM_NORMAL should have comment (or a comment on this block) or be unexported (golint)
    • readline/operation.go
    • Line 10: warning: exported var ErrInterrupt should have comment or be unexported (golint)
    • Line 13: warning: exported type InterruptError should have comment or be unexported (golint)
    • Line 21: warning: exported type Operation should have comment or be unexported (golint)
    • Line 37: warning: exported method Operation.SetBuffer should have comment or be unexported (golint)
    • Line 69: warning: exported function NewOperation should have comment or be unexported (golint)
    • Line 92: warning: exported method Operation.SetPrompt should have comment or be unexported (golint)
    • Line 96: warning: exported method Operation.SetMaskRune should have comment or be unexported (golint)
    • Line 100: warning: exported method Operation.GetConfig should have comment or be unexported (golint)
    • Line 366: warning: exported method Operation.Stderr should have comment or be unexported (golint)
    • Line 370: warning: exported method Operation.Stdout should have comment or be unexported (golint)
    • Line 379: warning: exported method Operation.Runes should have comment or be unexported (golint)
    • Line 401: warning: exported method Operation.PasswordEx should have comment or be unexported (golint)
    • Line 408: warning: exported method Operation.GenPasswordConfig should have comment or be unexported (golint)
    • Line 412: warning: exported method Operation.PasswordWithConfig should have comment or be unexported (golint)
    • Line 420: warning: exported method Operation.Password should have comment or be unexported (golint)
    • Line 424: warning: exported method Operation.SetTitle should have comment or be unexported (golint)
    • Line 428: warning: exported method Operation.Slice should have comment or be unexported (golint)
    • Line 436: warning: exported method Operation.Close should have comment or be unexported (golint)
    • Line 440: warning: exported method Operation.SetHistoryPath should have comment or be unexported (golint)
    • Line 448: warning: exported method Operation.IsNormalMode should have comment or be unexported (golint)
    • Line 452: warning: exported method Operation.SetConfig should have comment or be unexported (golint)
    • Line 452: warning: receiver name op should be consistent with previous receiver name o for Operation (golint)
    • Line 487: warning: exported method Operation.ResetHistory should have comment or be unexported (golint)
    • Line 491: warning: comment on exported method Operation.SaveHistory should be of the form "SaveHistory ..." (golint)
    • Line 497: warning: exported method Operation.Refresh should have comment or be unexported (golint)
    • Line 503: warning: exported method Operation.Clean should have comment or be unexported (golint)
    • Line 507: warning: exported function FuncListener should have comment or be unexported (golint)
    • Line 511: warning: exported type DumpListener should have comment or be unexported (golint)
    • Line 515: warning: exported method DumpListener.OnChange should have comment or be unexported (golint)
    • Line 519: warning: exported type Listener should have comment or be unexported (golint)
    • Line 523: warning: exported type Painter should have comment or be unexported (golint)
    • readline/remote.go
    • Line 15: warning: exported type MsgType should have comment or be unexported (golint)
    • Line 18: warning: exported const T_DATA should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported type RemoteSvr should have comment or be unexported (golint)
    • Line 59: warning: exported function NewRemoteSvr should have comment or be unexported (golint)
    • Line 102: warning: exported method RemoteSvr.HandleConfig should have comment or be unexported (golint)
    • Line 116: warning: exported method RemoteSvr.IsTerminal should have comment or be unexported (golint)
    • Line 166: warning: exported method RemoteSvr.EnterRawMode should have comment or be unexported (golint)
    • Line 170: warning: exported method RemoteSvr.ExitRawMode should have comment or be unexported (golint)
    • Line 192: warning: exported method RemoteSvr.Close should have comment or be unexported (golint)
    • Line 230: warning: exported method RemoteSvr.GotIsTerminal should have comment or be unexported (golint)
    • Line 238: warning: exported method RemoteSvr.GotReportWidth should have comment or be unexported (golint)
    • Line 245: warning: exported method RemoteSvr.GetWidth should have comment or be unexported (golint)
    • Line 251: warning: exported type Message should have comment or be unexported (golint)
    • Line 256: warning: exported function ReadMessage should have comment or be unexported (golint)
    • Line 272: warning: exported function NewMessage should have comment or be unexported (golint)
    • Line 276: warning: exported method Message.WriteTo should have comment or be unexported (golint)
    • Line 287: warning: exported type RemoteCli should have comment or be unexported (golint)
    • Line 298: warning: exported function NewRemoteCli should have comment or be unexported (golint)
    • Line 306: warning: exported method RemoteCli.MarkIsTerminal should have comment or be unexported (golint)
    • Line 395: warning: exported method RemoteCli.ServeBy should have comment or be unexported (golint)
    • Line 414: warning: exported method RemoteCli.Close should have comment or be unexported (golint)
    • Line 418: warning: exported method RemoteCli.Serve should have comment or be unexported (golint)
    • Line 422: warning: exported function ListenRemote should have comment or be unexported (golint)
    • Line 449: warning: exported function HandleConn should have comment or be unexported (golint)
    • Line 463: warning: exported function DialRemote should have comment or be unexported (golint)
    • readline/runes.go
    • Line 10: warning: exported var TabWidth should have comment or be unexported (golint)
    • Line 12: warning: exported type Runes should have comment or be unexported (golint)
    • Line 14: warning: exported method Runes.EqualRune should have comment or be unexported (golint)
    • Line 32: warning: exported method Runes.EqualRuneFold should have comment or be unexported (golint)
    • Line 36: warning: exported method Runes.EqualFold should have comment or be unexported (golint)
    • Line 50: warning: exported method Runes.Equal should have comment or be unexported (golint)
    • Line 62: warning: exported method Runes.IndexAllBckEx should have comment or be unexported (golint)
    • Line 62: warning: receiver name rs should be consistent with previous receiver name r for Runes (golint)
    • Line 78: warning: comment on exported method Runes.IndexAllBck should be of the form "IndexAllBck ..." (golint)
    • Line 79: warning: receiver name rs should be consistent with previous receiver name r for Runes (golint)
    • Line 83: warning: comment on exported method Runes.IndexAll should be of the form "IndexAll ..." (golint)
    • Line 84: warning: receiver name rs should be consistent with previous receiver name r for Runes (golint)
    • Line 88: warning: exported method Runes.IndexAllEx should have comment or be unexported (golint)
    • Line 88: warning: receiver name rs should be consistent with previous receiver name r for Runes (golint)
    • Line 107: warning: exported method Runes.Index should have comment or be unexported (golint)
    • Line 116: warning: exported method Runes.ColorFilter should have comment or be unexported (golint)
    • Line 146: warning: exported method Runes.Width should have comment or be unexported (golint)
    • Line 159: warning: exported method Runes.WidthAll should have comment or be unexported (golint)
    • Line 166: warning: exported method Runes.Backspace should have comment or be unexported (golint)
    • Line 170: warning: exported method Runes.Copy should have comment or be unexported (golint)
    • Line 176: warning: exported method Runes.HasPrefixFold should have comment or be unexported (golint)
    • Line 183: warning: exported method Runes.HasPrefix should have comment or be unexported (golint)
    • Line 190: warning: exported method Runes.Aggregate should have comment or be unexported (golint)
    • Line 214: warning: exported method Runes.TrimSpaceLeft should have comment or be unexported (golint)
    • readline/term.go
    • Line 7: warning: package comment should be of the form "Package readline ..." (golint)
    • Line 43: 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)
    • readline/utils.go
    • Line 21: warning: exported const CharLineStart should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported const MetaBackward should have comment (or a comment on this block) or be unexported (golint)
    • Line 81: warning: exported function Restore should have comment or be unexported (golint)
    • Line 87: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 94: warning: exported function IsPrintable should have comment or be unexported (golint)
    • Line 191: warning: exported function SplitByLine should have comment or be unexported (golint)
    • Line 209: warning: comment on exported function LineCount should be of the form "LineCount ..." (golint)
    • Line 218: warning: exported function IsWordBreak should have comment or be unexported (golint)
    • Line 229: warning: exported function GetInt should have comment or be unexported (golint)
    • Line 240: warning: exported type RawMode should have comment or be unexported (golint)
    • Line 244: warning: exported method RawMode.Enter should have comment or be unexported (golint)
    • Line 249: warning: exported method RawMode.Exit should have comment or be unexported (golint)
    • Line 272: warning: comment on exported function Debug should be of the form "Debug ..." (golint)
    • readline/runes/runes.go
    • Line 1: warning: package comment should be of the form "Package runes ..." (golint)
    • Line 11: warning: exported function Equal should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function IndexAllBck should be of the form "IndexAllBck ..." (golint)
    • Line 40: warning: comment on exported function IndexAll should be of the form "IndexAll ..." (golint)
    • Line 60: warning: exported function Index should have comment or be unexported (golint)
    • Line 69: warning: exported function ColorFilter should have comment or be unexported (golint)
    • Line 99: warning: exported function Width should have comment or be unexported (golint)
    • Line 109: warning: exported function WidthAll should have comment or be unexported (golint)
    • Line 116: warning: exported function Backspace should have comment or be unexported (golint)
    • Line 120: warning: exported function Copy should have comment or be unexported (golint)
    • Line 126: warning: exported function HasPrefix should have comment or be unexported (golint)
    • Line 133: warning: exported function Aggregate should have comment or be unexported (golint)
    • readline/readline.go
    • Line 1: warning: package comment should be of the form "Package readline ..." (golint)
    • Line 22: warning: exported type Instance should have comment or be unexported (golint)
    • Line 28: warning: exported type Config should have comment or be unexported (golint)
    • Line 93: warning: exported method Config.Init should have comment or be unexported (golint)
    • Line 148: warning: exported method Config.Clone should have comment or be unexported (golint)
    • Line 154: warning: exported method Config.SetListener should have comment or be unexported (golint)
    • Line 158: warning: exported method Config.SetPainter should have comment or be unexported (golint)
    • Line 162: warning: exported function NewEx should have comment or be unexported (golint)
    • Line 178: warning: exported function New should have comment or be unexported (golint)
    • Line 182: warning: exported method Instance.ResetHistory should have comment or be unexported (golint)
    • Line 186: warning: exported method Instance.SetPrompt should have comment or be unexported (golint)
    • Line 190: warning: exported method Instance.SetMaskRune should have comment or be unexported (golint)
    • Line 194: warning: comment on exported method Instance.SetHistoryPath should be of the form "SetHistoryPath ..." (golint)
    • Line 199: warning: comment on exported method Instance.Stdout should be of the form "Stdout ..." (golint)
    • Line 204: warning: comment on exported method Instance.Stderr should be of the form "Stderr ..." (golint)
    • Line 209: warning: comment on exported method Instance.SetVimMode should be of the form "SetVimMode ..." (golint)
    • Line 214: warning: exported method Instance.IsVimMode should have comment or be unexported (golint)
    • Line 218: warning: exported method Instance.GenPasswordConfig should have comment or be unexported (golint)
    • Line 222: warning: comment on exported method Instance.ReadPasswordWithConfig should be of the form "ReadPasswordWithConfig ..." (golint)
    • Line 227: warning: exported method Instance.ReadPasswordEx should have comment or be unexported (golint)
    • Line 231: warning: exported method Instance.ReadPassword should have comment or be unexported (golint)
    • Line 235: warning: exported type Result should have comment or be unexported (golint)
    • Line 240: warning: exported method Result.CanContinue should have comment or be unexported (golint)
    • Line 244: warning: exported method Result.CanBreak should have comment or be unexported (golint)
    • Line 248: warning: exported method Instance.Line should have comment or be unexported (golint)
    • Line 253: warning: comment on exported method Instance.Readline should be of the form "Readline ..." (golint)
    • Line 258: warning: exported method Instance.ReadlineWithDefault should have comment or be unexported (golint)
    • Line 263: warning: exported method Instance.SaveHistory should have comment or be unexported (golint)
    • Line 267: warning: comment on exported method Instance.ReadSlice should be of the form "ReadSlice ..." (golint)
    • Line 272: warning: comment on exported method Instance.Close should be of the form "Close ..." (golint)
    • Line 281: warning: exported method Instance.Clean should have comment or be unexported (golint)
    • Line 303: warning: exported method Instance.SetConfig should have comment or be unexported (golint)
    • Line 314: warning: exported method Instance.Refresh should have comment or be unexported (golint)
    • readline/runebuf.go
    • Line 17: warning: exported type RuneBuffer should have comment or be unexported (golint)
    • Line 42: warning: exported method RuneBuffer.OnWidthChange should have comment or be unexported (golint)
    • Line 48: warning: exported method RuneBuffer.Backup should have comment or be unexported (golint)
    • Line 54: warning: exported method RuneBuffer.Restore should have comment or be unexported (golint)
    • Line 64: warning: exported function NewRuneBuffer should have comment or be unexported (golint)
    • Line 75: warning: exported method RuneBuffer.SetConfig should have comment or be unexported (golint)
    • Line 82: warning: exported method RuneBuffer.SetMask should have comment or be unexported (golint)
    • Line 88: warning: exported method RuneBuffer.CurrentWidth should have comment or be unexported (golint)
    • Line 94: warning: exported method RuneBuffer.PromptLen should have comment or be unexported (golint)
    • Line 105: warning: exported method RuneBuffer.RuneSlice should have comment or be unexported (golint)
    • Line 119: warning: exported method RuneBuffer.Runes should have comment or be unexported (golint)
    • Line 127: warning: exported method RuneBuffer.Pos should have comment or be unexported (golint)
    • Line 133: warning: exported method RuneBuffer.Len should have comment or be unexported (golint)
    • Line 139: warning: exported method RuneBuffer.MoveToLineStart should have comment or be unexported (golint)
    • Line 148: warning: exported method RuneBuffer.MoveBackward should have comment or be unexported (golint)
    • Line 157: warning: exported method RuneBuffer.WriteString should have comment or be unexported (golint)
    • Line 161: warning: exported method RuneBuffer.WriteRune should have comment or be unexported (golint)
    • Line 165: warning: exported method RuneBuffer.WriteRunes should have comment or be unexported (golint)
    • Line 173: warning: exported method RuneBuffer.MoveForward should have comment or be unexported (golint)
    • Line 182: warning: exported method RuneBuffer.IsCursorInEnd should have comment or be unexported (golint)
    • Line 188: warning: exported method RuneBuffer.Replace should have comment or be unexported (golint)
    • Line 194: warning: exported method RuneBuffer.Erase should have comment or be unexported (golint)
    • Line 202: warning: exported method RuneBuffer.Delete should have comment or be unexported (golint)
    • Line 214: warning: exported method RuneBuffer.DeleteWord should have comment or be unexported (golint)
    • Line 234: warning: exported method RuneBuffer.MoveToPrevWord should have comment or be unexported (golint)
    • Line 253: warning: exported method RuneBuffer.KillFront should have comment or be unexported (golint)
    • Line 267: warning: exported method RuneBuffer.Kill should have comment or be unexported (golint)
    • Line 274: warning: exported method RuneBuffer.Transpose should have comment or be unexported (golint)
    • Line 294: warning: exported method RuneBuffer.MoveToNextWord should have comment or be unexported (golint)
    • Line 307: warning: exported method RuneBuffer.MoveToEndWord should have comment or be unexported (golint)
    • Line 329: warning: exported method RuneBuffer.BackEscapeWord should have comment or be unexported (golint)
    • Line 348: warning: exported method RuneBuffer.Yank should have comment or be unexported (golint)
    • Line 362: warning: exported method RuneBuffer.Backspace should have comment or be unexported (golint)
    • Line 373: warning: exported method RuneBuffer.MoveToLineEnd should have comment or be unexported (golint)
    • Line 383: warning: exported method RuneBuffer.LineCount should have comment or be unexported (golint)
    • Line 391: warning: exported method RuneBuffer.MoveTo should have comment or be unexported (golint)
    • Line 432: warning: exported method RuneBuffer.IdxLine should have comment or be unexported (golint)
    • Line 446: warning: exported method RuneBuffer.CursorLineCount should have comment or be unexported (golint)
    • Line 450: warning: exported method RuneBuffer.Refresh should have comment or be unexported (golint)
    • Line 468: warning: exported method RuneBuffer.SetOffset should have comment or be unexported (golint)
    • Line 542: warning: exported method RuneBuffer.Reset should have comment or be unexported (golint)
    • Line 556: warning: exported method RuneBuffer.SetStyle should have comment or be unexported (golint)
    • Line 574: warning: exported method RuneBuffer.SetWithIdx should have comment or be unexported (golint)
    • Line 581: warning: exported method RuneBuffer.Set should have comment or be unexported (golint)
    • Line 585: warning: exported method RuneBuffer.SetPrompt should have comment or be unexported (golint)
    • Line 613: warning: exported method RuneBuffer.Clean should have comment or be unexported (golint)
    • readline/std.go
    • Line 11: warning: exported var Stdin should have comment or be unexported (golint)
    • Line 31: warning: comment on exported function SetHistoryPath should be of the form "SetHistoryPath ..." (golint)
    • Line 42: warning: comment on exported function SetAutoComplete should be of the form "SetAutoComplete ..." (golint)
    • Line 50: warning: comment on exported function AddHistory should be of the form "AddHistory ..." (golint)
    • Line 57: warning: exported function Password should have comment or be unexported (golint)
    • Line 62: warning: comment on exported function Line should be of the form "Line ..." (golint)
    • Line 69: warning: exported type CancelableStdin should have comment or be unexported (golint)
    • Line 80: warning: exported function NewCancelableStdin should have comment or be unexported (golint)
    • Line 128: warning: exported method CancelableStdin.Close should have comment or be unexported (golint)
    • Line 194: warning: exported method FillableStdin.Close should have comment or be unexported (golint)
    • readline/complete_helper.go
    • Line 8: warning: comment on exported type DynamicCompleteFunc should be of the form "DynamicCompleteFunc ..." (with optional leading article) (golint)
    • Line 11: warning: exported type PrefixCompleterInterface should have comment or be unexported (golint)
    • Line 19: warning: exported type DynamicPrefixCompleterInterface should have comment or be unexported (golint)
    • Line 25: warning: exported type PrefixCompleter should have comment or be unexported (golint)
    • Line 32: warning: exported method PrefixCompleter.Tree should have comment or be unexported (golint)
    • Line 38: warning: exported function Print should have comment or be unexported (golint)
    • Line 54: warning: exported method PrefixCompleter.Print should have comment or be unexported (golint)
    • Line 58: warning: exported method PrefixCompleter.IsDynamic should have comment or be unexported (golint)
    • Line 62: warning: exported method PrefixCompleter.GetName should have comment or be unexported (golint)
    • Line 66: warning: exported method PrefixCompleter.GetDynamicNames should have comment or be unexported (golint)
    • Line 74: warning: exported method PrefixCompleter.GetChildren should have comment or be unexported (golint)
    • Line 78: warning: exported method PrefixCompleter.SetChildren should have comment or be unexported (golint)
    • Line 82: warning: exported function NewPrefixCompleter should have comment or be unexported (golint)
    • Line 86: warning: exported function PcItem should have comment or be unexported (golint)
    • Line 95: warning: exported function PcItemDynamic should have comment or be unexported (golint)
    • Line 103: warning: exported method PrefixCompleter.Do should have comment or be unexported (golint)
    • Line 107: warning: exported function Do should have comment or be unexported (golint)
    • readline/search.go
    • Line 11: warning: exported const S_STATE_FOUND should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported const S_DIR_BCK should have comment (or a comment on this block) or be unexported (golint)
    • readline/utils_unix.go
    • Line 39: warning: exported function GetScreenWidth should have comment or be unexported (golint)
    • Line 52: warning: exported function DefaultIsTerminal should have comment or be unexported (golint)
    • Line 56: warning: exported function GetStdin should have comment or be unexported (golint)
    • Line 67: warning: exported function DefaultOnWidthChanged should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign82%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words