Preparing report...

Report for github.com/nsf/termbox-go

A+    Excellent!    Found 9 issues across 32 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!


gocyclo90%

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.

    • termbox-go/termbox_windows.go
    • Line 692: warning: cyclomatic complexity 57 of function key_event_record_to_event() is high (> 15) (gocyclo)
    • Line 847: warning: cyclomatic complexity 33 of function input_event_producer() is high (> 15) (gocyclo)
    • termbox-go/termbox.go
    • Line 368: warning: cyclomatic complexity 31 of function parse_mouse_event() is high (> 15) (gocyclo)
    • Line 215: warning: cyclomatic complexity 26 of function send_attr() is high (> 15) (gocyclo)
    • termbox-go/api.go
    • Line 27: warning: cyclomatic complexity 21 of function Init() is high (> 15) (gocyclo)
    • Line 369: warning: cyclomatic complexity 17 of function PollEvent() is high (> 15) (gocyclo)

golint75%

Golint is a linter for Go source code.

    • termbox-go/terminfo_builtin.go
    • Line 6: warning: don't use underscores in Go names; var eterm_keys should be etermKeys (golint)
    • Line 9: warning: don't use underscores in Go names; var eterm_funcs should be etermFuncs (golint)
    • Line 30: warning: don't use underscores in Go names; var screen_keys should be screenKeys (golint)
    • Line 33: warning: don't use underscores in Go names; var screen_funcs should be screenFuncs (golint)
    • Line 54: warning: don't use underscores in Go names; var xterm_keys should be xtermKeys (golint)
    • Line 57: warning: don't use underscores in Go names; var xterm_funcs should be xtermFuncs (golint)
    • Line 78: warning: don't use underscores in Go names; var rxvt_unicode_keys should be rxvtUnicodeKeys (golint)
    • Line 81: warning: don't use underscores in Go names; var rxvt_unicode_funcs should be rxvtUnicodeFuncs (golint)
    • Line 102: warning: don't use underscores in Go names; var linux_keys should be linuxKeys (golint)
    • Line 105: warning: don't use underscores in Go names; var linux_funcs should be linuxFuncs (golint)
    • Line 126: warning: don't use underscores in Go names; var rxvt_256color_keys should be rxvt256colorKeys (golint)
    • Line 129: warning: don't use underscores in Go names; var rxvt_256color_funcs should be rxvt256colorFuncs (golint)
    • termbox-go/api.go
    • Line 18: warning: comment on exported function Init should be of the form "Init ..." (golint)
    • Line 134: warning: comment on exported function Close should be of the form "Close ..." (golint)
    • Line 170: warning: comment on exported function Flush should be of the form "Flush ..." (golint)
    • Line 179: warning: don't use underscores in Go names; var line_offset should be lineOffset (golint)
    • Line 181: warning: don't use underscores in Go names; var cell_offset should be cellOffset (golint)
    • Line 222: warning: comment on exported function SetCursor should be of the form "SetCursor ..." (golint)
    • Line 238: warning: comment on exported function HideCursor should be of the form "HideCursor ..." (golint)
    • Line 243: warning: comment on exported function SetCell should be of the form "SetCell ..." (golint)
    • Line 256: warning: comment on exported function GetCell should be of the form "GetCell ..." (golint)
    • Line 261: warning: comment on exported function SetChar should be of the form "SetChar ..." (golint)
    • Line 274: warning: comment on exported function SetFg should be of the form "SetFg ..." (golint)
    • Line 287: warning: comment on exported function SetBg should be of the form "SetBg ..." (golint)
    • Line 300: warning: comment on exported function CellBuffer should be of the form "CellBuffer ..." (golint)
    • Line 307: warning: comment on exported function ParseEvent should be of the form "ParseEvent ..." (golint)
    • Line 327: warning: comment on exported function PollRawEvent should be of the form "PollRawEvent ..." (golint)
    • Line 368: warning: comment on exported function PollEvent should be of the form "PollEvent ..." (golint)
    • Line 373: warning: don't use underscores in Go names; const esc_wait_delay should be escWaitDelay (golint)
    • Line 376: warning: don't use underscores in Go names; var esc_wait_timer should be escWaitTimer (golint)
    • Line 377: warning: don't use underscores in Go names; var esc_timeout should be escTimeout (golint)
    • Line 443: warning: comment on exported function Size should be of the form "Size ..." (golint)
    • Line 451: warning: comment on exported function Clear should be of the form "Clear ..." (golint)
    • Line 459: warning: comment on exported function SetInputMode should be of the form "SetInputMode ..." (golint)
    • Line 492: warning: comment on exported function SetOutputMode should be of the form "SetOutputMode ..." (golint)
    • termbox-go/api_common.go
    • Line 1: warning: package comment should be of the form "Package termbox ..." (golint)
    • Line 7: warning: exported type InputMode should have comment or be unexported (golint)
    • Line 8: warning: exported type OutputMode should have comment or be unexported (golint)
    • Line 9: warning: exported type EventType should have comment or be unexported (golint)
    • Line 10: warning: exported type Modifier should have comment or be unexported (golint)
    • Line 11: warning: exported type Key should have comment or be unexported (golint)
    • Line 12: warning: exported type Attribute should have comment or be unexported (golint)
    • Line 15: warning: comment on exported type Event should be of the form "Event ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type Cell should be of the form "Cell ..." (with optional leading article) (golint)
    • Line 69: warning: don't use underscores in Go names; const key_min should be keyMin (golint)
    • Line 79: warning: exported const KeyCtrlTilde should have comment (or a comment on this block) or be unexported (golint)
    • Line 171: warning: don't use underscores in Go names; const max_attr should be maxAttr (golint)
    • termbox-go/escwait.go
    • Line 9: warning: don't use underscores in Go names; func enable_wait_for_escape_sequence should be enableWaitForEscapeSequence (golint)
    • termbox-go/syscalls_linux.go
    • Line 8: warning: don't use underscores in Go names; type syscall_Termios should be syscallTermios (golint)
    • Line 11: warning: don't use underscores in Go names; const syscall_IGNBRK should be syscallIGNBRK (golint)
    • Line 12: warning: don't use underscores in Go names; const syscall_BRKINT should be syscallBRKINT (golint)
    • Line 13: warning: don't use underscores in Go names; const syscall_PARMRK should be syscallPARMRK (golint)
    • Line 14: warning: don't use underscores in Go names; const syscall_ISTRIP should be syscallISTRIP (golint)
    • Line 15: warning: don't use underscores in Go names; const syscall_INLCR should be syscallINLCR (golint)
    • Line 16: warning: don't use underscores in Go names; const syscall_IGNCR should be syscallIGNCR (golint)
    • Line 17: warning: don't use underscores in Go names; const syscall_ICRNL should be syscallICRNL (golint)
    • Line 18: warning: don't use underscores in Go names; const syscall_IXON should be syscallIXON (golint)
    • Line 19: warning: don't use underscores in Go names; const syscall_OPOST should be syscallOPOST (golint)
    • Line 20: warning: don't use underscores in Go names; const syscall_ECHO should be syscallECHO (golint)
    • Line 21: warning: don't use underscores in Go names; const syscall_ECHONL should be syscallECHONL (golint)
    • Line 22: warning: don't use underscores in Go names; const syscall_ICANON should be syscallICANON (golint)
    • Line 23: warning: don't use underscores in Go names; const syscall_ISIG should be syscallISIG (golint)
    • Line 24: warning: don't use underscores in Go names; const syscall_IEXTEN should be syscallIEXTEN (golint)
    • Line 25: warning: don't use underscores in Go names; const syscall_CSIZE should be syscallCSIZE (golint)
    • Line 26: warning: don't use underscores in Go names; const syscall_PARENB should be syscallPARENB (golint)
    • Line 27: warning: don't use underscores in Go names; const syscall_CS8 should be syscallCS8 (golint)
    • Line 28: warning: don't use underscores in Go names; const syscall_VMIN should be syscallVMIN (golint)
    • Line 29: warning: don't use underscores in Go names; const syscall_VTIME should be syscallVTIME (golint)
    • Line 31: warning: don't use underscores in Go names; const syscall_TCGETS should be syscallTCGETS (golint)
    • Line 32: warning: don't use underscores in Go names; const syscall_TCSETS should be syscallTCSETS (golint)
    • termbox-go/termbox.go
    • Line 22: warning: don't use underscores in Go names; const t_enter_ca should be tEnterCa (golint)
    • Line 23: warning: don't use underscores in Go names; const t_exit_ca should be tExitCa (golint)
    • Line 24: warning: don't use underscores in Go names; const t_show_cursor should be tShowCursor (golint)
    • Line 25: warning: don't use underscores in Go names; const t_hide_cursor should be tHideCursor (golint)
    • Line 26: warning: don't use underscores in Go names; const t_clear_screen should be tClearScreen (golint)
    • Line 27: warning: don't use underscores in Go names; const t_sgr0 should be tSgr0 (golint)
    • Line 28: warning: don't use underscores in Go names; const t_underline should be tUnderline (golint)
    • Line 29: warning: don't use underscores in Go names; const t_bold should be tBold (golint)
    • Line 30: warning: don't use underscores in Go names; const t_hidden should be tHidden (golint)
    • Line 31: warning: don't use underscores in Go names; const t_blink should be tBlink (golint)
    • Line 32: warning: don't use underscores in Go names; const t_dim should be tDim (golint)
    • Line 33: warning: don't use underscores in Go names; const t_cursive should be tCursive (golint)
    • Line 34: warning: don't use underscores in Go names; const t_reverse should be tReverse (golint)
    • Line 35: warning: don't use underscores in Go names; const t_enter_keypad should be tEnterKeypad (golint)
    • Line 36: warning: don't use underscores in Go names; const t_exit_keypad should be tExitKeypad (golint)
    • Line 37: warning: don't use underscores in Go names; const t_enter_mouse should be tEnterMouse (golint)
    • Line 38: warning: don't use underscores in Go names; const t_exit_mouse should be tExitMouse (golint)
    • Line 39: warning: don't use underscores in Go names; const t_max_funcs should be tMaxFuncs (golint)
    • Line 43: warning: don't use underscores in Go names; const coord_invalid should be coordInvalid (golint)
    • Line 44: warning: don't use underscores in Go names; const attr_invalid should be attrInvalid (golint)
    • Line 47: warning: don't use underscores in Go names; type input_event should be inputEvent (golint)
    • Line 52: warning: don't use underscores in Go names; type extract_event_res should be extractEventRes (golint)
    • Line 55: warning: don't use underscores in Go names; const event_not_extracted should be eventNotExtracted (golint)
    • Line 56: warning: don't use underscores in Go names; const event_extracted should be eventExtracted (golint)
    • Line 57: warning: don't use underscores in Go names; const esc_wait should be escWait (golint)
    • Line 66: warning: don't use underscores in Go names; var orig_tios should be origTios (golint)
    • Line 67: warning: don't use underscores in Go names; var back_buffer should be backBuffer (golint)
    • Line 68: warning: don't use underscores in Go names; var front_buffer should be frontBuffer (golint)
    • Line 71: warning: don't use underscores in Go names; var input_mode should be inputMode (golint)
    • Line 72: warning: don't use underscores in Go names; var output_mode should be outputMode (golint)
    • Line 79: warning: don't use underscores in Go names; var cursor_x should be cursorX (golint)
    • Line 80: warning: don't use underscores in Go names; var cursor_y should be cursorY (golint)
    • Line 88: warning: don't use underscores in Go names; var input_comm should be inputComm (golint)
    • Line 89: warning: don't use underscores in Go names; var interrupt_comm should be interruptComm (golint)
    • Line 99: warning: don't use underscores in Go names; func write_cursor should be writeCursor (golint)
    • Line 107: warning: don't use underscores in Go names; func write_sgr_fg should be writeSgrFg (golint)
    • Line 129: warning: don't use underscores in Go names; func write_sgr_bg should be writeSgrBg (golint)
    • Line 151: warning: don't use underscores in Go names; func write_sgr should be writeSgr (golint)
    • Line 208: warning: don't use underscores in Go names; func get_term_size should be getTermSize (golint)
    • Line 215: warning: don't use underscores in Go names; func send_attr should be sendAttr (golint)
    • Line 304: warning: don't use underscores in Go names; func send_char should be sendChar (golint)
    • Line 320: warning: don't use underscores in Go names; func send_clear should be sendClear (golint)
    • Line 338: warning: don't use underscores in Go names; func update_size_maybe should be updateSizeMaybe (golint)
    • Line 368: warning: don't use underscores in Go names; func parse_mouse_event should be parseMouseEvent (golint)
    • Line 491: warning: don't use underscores in Go names; func parse_escape_sequence should be parseEscapeSequence (golint)
    • Line 505: warning: don't use underscores in Go names; func extract_raw_event should be extractRawEvent (golint)
    • Line 524: warning: don't use underscores in Go names; func extract_event should be extractEvent (golint)
    • Line 524: warning: don't use underscores in Go names; func parameter allow_esc_wait should be allowEscWait (golint)
    • Line 536: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • termbox-go/termbox_common.go
    • Line 11: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 17: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 46: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 55: warning: don't use underscores in Go names; const cursor_hidden should be cursorHidden (golint)
    • Line 57: warning: don't use underscores in Go names; func is_cursor_hidden should be isCursorHidden (golint)
    • termbox-go/terminfo.go
    • Line 24: warning: don't use underscores in Go names; const ti_magic should be tiMagic (golint)
    • Line 25: warning: don't use underscores in Go names; const ti_header_length should be tiHeaderLength (golint)
    • Line 26: warning: don't use underscores in Go names; const ti_mouse_enter should be tiMouseEnter (golint)
    • Line 27: warning: don't use underscores in Go names; const ti_mouse_leave should be tiMouseLeave (golint)
    • Line 30: warning: don't use underscores in Go names; func load_terminfo should be loadTerminfo (golint)
    • Line 82: warning: don't use underscores in Go names; func ti_try_path should be tiTryPath (golint)
    • Line 99: warning: don't use underscores in Go names; func setup_term_builtin should be setupTermBuiltin (golint)
    • Line 113: warning: don't use underscores in Go names; var compat_table should be compatTable (golint)
    • Line 140: warning: don't use underscores in Go names; func setup_term should be setupTerm (golint)
    • Line 143: warning: don't use underscores in Go names; var str_offset should be strOffset (golint)
    • Line 143: warning: don't use underscores in Go names; var table_offset should be tableOffset (golint)
    • Line 160: warning: don't use underscores in Go names; var number_sec_len should be numberSecLen (golint)
    • Line 173: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 182: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 193: warning: don't use underscores in Go names; func ti_read_string should be tiReadString (golint)
    • Line 193: warning: don't use underscores in Go names; func parameter str_off should be strOff (golint)
    • Line 224: warning: don't use underscores in Go names; var ti_funcs should be tiFuncs (golint)
    • Line 243: warning: don't use underscores in Go names; var ti_keys should be tiKeys (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!