Preparing report...

Report for github.com/wgliang/logcool

A+    Excellent!    Found 31 issues across 39 files

Tweet

gofmt94%

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!


gocyclo97%

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.


golint51%

Golint is a linter for Go source code.

    • logcool/utils/output.go
    • Line 10: warning: comment on exported type TypeOutputConfig should be of the form "TypeOutputConfig ..." (with optional leading article) (golint)
    • Line 16: warning: comment on exported type OutputConfig should be of the form "OutputConfig ..." (with optional leading article) (golint)
    • Line 28: warning: comment on exported function RegistOutputHandler should be of the form "RegistOutputHandler ..." (golint)
    • Line 33: warning: comment on exported method Config.RunOutputs should be of the form "RunOutputs ..." (golint)
    • logcool/filter/split/split.go
    • Line 1: warning: package comment should be of the form "Package split ..." (golint)
    • Line 12: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: comment on exported type FilterConfig should be of the form "FilterConfig ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 44: warning: comment on exported method FilterConfig.Event should be of the form "Event ..." (golint)
    • logcool/input/stdin/stdin.go
    • Line 1: warning: package comment should be of the form "Package stdininput ..." (golint)
    • Line 17: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: comment on exported type InputConfig should be of the form "InputConfig ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 52: warning: comment on exported method InputConfig.Start should be of the form "Start ..." (golint)
    • logcool/utils/config.go
    • Line 14: warning: exported const Defaultconfig should have comment or be unexported (golint)
    • Line 36: warning: comment on exported type TypeConfig should be of the form "TypeConfig ..." (with optional leading article) (golint)
    • Line 43: warning: comment on exported type CommonConfig should be of the form "CommonConfig ..." (with optional leading article) (golint)
    • Line 49: warning: comment on exported type ConfigRaw should be of the form "ConfigRaw ..." (with optional leading article) (golint)
    • Line 52: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 60: warning: comment on exported type InChan should be of the form "InChan ..." (with optional leading article) (golint)
    • Line 62: warning: exported type OutChan should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method CommonConfig.SetInjector should be of the form "SetInjector ..." (golint)
    • Line 69: warning: comment on exported method CommonConfig.GetType should be of the form "GetType ..." (golint)
    • Line 74: warning: exported function CheckErrorValues should have comment or be unexported (golint)
    • Line 97: warning: comment on exported function LoadFromFile should be of the form "LoadFromFile ..." (golint)
    • Line 107: warning: comment on exported function LoadFromString should be of the form "LoadFromString ..." (golint)
    • Line 112: warning: comment on exported function LoadDefaultConfig should be of the form "LoadDefaultConfig ..." (golint)
    • Line 117: warning: comment on exported function LoadFromData should be of the form "LoadFromData ..." (golint)
    • Line 142: warning: comment on exported function ReflectConfig should be of the form "ReflectConfig ..." (golint)
    • Line 208: warning: comment on exported method Config.InvokeSimple should be of the form "InvokeSimple ..." (golint)
    • logcool/utils/logevent.go
    • Line 36: warning: comment on exported method LogEvent.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • Line 42: warning: comment on exported method LogEvent.MarshalIndent should be of the form "MarshalIndent ..." (golint)
    • Line 61: warning: comment on exported method LogEvent.GetString should be of the form "GetString ..." (golint)
    • logcool/filter/grok/grok.go
    • Line 1: warning: package comment should be of the form "Package grok ..." (golint)
    • Line 11: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: comment on exported type FilterConfig should be of the form "FilterConfig ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 43: warning: comment on exported method FilterConfig.Event should be of the form "Event ..." (golint)
    • logcool/cmd/cmd.go
    • Line 1: warning: package comment should be of the form "Package cmd ..." (golint)
    • Line 13: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 17: warning: exported const DEFAULTTEMPLATE should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: comment on exported function Command should be of the form "Command ..." (golint)
    • Line 32: warning: comment on exported function Custom should be of the form "Custom ..." (golint)
    • Line 43: warning: comment on exported function LoadTemplates should be of the form "LoadTemplates ..." (golint)
    • Line 59: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 94: warning: comment on exported function Version should be of the form "Version ..." (golint)
    • logcool/filter/metrics/metrics.go
    • Line 1: warning: package comment should be of the form "Package metrics ..." (golint)
    • Line 13: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: comment on exported type FilterConfig should be of the form "FilterConfig ..." (with optional leading article) (golint)
    • Line 29: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 49: warning: comment on exported method FilterConfig.Event should be of the form "Event ..." (golint)
    • logcool/input/file/file.go
    • Line 1: warning: package comment should be of the form "Package fileinput ..." (golint)
    • Line 25: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 32: warning: exported type SinceDBInfo should have comment or be unexported (golint)
    • Line 36: warning: comment on exported type InputConfig should be of the form "InputConfig ..." (with optional leading article) (golint)
    • Line 55: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 78: warning: comment on exported method InputConfig.Start should be of the form "Start ..." (golint)
    • Line 83: warning: comment on exported method InputConfig.LoadSinceData should be of the form "LoadSinceData ..." (golint)
    • Line 113: warning: comment on exported method InputConfig.SaveSinceDBInfos should be of the form "SaveSinceDBInfos ..." (golint)
    • Line 140: warning: comment on exported method InputConfig.CheckSaveSinceDBInfos should be of the form "CheckSaveSinceDBInfos ..." (golint)
    • Line 157: warning: comment on exported method InputConfig.LoopCheckSaveSinceInfos should be of the form "LoopCheckSaveSinceInfos ..." (golint)
    • logcool/output/redis/redis.go
    • Line 1: warning: package comment should be of the form "Package outputredis ..." (golint)
    • Line 16: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: comment on exported type OutputConfig should be of the form "OutputConfig ..." (with optional leading article) (golint)
    • Line 37: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 59: warning: comment on exported method OutputConfig.Event should be of the form "Event ..." (golint)
    • logcool/output/lexec/lexec.go
    • Line 1: warning: package comment should be of the form "Package outputexec ..." (golint)
    • Line 13: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: comment on exported type OutputConfig should be of the form "OutputConfig ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 42: warning: comment on exported method OutputConfig.Event should be of the form "Event ..." (golint)
    • logcool/input/collectd/collectd.go
    • Line 1: warning: package comment should be of the form "Package collectdinput ..." (golint)
    • Line 23: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: comment on exported type InputConfig should be of the form "InputConfig ..." (with optional leading article) (golint)
    • Line 33: warning: exported type CpuInfo should have comment or be unexported (golint)
    • Line 38: warning: exported type MemoryInfo should have comment or be unexported (golint)
    • Line 43: warning: exported type DiskInfo should have comment or be unexported (golint)
    • Line 49: warning: exported type HostInfo should have comment or be unexported (golint)
    • Line 54: warning: exported type NetInfo should have comment or be unexported (golint)
    • Line 62: warning: exported type ProcessInfo should have comment or be unexported (golint)
    • Line 96: warning: exported type SysInfo should have comment or be unexported (golint)
    • Line 109: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 130: warning: comment on exported method InputConfig.Start should be of the form "Start ..." (golint)
    • Line 136: warning: receiver name t should be consistent with previous receiver name ic for InputConfig (golint)
    • Line 173: warning: exported function CpuStat should have comment or be unexported (golint)
    • Line 184: warning: exported function MemStat should have comment or be unexported (golint)
    • Line 198: warning: exported function DiskStat should have comment or be unexported (golint)
    • Line 214: warning: exported function NetStat should have comment or be unexported (golint)
    • Line 239: warning: exported function ProcessStat should have comment or be unexported (golint)
    • Line 280: warning: exported function HostStat should have comment or be unexported (golint)
    • logcool/utils/input.go
    • Line 9: warning: comment on exported type TypeInputConfig should be of the form "TypeInputConfig ..." (with optional leading article) (golint)
    • Line 15: warning: comment on exported type InputConfig should be of the form "InputConfig ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported function RegistInputHandler should be of the form "RegistInputHandler ..." (golint)
    • Line 32: warning: comment on exported method Config.RunInputs should be of the form "RunInputs ..." (golint)
    • logcool/input/http/http.go
    • Line 17: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported type InputConfig should have comment or be unexported (golint)
    • Line 35: warning: exported function InitHandler should have comment or be unexported (golint)
    • Line 60: warning: exported method InputConfig.Start should have comment or be unexported (golint)
    • Line 83: warning: comment on exported method InputConfig.Handler should be of the form "Handler ..." (golint)
    • logcool/output/stdout/stdout.go
    • Line 1: warning: package comment should be of the form "Package outputstdout ..." (golint)
    • Line 12: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: comment on exported type OutputConfig should be of the form "OutputConfig ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 41: warning: comment on exported method OutputConfig.Event should be of the form "Event ..." (golint)
    • logcool/output/email/email.go
    • Line 1: warning: package comment should be of the form "Package outputemail ..." (golint)
    • Line 14: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: comment on exported type OutputConfig should be of the form "OutputConfig ..." (with optional leading article) (golint)
    • Line 32: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 49: warning: comment on exported method OutputConfig.Event should be of the form "Event ..." (golint)
    • Line 55: warning: exported method OutputConfig.Send should have comment or be unexported (golint)
    • logcool/filter/zeus/zeus.go
    • Line 1: warning: package comment should be of the form "Package zeus ..." (golint)
    • Line 10: warning: exported const ModuleName should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: comment on exported type FilterConfig should be of the form "FilterConfig ..." (with optional leading article) (golint)
    • Line 24: warning: comment on exported function InitHandler should be of the form "InitHandler ..." (golint)
    • Line 42: warning: comment on exported method FilterConfig.Event should be of the form "Event ..." (golint)
    • logcool/utils/filter.go
    • Line 9: warning: comment on exported type TypeFilterConfig should be of the form "TypeFilterConfig ..." (with optional leading article) (golint)
    • Line 15: warning: comment on exported type FilterConfig should be of the form "FilterConfig ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported function RegistFilterHandler should be of the form "RegistFilterHandler ..." (golint)
    • Line 32: warning: comment on exported method Config.RunFilters should be of the form "RunFilters ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign71%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words

    • logcool/cmd/cmd.go
    • Line 45: warning: "tempaltes" is a misspelling of "templates" (misspell)
    • Line 46: warning: "tempaltes" is a misspelling of "templates" (misspell)