Preparing report...

Report for github.com/dyweb/gommon

A+    Excellent!    Found 62 issues across 157 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!


gocyclo99%

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.


golint66%

Golint is a linter for Go source code.

    • gommon/errors/stack.go
    • Line 12: warning: exported type Stack should have comment or be unexported (golint)
    • Line 65: warning: exported function PrintFrames should have comment or be unexported (golint)
    • gommon/util/testutil/env.go
    • Line 20: warning: exported function LoadDotEnvFromFile should have comment or be unexported (golint)
    • Line 28: warning: exported function LoadDotEnvFrom should have comment or be unexported (golint)
    • gommon/generator/pkg.go
    • Line 10: warning: exported const GommonIgnoreFile should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type ConfigFile should have comment or be unexported (golint)
    • Line 35: warning: exported function NewConfigFile should have comment or be unexported (golint)
    • gommon/util/fsutil/ignore.go
    • Line 66: warning: exported function LineToPattern should have comment or be unexported (golint)
    • Line 76: warning: exported type Ignores should have comment or be unexported (golint)
    • Line 82: warning: exported function NewIgnores should have comment or be unexported (golint)
    • Line 89: warning: exported method Ignores.IgnoreName should have comment or be unexported (golint)
    • Line 101: warning: exported method Ignores.IgnorePath should have comment or be unexported (golint)
    • Line 116: warning: exported method Ignores.AddName should have comment or be unexported (golint)
    • Line 120: warning: exported method Ignores.AddPath should have comment or be unexported (golint)
    • Line 124: warning: exported method Ignores.SetPathPrefix should have comment or be unexported (golint)
    • Line 128: warning: exported method Ignores.Len should have comment or be unexported (golint)
    • Line 135: warning: exported method Ignores.Patterns should have comment or be unexported (golint)
    • Line 145: warning: exported type IgnorePattern should have comment or be unexported (golint)
    • Line 149: warning: exported type ExactPattern should have comment or be unexported (golint)
    • Line 151: warning: exported method ExactPattern.ShouldIgnore should have comment or be unexported (golint)
    • Line 155: warning: comment on exported type WildcardPattern should be of the form "WildcardPattern ..." (with optional leading article) (golint)
    • Line 162: warning: exported method WildcardPattern.ShouldIgnore should have comment or be unexported (golint)
    • gommon/log/pkg.go
    • Line 13: warning: exported function SetLevel should have comment or be unexported (golint)
    • Line 19: warning: exported function SetHandler should have comment or be unexported (golint)
    • Line 25: warning: exported function EnableSource should have comment or be unexported (golint)
    • Line 31: warning: exported function DisableSource should have comment or be unexported (golint)
    • gommon/noodle/pkg.go
    • Line 11: warning: exported const DefaultIgnoreFileName should have comment (or a comment on this block) or be unexported (golint)
    • gommon/httpclient/context.go
    • Line 10: warning: comment on exported type Context should be of the form "Context ..." (with optional leading article) (golint)
    • Line 60: warning: exported method Context.SetBase should have comment or be unexported (golint)
    • Line 65: warning: exported method Context.SetHeader should have comment or be unexported (golint)
    • Line 73: warning: exported method Context.SetParam should have comment or be unexported (golint)
    • Line 81: warning: exported method Context.SetErrorHandler should have comment or be unexported (golint)
    • gommon/util/runtimeutil/caller.go
    • Line 9: warning: comment on exported function GetCallerFrame should be of the form "GetCallerFrame ..." (golint)
    • Line 44: warning: exported function IsMethod should have comment or be unexported (golint)
    • Line 48: warning: exported function SplitStructMethod should have comment or be unexported (golint)
    • gommon/log/field.go
    • Line 12: warning: exported const UnknownType should have comment (or a comment on this block) or be unexported (golint)
    • gommon/log/level.go
    • Line 130: warning: comment on exported method Level.ColoredString should be of the form "ColoredString ..." (golint)
    • gommon/log/logger_identity.go
    • Line 14: warning: exported const UnknownLogger should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: exported var UnknownIdentity should have comment or be unexported (golint)
    • Line 51: warning: exported const MagicStructLoggerFunctionName should have comment (or a comment on this block) or be unexported (golint)
    • Line 97: warning: exported method Identity.Hash should have comment or be unexported (golint)
    • Line 102: warning: exported method Identity.SourceLocation should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method Identity.Diff should be of the form "Diff ..." (golint)
    • gommon/util/hashutil/pkg.go
    • Line 4: warning: exported function HashStringFnv64a should have comment or be unexported (golint)
    • Line 12: warning: exported function HashFnv64a should have comment or be unexported (golint)
    • gommon/errors/inspect.go
    • Line 73: warning: error should be the last type when returning multiple items (golint)
    • Line 89: warning: error should be the last type when returning multiple items (golint)
    • gommon/playground/issue_noodle_50/main.go
    • Line 8: warning: exported type I should have comment or be unexported (golint)
    • Line 14: warning: exported type Info should have comment or be unexported (golint)
    • Line 18: warning: exported method Info.GetName should have comment or be unexported (golint)
    • Line 22: warning: exported type Dir should have comment or be unexported (golint)
    • gommon/generator/shell.go
    • Line 40: 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)
    • gommon/httpclient/client.go
    • Line 32: warning: comment on exported function New should be of the form "New ..." (golint)
    • Line 63: warning: exported method Client.SetHeader should have comment or be unexported (golint)
    • Line 84: warning: exported method Client.FetchTo should have comment or be unexported (golint)
    • Line 114: warning: exported method Client.FetchToNull should have comment or be unexported (golint)
    • gommon/httpclient/method.go
    • Line 13: warning: exported method Client.Get should have comment or be unexported (golint)
    • Line 17: warning: exported method Client.GetRaw should have comment or be unexported (golint)
    • Line 21: warning: exported method Client.GetIgnoreRes should have comment or be unexported (golint)
    • Line 27: warning: exported method Client.Post should have comment or be unexported (golint)
    • Line 31: warning: exported method Client.PostRaw should have comment or be unexported (golint)
    • Line 35: warning: exported method Client.PostIgnoreRes should have comment or be unexported (golint)
    • Line 41: warning: exported method Client.Patch should have comment or be unexported (golint)
    • Line 45: warning: exported method Client.PatchRaw should have comment or be unexported (golint)
    • Line 49: warning: exported method Client.PatchIgnoreRes should have comment or be unexported (golint)
    • Line 55: warning: exported method Client.Delete should have comment or be unexported (golint)
    • Line 59: warning: exported method Client.DeleteRaw should have comment or be unexported (golint)
    • Line 63: warning: exported method Client.DeleteIgnoreRes should have comment or be unexported (golint)
    • gommon/util/httputil/pkg.go
    • Line 13: warning: exported const Get should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: exported const DefaultUA should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: comment on exported const UACurl should be of the form "UACurl ..." (golint)
    • gommon/errors/errortype/std.go
    • Line 14: warning: exported function IsRuntimeError should have comment or be unexported (golint)
    • Line 19: warning: comment on exported function GetRuntimeError should be of the form "GetRuntimeError ..." (golint)
    • Line 33: warning: exported function IsNetError should have comment or be unexported (golint)
    • Line 38: warning: exported function GetNetError should have comment or be unexported (golint)
    • Line 49: warning: exported function IsFsError should have comment or be unexported (golint)
    • Line 54: warning: error should be the last type when returning multiple items (golint)
    • Line 54: warning: exported function GetFsError should have comment or be unexported (golint)
    • gommon/noodle/fs_embed.go
    • Line 17: warning: exported type EmbedBowel should have comment or be unexported (golint)
    • Line 23: warning: exported type EmbedFile should have comment or be unexported (golint)
    • Line 31: warning: exported type EmbedDir should have comment or be unexported (golint)
    • Line 40: warning: exported method EmbedDir.Seek should have comment or be unexported (golint)
    • Line 44: warning: exported method EmbedDir.Stat should have comment or be unexported (golint)
    • Line 48: warning: exported method EmbedDir.Close should have comment or be unexported (golint)
    • Line 52: warning: exported method EmbedDir.Readdir should have comment or be unexported (golint)
    • Line 68: warning: exported method EmbedBowel.Open should have comment or be unexported (golint)
    • Line 85: warning: exported method EmbedBowel.ExtractFiles should have comment or be unexported (golint)
    • Line 94: 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 111: warning: exported method EmbedFile.Seek should have comment or be unexported (golint)
    • Line 118: warning: exported method EmbedFile.Stat should have comment or be unexported (golint)
    • Line 122: warning: exported method EmbedFile.Readdir should have comment or be unexported (golint)
    • Line 127: warning: exported method EmbedFile.Close should have comment or be unexported (golint)
    • gommon/util/testutil/condition.go
    • Line 17: warning: exported type Condition should have comment or be unexported (golint)
    • Line 39: warning: exported function SkipIf should have comment or be unexported (golint)
    • Line 52: warning: exported function RunIf should have comment or be unexported (golint)
    • Line 68: warning: exported function And should have comment or be unexported (golint)
    • Line 91: warning: exported function Or should have comment or be unexported (golint)
    • Line 113: warning: exported function Not should have comment or be unexported (golint)
    • Line 133: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 146: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 153: warning: exported function EnvTrue should have comment or be unexported (golint)
    • Line 169: warning: exported function EnvHas should have comment or be unexported (golint)
    • Line 175: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gommon/util/testutil/data.go
    • Line 15: warning: exported function ReadFixture should have comment or be unexported (golint)
    • Line 23: warning: exported function WriteFixture should have comment or be unexported (golint)
    • Line 32: warning: exported function ReadJsonTo should have comment or be unexported (golint)
    • Line 39: warning: exported function FormatJson should have comment or be unexported (golint)
    • Line 48: warning: comment on exported function DumpAsJson should be of the form "DumpAsJson ..." (golint)
    • Line 53: warning: exported function DumpAsJsonTo should have comment or be unexported (golint)
    • Line 65: warning: exported function SaveAsJson should have comment or be unexported (golint)
    • Line 77: warning: exported function SaveAsJsonf should have comment or be unexported (golint)
    • Line 82: warning: exported function SaveAsPrettyJson should have comment or be unexported (golint)
    • Line 95: warning: exported function SaveAsPrettyJsonf should have comment or be unexported (golint)
    • Line 104: warning: exported function ReadYAMLTo should have comment or be unexported (golint)
    • Line 119: warning: exported function SaveAsYAML should have comment or be unexported (golint)
    • Line 132: warning: exported function SaveAsYAMLf should have comment or be unexported (golint)
    • gommon/httpclient/error.go
    • Line 10: warning: exported type ErrorHandler should have comment or be unexported (golint)
    • Line 18: warning: exported function IsSuccess should have comment or be unexported (golint)
    • Line 22: warning: exported method ErrorHandlerFunc.IsError should have comment or be unexported (golint)
    • Line 26: warning: exported method ErrorHandlerFunc.DecodeError should have comment or be unexported (golint)
    • Line 35: warning: exported function DefaultHandler should have comment or be unexported (golint)
    • Line 39: warning: exported type ErrApplication should have comment or be unexported (golint)
    • Line 54: warning: exported type ErrDecoding should have comment or be unexported (golint)
    • Line 68: warning: exported method BasicErrorHandler.IsError should have comment or be unexported (golint)
    • Line 72: warning: exported method BasicErrorHandler.DecodeError should have comment or be unexported (golint)
    • gommon/util/cast/cast.go
    • Line 22: warning: exported function StringMapToStructViaYAML should have comment or be unexported (golint)
    • Line 33: warning: exported function StringMapToStructViaJSON should have comment or be unexported (golint)
    • gommon/log/logger_factory.go
    • Line 5: warning: exported function NewPackageLogger should have comment or be unexported (golint)
    • Line 9: warning: exported function NewStructLogger should have comment or be unexported (golint)
    • gommon/generator/gotmpl.go
    • Line 15: warning: exported type GoTemplateConfig should have comment or be unexported (golint)
    • Line 22: warning: exported method GoTemplateConfig.Render should have comment or be unexported (golint)
    • gommon/noodle/util.go
    • Line 22: 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)
    • gommon/errors/multi.go
    • Line 154: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 165: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gommon/util/testutil/golden.go
    • Line 35: warning: exported function EnableGenGolden should have comment or be unexported (golint)
    • Line 41: warning: exported function DisableGenGolden should have comment or be unexported (golint)
    • Line 47: warning: exported function WriteOrCompare should have comment or be unexported (golint)
    • Line 56: warning: exported function WriteOrCompareAsString should have comment or be unexported (golint)
    • gommon/noodle/fs_embed_generate.go
    • Line 20: warning: exported type EmbedConfig should have comment or be unexported (golint)
    • Line 71: 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 95: 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 164: 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)
    • gommon/log/registry.go
    • Line 40: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 69: warning: exported method Registry.Identity should have comment or be unexported (golint)
    • gommon/httpclient/option.go
    • Line 9: warning: exported type Option should have comment or be unexported (golint)
    • Line 11: warning: exported function UseJSON should have comment or be unexported (golint)
    • Line 19: warning: exported function WithErrorHandler should have comment or be unexported (golint)
    • Line 26: warning: exported function WithErrorHandlerFunc should have comment or be unexported (golint)
    • Line 33: warning: exported function WithTransport should have comment or be unexported (golint)
    • gommon/util/testutil/pretty.go
    • Line 10: warning: exported function PrintTidyJson should have comment or be unexported (golint)
    • Line 14: warning: exported function PrintTidyJsonTo should have comment or be unexported (golint)
    • gommon/noodle/file.go
    • Line 20: warning: exported function NewFileInfo should have comment or be unexported (golint)
    • Line 30: warning: exported method FileInfo.Name should have comment or be unexported (golint)
    • Line 34: warning: exported method FileInfo.Size should have comment or be unexported (golint)
    • Line 38: warning: exported method FileInfo.Mode should have comment or be unexported (golint)
    • Line 42: warning: exported method FileInfo.ModTime should have comment or be unexported (golint)
    • Line 46: warning: exported method FileInfo.IsDir should have comment or be unexported (golint)
    • Line 50: warning: exported method FileInfo.Sys should have comment or be unexported (golint)
    • gommon/errors/wrapper.go
    • Line 15: warning: comment on exported type Messenger should be of the form "Messenger ..." (with optional leading article) (golint)
    • gommon/util/fsutil/path.go
    • Line 8: warning: exported function Cwd should have comment or be unexported (golint)
    • Line 12: 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 30: 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 39: 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)
    • gommon/errors/errortype/common.go
    • Line 7: warning: exported type ErrNotFound should have comment or be unexported (golint)
    • Line 11: warning: exported function IsNotFound should have comment or be unexported (golint)
    • Line 35: warning: exported function NewNotFound should have comment or be unexported (golint)
    • Line 39: warning: exported type ErrAlreadyExists should have comment or be unexported (golint)
    • Line 43: warning: comment on exported function IsAlreadyExists should be of the form "IsAlreadyExists ..." (golint)
    • Line 68: warning: exported function NewAlreadyExists should have comment or be unexported (golint)
    • Line 72: warning: exported type ErrNotImplemented should have comment or be unexported (golint)
    • Line 76: warning: comment on exported function IsNotImplemented should be of the form "IsNotImplemented ..." (golint)
    • Line 101: warning: exported function NewNotImplemented should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell99%

Misspell Finds commonly misspelled English words