Preparing report...

Report for github.com/godoctor/godoctor

A+    Excellent!    Found 22 issues across 53 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!


golint62%

Golint is a linter for Go source code.

    • godoctor/refactoring/log.go
    • Line 36: warning: exported const Info should have comment (or a comment on this block) or be unexported (golint)
    • Line 139: warning: comment on exported method Log.AssociatePos should be of the form "AssociatePos ..." (golint)
    • godoctor/refactoring/refactoring.go
    • Line 38: warning: comment on exported type Parameter should be of the form "Parameter ..." (with optional leading article) (golint)
    • Line 163: warning: exported type Result should have comment or be unexported (golint)
    • Line 181: warning: exported type RefactoringBase should have comment or be unexported (golint)
    • Line 207: warning: comment on exported method RefactoringBase.Init should be of the form "Init ..." (golint)
    • Line 512: warning: exported method RefactoringBase.FormatFileInEditor should have comment or be unexported (golint)
    • Line 714: warning: exported function InterpretArgs should have comment or be unexported (golint)
    • Line 734: warning: exported method RefactoringBase.OffsetOfPos should have comment or be unexported (golint)
    • Line 738: warning: exported method RefactoringBase.OffsetLength should have comment or be unexported (golint)
    • Line 744: warning: exported method RefactoringBase.Extent should have comment or be unexported (golint)
    • Line 749: warning: exported method RefactoringBase.TextFromPosRange should have comment or be unexported (golint)
    • Line 758: warning: exported method RefactoringBase.Text should have comment or be unexported (golint)
    • godoctor/engine/protocol/protocol.go
    • Line 21: warning: exported type Reply should have comment or be unexported (golint)
    • Line 30: warning: exported type State should have comment or be unexported (golint)
    • Line 38: warning: exported function Run should have comment or be unexported (golint)
    • godoctor/refactoring/testutil/testutil.go
    • Line 78: warning: exported const MARKER should have comment or be unexported (golint)
    • Line 79: warning: exported const PASS should have comment or be unexported (golint)
    • Line 80: warning: exported const FAIL should have comment or be unexported (golint)
    • Line 82: warning: exported const MAIN_DOT_GO should have comment or be unexported (golint)
    • Line 87: warning: exported function TestRefactorings should have comment or be unexported (golint)
    • Line 273: 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)
    • Line 276: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • godoctor/refactoring/extractfunc.go
    • Line 32: warning: exported function SortVars should have comment or be unexported (golint)
    • Line 594: warning: exported method ExtractFunc.Description should have comment or be unexported (golint)
    • Line 611: warning: exported method ExtractFunc.Run should have comment or be unexported (golint)
    • godoctor/refactoring/extractlocal.go
    • Line 19: warning: exported type ExtractLocal should have comment or be unexported (golint)
    • Line 24: warning: exported method ExtractLocal.Description should have comment or be unexported (golint)
    • Line 41: warning: exported method ExtractLocal.Run should have comment or be unexported (golint)
    • godoctor/refactoring/rename.go
    • Line 36: warning: exported method Rename.Description should have comment or be unexported (golint)
    • Line 53: warning: exported method Rename.Run should have comment or be unexported (golint)
    • godoctor/engine/cli/cli.go
    • Line 5: warning: package comment should be of the form "Package cli ..." (golint)
    • Line 122: warning: exported type CLIFlags should have comment or be unexported (golint)
    • Line 395: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • godoctor/analysis/cfg/cfg.go
    • Line 92: warning: exported method CFG.Sort should have comment or be unexported (golint)
    • Line 96: warning: exported method CFG.PrintDot should have comment or be unexported (golint)
    • godoctor/refactoring/debug.go
    • Line 61: warning: exported type Debug should have comment or be unexported (golint)
    • Line 65: warning: exported method Debug.Description should have comment or be unexported (golint)
    • Line 82: warning: exported method Debug.Run should have comment or be unexported (golint)
    • godoctor/refactoring/godoc.go
    • Line 23: warning: exported method AddGoDoc.Description should have comment or be unexported (golint)
    • Line 36: warning: exported method AddGoDoc.Run should have comment or be unexported (golint)
    • godoctor/filesystem/filesystem.go
    • Line 26: warning: comment on exported const FakeStdinFilename should be of the form "FakeStdinFilename ..." (golint)
    • Line 83: warning: exported function NewLocalFileSystem should have comment or be unexported (golint)
    • Line 87: warning: exported method LocalFileSystem.ReadDir should have comment or be unexported (golint)
    • Line 91: warning: exported method LocalFileSystem.OpenFile should have comment or be unexported (golint)
    • Line 99: warning: exported method LocalFileSystem.OverwriteFile should have comment or be unexported (golint)
    • Line 103: warning: exported method LocalFileSystem.CreateFile should have comment or be unexported (golint)
    • Line 121: warning: exported method LocalFileSystem.Rename should have comment or be unexported (golint)
    • Line 135: warning: exported method LocalFileSystem.Remove should have comment or be unexported (golint)
    • Line 166: warning: exported function NewEditedFileSystem should have comment or be unexported (golint)
    • Line 170: warning: exported function NewSingleEditedFileSystem should have comment or be unexported (golint)
    • Line 210: warning: exported method EditedFileSystem.OpenFile should have comment or be unexported (golint)
    • Line 215: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 238: warning: exported method EditedFileSystem.OverwriteFile should have comment or be unexported (golint)
    • Line 250: warning: exported method EditedFileSystem.ReadDir should have comment or be unexported (golint)
    • Line 304: warning: exported method EditedFileSystem.CreateFile should have comment or be unexported (golint)
    • Line 308: warning: exported method EditedFileSystem.CreateDirectory should have comment or be unexported (golint)
    • Line 312: warning: exported method EditedFileSystem.Rename should have comment or be unexported (golint)
    • Line 316: warning: exported method EditedFileSystem.Remove should have comment or be unexported (golint)
    • godoctor/analysis/cfg/cfg_test.go
    • Line 649: 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)
    • godoctor/refactoring/errors.go
    • Line 6: warning: exported type ErrInvalidArgs should have comment or be unexported (golint)
    • Line 7: warning: exported type ErrInvalidSelection should have comment or be unexported (golint)
    • godoctor/refactoring/null.go
    • Line 16: warning: exported method Null.Description should have comment or be unexported (golint)
    • Line 33: warning: exported method Null.Run should have comment or be unexported (golint)

gocyclo83%

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.

    • godoctor/text/diff.go
    • Line 211: warning: cyclomatic complexity 19 of function writeDiffHunk() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 17 of function Diff() is high (> 15) (gocyclo)

ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell98%

Misspell Finds commonly misspelled English words