Preparing report...

Report for github.com/felixangell/phi-editor

A    Great!    Found 30 issues across 27 files

Tweet

gofmt88%

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!


gocyclo96%

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.

    • phi-editor/internal/buff/buffer.go
    • Line 794: warning: cyclomatic complexity 62 of function (*Buffer).processActionKey() is high (> 15) (gocyclo)
    • Line 1324: warning: cyclomatic complexity 38 of function (*Buffer).renderAt() is high (> 15) (gocyclo)
    • Line 409: warning: cyclomatic complexity 24 of function (*Buffer).processTextInput() is high (> 15) (gocyclo)
    • Line 1146: warning: cyclomatic complexity 16 of function (*Buffer).processInput() is high (> 15) (gocyclo)

golint7%

Golint is a linter for Go source code.

    • phi-editor/internal/buff/palette.go
    • Line 17: warning: exported type CommandPalette should have comment or be unexported (golint)
    • Line 30: warning: exported method CommandPalette.SetFocus should have comment or be unexported (golint)
    • Line 81: warning: exported function NewCommandPalette should have comment or be unexported (golint)
    • Line 140: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 160: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 206: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 247: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 259: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 263: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 278: warning: exported method CommandPalette.OnUpdate should have comment or be unexported (golint)
    • Line 278: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • Line 321: warning: exported method CommandPalette.OnRender should have comment or be unexported (golint)
    • Line 321: warning: receiver name b should be consistent with previous receiver name p for CommandPalette (golint)
    • phi-editor/internal/buff/shortcuts.go
    • Line 16: warning: exported function ShowPalette should have comment or be unexported (golint)
    • Line 23: warning: exported function Paste should have comment or be unexported (golint)
    • Line 41: warning: exported function Undo should have comment or be unexported (golint)
    • Line 53: warning: exported function Redo should have comment or be unexported (golint)
    • Line 79: warning: exported function Save should have comment or be unexported (golint)
    • phi-editor/internal/cfg/config.go
    • Line 10: warning: exported type PhiEditorConfig should have comment or be unexported (golint)
    • Line 41: warning: exported type FileAssociations should have comment or be unexported (golint)
    • Line 45: warning: exported type SyntaxCriteria should have comment or be unexported (golint)
    • Line 52: warning: exported type Command should have comment or be unexported (golint)
    • Line 56: warning: exported type CursorConfig should have comment or be unexported (golint)
    • Line 64: warning: exported method CursorConfig.GetCaretWidth should have comment or be unexported (golint)
    • Line 79: warning: exported type RenderConfig should have comment or be unexported (golint)
    • Line 89: warning: comment on exported type ThemeConfig should be of the form "ThemeConfig ..." (with optional leading article) (golint)
    • Line 105: warning: exported type SuggestionConfig should have comment or be unexported (golint)
    • Line 112: warning: exported type PaletteConfig should have comment or be unexported (golint)
    • Line 122: warning: exported type EditorConfig should have comment or be unexported (golint)
    • Line 135: warning: exported function NewDefaultConfig should have comment or be unexported (golint)
    • phi-editor/internal/cfg/syntax.go
    • Line 3: warning: exported type LanguageSyntaxConfig should have comment or be unexported (golint)
    • Line 7: warning: exported function MarkdownConfig should have comment or be unexported (golint)
    • Line 16: warning: exported function TOMLConfig should have comment or be unexported (golint)
    • Line 33: warning: exported function CConfig should have comment or be unexported (golint)
    • Line 77: warning: exported function GoConfig should have comment or be unexported (golint)
    • phi-editor/internal/buff/cursor.go
    • Line 8: warning: exported type Cursor should have comment or be unexported (golint)
    • Line 38: warning: exported method Cursor.SetSize should have comment or be unexported (golint)
    • Line 77: warning: exported method Cursor.Render should have comment or be unexported (golint)
    • phi-editor/pkg/piecetable/table.go
    • Line 9: warning: exported type PieceTable should have comment or be unexported (golint)
    • Line 15: warning: exported function MakePieceTable should have comment or be unexported (golint)
    • Line 32: warning: exported method PieceTable.Redo should have comment or be unexported (golint)
    • Line 49: warning: exported method PieceTable.Undo should have comment or be unexported (golint)
    • Line 74: warning: exported method PieceTable.Delete should have comment or be unexported (golint)
    • Line 80: warning: comment on exported method PieceTable.Index should be of the form "Index ..." (golint)
    • Line 86: warning: exported method PieceTable.Insert should have comment or be unexported (golint)
    • Line 91: warning: exported method PieceTable.Line should have comment or be unexported (golint)
    • Line 106: warning: exported method PieceTable.Print should have comment or be unexported (golint)
    • phi-editor/internal/buff/buffer_pane.go
    • Line 12: warning: exported type BufferPane should have comment or be unexported (golint)
    • Line 18: warning: exported function NewBufferPane should have comment or be unexported (golint)
    • Line 28: warning: exported method BufferPane.SetFocus should have comment or be unexported (golint)
    • Line 94: warning: exported method BufferPane.Resize should have comment or be unexported (golint)
    • Line 99: warning: exported method BufferPane.SetPosition should have comment or be unexported (golint)
    • Line 104: warning: exported method BufferPane.OnUpdate should have comment or be unexported (golint)
    • Line 109: warning: exported method BufferPane.OnRender should have comment or be unexported (golint)
    • phi-editor/internal/gui/component.go
    • Line 11: warning: exported function LoadDefaultFont should have comment or be unexported (golint)
    • Line 20: warning: exported function GetDefaultFont should have comment or be unexported (golint)
    • Line 27: warning: exported type Component should have comment or be unexported (golint)
    • Line 50: warning: exported type BaseComponent should have comment or be unexported (golint)
    • Line 56: warning: exported method BaseComponent.GetPos should have comment or be unexported (golint)
    • Line 60: warning: exported method BaseComponent.GetSize should have comment or be unexported (golint)
    • Line 64: warning: exported method BaseComponent.SetFocus should have comment or be unexported (golint)
    • Line 68: warning: exported method BaseComponent.HasFocus should have comment or be unexported (golint)
    • Line 72: warning: exported method BaseComponent.HandleEvent should have comment or be unexported (golint)
    • Line 76: warning: exported method BaseComponent.SetPosition should have comment or be unexported (golint)
    • Line 81: warning: exported method BaseComponent.Translate should have comment or be unexported (golint)
    • Line 86: warning: exported method BaseComponent.Resize should have comment or be unexported (golint)
    • phi-editor/internal/lex/lex.go
    • Line 8: warning: exported type Lexer should have comment or be unexported (golint)
    • Line 14: warning: exported function New should have comment or be unexported (golint)
    • Line 109: warning: exported method Lexer.Tokenize should have comment or be unexported (golint)
    • phi-editor/internal/lex/token.go
    • Line 8: warning: exported type TokenType should have comment or be unexported (golint)
    • Line 11: warning: exported const Word should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type Token should have comment or be unexported (golint)
    • Line 24: warning: exported method Token.Equals should have comment or be unexported (golint)
    • Line 28: warning: exported method Token.IsType should have comment or be unexported (golint)
    • Line 32: warning: exported function NewToken should have comment or be unexported (golint)
    • phi-editor/internal/buff/action.go
    • Line 12: warning: exported type BufferActionFn should have comment or be unexported (golint)
    • Line 14: warning: exported type BufferAction should have comment or be unexported (golint)
    • Line 20: warning: exported function NewBufferAction should have comment or be unexported (golint)
    • Line 28: warning: exported function OpenFile should have comment or be unexported (golint)
    • Line 32: warning: exported function NewFile should have comment or be unexported (golint)
    • Line 53: warning: exported function GotoLine should have comment or be unexported (golint)
    • phi-editor/internal/buff/buffer.go
    • Line 26: warning: exported const DefaultScrollAmount should have comment (or a comment on this block) or be unexported (golint)
    • Line 111: warning: exported type BufferConfig should have comment or be unexported (golint)
    • Line 1079: warning: exported method Buffer.HandleEvent should have comment or be unexported (golint)
    • Line 1116: warning: exported method Buffer.OnUpdate should have comment or be unexported (golint)
    • Line 1519: warning: exported method Buffer.OnRender should have comment or be unexported (golint)
    • phi-editor/internal/command_handler/command_handler.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 12: warning: exported function DeduceCommand should have comment or be unexported (golint)
    • Line 19: warning: exported function SetupCommandHandler should have comment or be unexported (golint)
    • Line 23: warning: exported type CommandHandler should have comment or be unexported (golint)
    • Line 85: warning: exported method CommandHandler.DeduceCommandName should have comment or be unexported (golint)
    • phi-editor/pkg/piecetable/line.go
    • Line 3: warning: exported type Line should have comment or be unexported (golint)
    • Line 10: warning: exported function NewLine should have comment or be unexported (golint)
    • Line 16: warning: exported method Line.AppendNode should have comment or be unexported (golint)
    • Line 23: warning: exported method Line.Len should have comment or be unexported (golint)
    • phi-editor/internal/editor/editor.go
    • Line 14: warning: exported type PhiEditor should have comment or be unexported (golint)
    • Line 19: warning: exported function NewPhiEditor should have comment or be unexported (golint)
    • Line 23: warning: exported method PhiEditor.Resize should have comment or be unexported (golint)
    • Line 27: warning: exported method PhiEditor.HandleEvent should have comment or be unexported (golint)
    • Line 29: warning: exported method PhiEditor.ApplyConfig should have comment or be unexported (golint)
    • Line 56: warning: exported method PhiEditor.Update should have comment or be unexported (golint)
    • Line 60: warning: exported method PhiEditor.Render should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign74%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!