Preparing report...

Report for github.com/cjbassi/gotop

A    Great!    Found 31 issues across 37 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!


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.

    • gotop/main.go
    • Line 276: warning: cyclomatic complexity 37 of function eventLoop() is high (> 15) (gocyclo)

golint29%

Golint is a linter for Go source code.

    • gotop/src/utils/conversions.go
    • Line 7: warning: exported function ConvertLocalizedString should have comment or be unexported (golint)
    • Line 10: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gotop/src/utils/xdg.go
    • Line 8: warning: exported function GetConfigDir should have comment or be unexported (golint)
    • Line 18: warning: exported function GetLogDir should have comment or be unexported (golint)
    • gotop/src/widgets/help.go
    • Line 10: warning: exported const KEYBINDS should have comment or be unexported (golint)
    • Line 37: warning: exported type HelpMenu should have comment or be unexported (golint)
    • Line 41: warning: exported function NewHelpMenu should have comment or be unexported (golint)
    • Line 47: warning: exported method HelpMenu.Resize should have comment or be unexported (golint)
    • Line 47: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 60: warning: exported method HelpMenu.Draw should have comment or be unexported (golint)
    • Line 60: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/mem.go
    • Line 14: warning: exported type MemWidget should have comment or be unexported (golint)
    • Line 19: warning: exported type MemoryInfo should have comment or be unexported (golint)
    • Line 25: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 38: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 51: warning: exported function NewMemWidget should have comment or be unexported (golint)
    • gotop/src/widgets/net.go
    • Line 15: warning: exported const NET_INTERFACE_ALL should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type NetInterface should have comment or be unexported (golint)
    • Line 21: warning: exported type NetWidget should have comment or be unexported (golint)
    • Line 31: warning: exported function NewNetWidget should have comment or be unexported (golint)
    • Line 62: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/proc.go
    • Line 18: warning: exported const UP_ARROW should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported type ProcSortMethod should have comment or be unexported (golint)
    • Line 25: warning: exported const ProcSortCpu should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type Proc should have comment or be unexported (golint)
    • Line 38: warning: exported type ProcWidget should have comment or be unexported (golint)
    • Line 48: warning: exported function NewProcWidget should have comment or be unexported (golint)
    • Line 89: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 110: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 142: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 164: warning: exported method ProcWidget.ChangeProcSortMethod should have comment or be unexported (golint)
    • Line 164: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 173: warning: exported method ProcWidget.ToggleShowingGroupedProcs should have comment or be unexported (golint)
    • Line 173: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 186: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 235: warning: exported type SortProcsByCpu should have comment or be unexported (golint)
    • Line 238: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 243: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 248: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 252: warning: exported type SortProcsByPid should have comment or be unexported (golint)
    • Line 255: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 260: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 265: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 269: warning: exported type SortProcsByMem should have comment or be unexported (golint)
    • Line 272: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 277: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 282: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/statusbar.go
    • Line 12: warning: exported type StatusBar should have comment or be unexported (golint)
    • Line 16: warning: exported function NewStatusBar should have comment or be unexported (golint)
    • Line 22: warning: exported method StatusBar.Draw should have comment or be unexported (golint)
    • Line 22: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/temp.go
    • Line 14: warning: exported type TempScale should have comment or be unexported (golint)
    • Line 17: warning: exported const Celcius should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: exported type TempWidget should have comment or be unexported (golint)
    • Line 31: warning: exported function NewTempWidget should have comment or be unexported (golint)
    • Line 58: warning: comment on exported method TempWidget.Draw should be of the form "Draw ..." (golint)
    • Line 59: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/termui/drawille-go/drawille.go
    • Line 6: warning: don't use underscores in Go names; var pixel_map should be pixelMap (golint)
    • Line 13: warning: don't use underscores in Go names; var braille_char_offset should be brailleCharOffset (golint)
    • Line 30: warning: exported type Canvas should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function NewCanvas should be of the form "NewCanvas ..." (golint)
    • Line 42: warning: exported method Canvas.MaxY should have comment or be unexported (golint)
    • Line 44: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 52: warning: exported method Canvas.MinY should have comment or be unexported (golint)
    • Line 54: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 62: warning: exported method Canvas.MaxX should have comment or be unexported (golint)
    • Line 65: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 74: warning: exported method Canvas.MinX should have comment or be unexported (golint)
    • Line 77: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 92: warning: don't use underscores in Go names; method get_pos should be getPos (golint)
    • Line 107: warning: comment on exported method Canvas.UnSet should be of the form "UnSet ..." (golint)
    • Line 127: warning: comment on exported method Canvas.SetText should be of the form "SetText ..." (golint)
    • Line 140: warning: don't use underscores in Go names; var dot_index should be dotIndex (golint)
    • Line 187: warning: exported type Point should have comment or be unexported (golint)
    • Line 233: warning: exported method Canvas.DrawPolygon should have comment or be unexported (golint)
    • Line 233: warning: don't use underscores in Go names; method parameter center_x should be centerX (golint)
    • Line 233: warning: don't use underscores in Go names; method parameter center_y should be centerY (golint)
    • gotop/src/termui/sparkline.go
    • Line 7: warning: should not use dot imports (golint)
    • Line 26: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 43: warning: exported method SparklineGroup.Draw should have comment or be unexported (golint)
    • Line 43: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/battery.go
    • Line 15: warning: exported type BatteryWidget should have comment or be unexported (golint)
    • Line 20: warning: exported function NewBatteryWidget should have comment or be unexported (golint)
    • Line 48: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/termui/linegraph.go
    • Line 8: warning: should not use dot imports (golint)
    • Line 24: warning: exported function NewLineGraph should have comment or be unexported (golint)
    • Line 37: warning: exported method LineGraph.Draw should have comment or be unexported (golint)
    • Line 37: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/widgets/cpu.go
    • Line 14: warning: exported type CpuWidget should have comment or be unexported (golint)
    • Line 24: warning: exported function NewCpuWidget should have comment or be unexported (golint)
    • Line 74: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/colorschemes/template.go
    • Line 15: warning: exported const Bold should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type Colorscheme should have comment or be unexported (golint)
    • gotop/src/termui/table.go
    • Line 9: warning: should not use dot imports (golint)
    • Line 12: warning: exported type Table should have comment or be unexported (golint)
    • Line 46: warning: exported method Table.Draw should have comment or be unexported (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 131: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 148: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 166: warning: exported method Table.ScrollUp should have comment or be unexported (golint)
    • Line 166: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 171: warning: exported method Table.ScrollDown should have comment or be unexported (golint)
    • Line 171: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 176: warning: exported method Table.ScrollTop should have comment or be unexported (golint)
    • Line 176: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 181: warning: exported method Table.ScrollBottom should have comment or be unexported (golint)
    • Line 181: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 186: warning: exported method Table.ScrollHalfPageUp should have comment or be unexported (golint)
    • Line 186: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 191: warning: exported method Table.ScrollHalfPageDown should have comment or be unexported (golint)
    • Line 191: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 196: warning: exported method Table.ScrollPageUp should have comment or be unexported (golint)
    • Line 196: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 201: warning: exported method Table.ScrollPageDown should have comment or be unexported (golint)
    • Line 201: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 206: warning: exported method Table.HandleClick should have comment or be unexported (golint)
    • Line 206: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • gotop/src/utils/bytes.go
    • Line 8: warning: exported var KB should have comment or be unexported (golint)
    • Line 14: warning: exported function CelsiusToFahrenheit should have comment or be unexported (golint)
    • Line 18: warning: exported function BytesToKB should have comment or be unexported (golint)
    • Line 22: warning: exported function BytesToMB should have comment or be unexported (golint)
    • Line 26: warning: exported function BytesToGB should have comment or be unexported (golint)
    • Line 30: warning: exported function BytesToTB should have comment or be unexported (golint)
    • Line 34: warning: exported function ConvertBytes should have comment or be unexported (golint)
    • gotop/src/widgets/disk.go
    • Line 16: warning: exported type Partition should have comment or be unexported (golint)
    • Line 27: warning: exported type DiskWidget should have comment or be unexported (golint)
    • Line 33: warning: exported function NewDiskWidget should have comment or be unexported (golint)
    • Line 63: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (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!


misspell83%

Misspell Finds commonly misspelled English words