Preparing report...

Report for github.com/sqshq/sampler

A+    Excellent!    Found 33 issues across 48 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!


gocyclo91%

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.

    • sampler/component/layout/layout.go
    • Line 97: warning: cyclomatic complexity 43 of function (*Layout).HandleKeyboardEvent() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 17 of function (*Layout).moveSelection() is high (> 15) (gocyclo)
    • sampler/config/default.go
    • Line 19: warning: cyclomatic complexity 24 of function (*Config).setDefaultValues() is high (> 15) (gocyclo)
    • Line 176: warning: cyclomatic complexity 21 of function (*Config).setDefaultItemSettings() is high (> 15) (gocyclo)

golint35%

Golint is a linter for Go source code.

    • sampler/config/config.go
    • Line 13: warning: exported type Config should have comment or be unexported (golint)
    • Line 24: warning: exported function LoadConfig should have comment or be unexported (golint)
    • Line 48: warning: exported function Update should have comment or be unexported (golint)
    • sampler/component/util/geometry.go
    • Line 7: warning: exported function GetRectLeftSideCenter should have comment or be unexported (golint)
    • Line 14: warning: exported function GetRectRightSideCenter should have comment or be unexported (golint)
    • Line 21: warning: exported function GetRectTopSideCenter should have comment or be unexported (golint)
    • Line 28: warning: exported function GetRectBottomSideCenter should have comment or be unexported (golint)
    • Line 35: warning: exported function GetRectCoordinates should have comment or be unexported (golint)
    • sampler/component/util/format.go
    • Line 13: warning: exported var AsciiLogo should have comment or be unexported (golint)
    • Line 22: warning: exported function FormatValue should have comment or be unexported (golint)
    • Line 29: warning: exported function FormatDelta should have comment or be unexported (golint)
    • Line 113: warning: exported function GetMiddlePoint should have comment or be unexported (golint)
    • Line 117: warning: exported function PrintString should have comment or be unexported (golint)
    • sampler/data/trigger.go
    • Line 14: warning: exported const TrueIndicator should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type Trigger should have comment or be unexported (golint)
    • Line 29: warning: exported type Actions should have comment or be unexported (golint)
    • Line 36: warning: exported type Values should have comment or be unexported (golint)
    • Line 41: warning: exported function NewTriggers should have comment or be unexported (golint)
    • Line 52: warning: exported function NewTrigger should have comment or be unexported (golint)
    • Line 70: warning: exported method Trigger.Execute should have comment or be unexported (golint)
    • sampler/component/layout/layout.go
    • Line 29: warning: exported type Mode should have comment or be unexported (golint)
    • Line 32: warning: exported const ModeDefault should have comment (or a comment on this block) or be unexported (golint)
    • Line 47: warning: exported function NewLayout should have comment or be unexported (golint)
    • Line 66: warning: exported method Layout.AddComponent should have comment or be unexported (golint)
    • Line 70: warning: exported method Layout.StartWithIntro should have comment or be unexported (golint)
    • Line 82: warning: exported method Layout.HandleMouseClick should have comment or be unexported (golint)
    • Line 97: warning: exported method Layout.HandleKeyboardEvent should have comment or be unexported (golint)
    • Line 223: warning: exported method Layout.ChangeDimensions should have comment or be unexported (golint)
    • Line 298: warning: exported method Layout.Draw should have comment or be unexported (golint)
    • Line 364: warning: exported method Layout.WerePositionsChanged should have comment or be unexported (golint)
    • sampler/console/signal.go
    • Line 4: warning: exported const SignalResize should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: exported const KeyPause1 should have comment (or a comment on this block) or be unexported (golint)
    • sampler/asset/file.go
    • Line 8: warning: exported type AssetFile should have comment or be unexported (golint)
    • Line 12: warning: exported function NewAssetFile should have comment or be unexported (golint)
    • Line 20: warning: exported method AssetFile.Close should have comment or be unexported (golint)
    • sampler/component/runchart/runchart.go
    • Line 29: warning: exported type Mode should have comment or be unexported (golint)
    • Line 32: warning: exported const ModeDefault should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported const CommandDisableSelection should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported type TimePoint should have comment or be unexported (golint)
    • Line 62: warning: exported type TimeLine should have comment or be unexported (golint)
    • Line 71: warning: exported type TimeRange should have comment or be unexported (golint)
    • Line 76: warning: exported type ValueExtrema should have comment or be unexported (golint)
    • Line 81: warning: exported function NewRunChart should have comment or be unexported (golint)
    • Line 129: warning: exported method RunChart.Draw should have comment or be unexported (golint)
    • Line 147: warning: exported method RunChart.AddLine should have comment or be unexported (golint)
    • sampler/asset/player.go
    • Line 10: warning: exported type AudioPlayer should have comment or be unexported (golint)
    • Line 15: warning: exported function NewAudioPlayer should have comment or be unexported (golint)
    • Line 37: warning: exported method AudioPlayer.Beep should have comment or be unexported (golint)
    • Line 49: warning: exported method AudioPlayer.Close should have comment or be unexported (golint)
    • sampler/data/consumer.go
    • Line 8: warning: exported type Consumer should have comment or be unexported (golint)
    • Line 15: warning: exported method Consumer.HandleConsumeSuccess should have comment or be unexported (golint)
    • Line 21: warning: exported method Consumer.HandleConsumeFailure should have comment or be unexported (golint)
    • Line 30: warning: exported type Sample should have comment or be unexported (golint)
    • Line 36: warning: exported type Alert should have comment or be unexported (golint)
    • Line 43: warning: exported type Command should have comment or be unexported (golint)
    • Line 48: warning: exported function NewConsumer should have comment or be unexported (golint)
    • sampler/config/component.go
    • Line 9: warning: exported type ComponentType should have comment or be unexported (golint)
    • Line 12: warning: exported const TypeRunChart should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type ComponentConfig should have comment or be unexported (golint)
    • Line 28: warning: exported method ComponentConfig.GetLocation should have comment or be unexported (golint)
    • Line 32: warning: exported method ComponentConfig.GetSize should have comment or be unexported (golint)
    • Line 36: warning: exported method ComponentConfig.GetRectangle should have comment or be unexported (golint)
    • Line 47: warning: exported type TriggerConfig should have comment or be unexported (golint)
    • Line 53: warning: exported type ActionsConfig should have comment or be unexported (golint)
    • Line 60: warning: exported type GaugeConfig should have comment or be unexported (golint)
    • Line 70: warning: exported type SparkLineConfig should have comment or be unexported (golint)
    • Line 77: warning: exported type BarChartConfig should have comment or be unexported (golint)
    • Line 83: warning: exported type AsciiBoxConfig should have comment or be unexported (golint)
    • Line 90: warning: exported type TextBoxConfig should have comment or be unexported (golint)
    • Line 96: warning: exported type RunChartConfig should have comment or be unexported (golint)
    • Line 103: warning: exported type LegendConfig should have comment or be unexported (golint)
    • Line 108: warning: exported type Item should have comment or be unexported (golint)
    • Line 118: warning: exported type Location should have comment or be unexported (golint)
    • Line 123: warning: exported type Size should have comment or be unexported (golint)
    • Line 128: warning: exported type ComponentSettings should have comment or be unexported (golint)
    • sampler/console/console.go
    • Line 13: warning: exported const MaxRenderInterval should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: exported const BellCharacter should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type AsciiFont should have comment or be unexported (golint)
    • Line 28: warning: exported const AsciiFont2D should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported function Init should have comment or be unexported (golint)
    • sampler/event/handler.go
    • Line 16: warning: exported type Handler should have comment or be unexported (golint)
    • Line 25: warning: exported function NewHandler should have comment or be unexported (golint)
    • Line 37: warning: exported method Handler.HandleEvents should have comment or be unexported (golint)
    • sampler/component/menu.go
    • Line 11: warning: exported type Menu should have comment or be unexported (golint)
    • Line 32: warning: exported const MenuOptionMove should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported function NewMenu should have comment or be unexported (golint)
    • Line 52: warning: exported method Menu.GetSelectedOption should have comment or be unexported (golint)
    • Line 56: warning: exported method Menu.Highlight should have comment or be unexported (golint)
    • Line 63: warning: exported method Menu.Choose should have comment or be unexported (golint)
    • Line 67: warning: exported method Menu.Idle should have comment or be unexported (golint)
    • Line 71: warning: exported method Menu.Up should have comment or be unexported (golint)
    • Line 83: warning: exported method Menu.Down should have comment or be unexported (golint)
    • Line 95: warning: exported method Menu.MoveOrResize should have comment or be unexported (golint)
    • Line 99: warning: exported method Menu.Draw should have comment or be unexported (golint)
    • sampler/component/component.go
    • Line 9: warning: exported type Component should have comment or be unexported (golint)
    • Line 19: warning: exported function NewComponent should have comment or be unexported (golint)
    • Line 31: warning: exported method Component.Move should have comment or be unexported (golint)
    • Line 37: warning: exported method Component.Resize should have comment or be unexported (golint)
    • sampler/console/palette.go
    • Line 10: warning: exported type Theme should have comment or be unexported (golint)
    • Line 13: warning: exported const ThemeDark should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported const ColorOlive should have comment (or a comment on this block) or be unexported (golint)
    • Line 42: warning: exported type Palette should have comment or be unexported (golint)
    • Line 96: warning: exported function GetGradientColor should have comment or be unexported (golint)
    • sampler/component/statusbar.go
    • Line 15: warning: exported type StatusBar should have comment or be unexported (golint)
    • Line 22: warning: exported function NewStatusBar should have comment or be unexported (golint)
    • Line 40: warning: exported method StatusBar.Draw should have comment or be unexported (golint)
    • Line 59: warning: exported method StatusBar.TogglePause should have comment or be unexported (golint)
    • sampler/data/item.go
    • Line 14: warning: exported type Item should have comment or be unexported (golint)
    • Line 26: warning: exported function NewItems should have comment or be unexported (golint)
    • sampler/data/sampler.go
    • Line 9: warning: exported type Sampler should have comment or be unexported (golint)
    • Line 18: warning: exported function NewSampler should have comment or be unexported (golint)
    • Line 87: warning: exported method Sampler.Pause should have comment or be unexported (golint)
    • sampler/component/gauge/gauge.go
    • Line 15: warning: exported const MinValueLabel should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported function NewGauge should have comment or be unexported (golint)
    • Line 58: warning: exported method Gauge.ConsumeSample should have comment or be unexported (golint)
    • Line 81: warning: exported method Gauge.Draw should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.

    • /home/shawn/go/pkg/mod/github.com/hajimehoshi/oto@v0.1.1/player_linux.go
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)
    • Line 57: warning: could not import C (no metadata for C) (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!