Preparing report...

Report for github.com/alexstocks/log4go

A+    Excellent!    Found 11 issues across 20 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!


gocyclo85%

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.

    • log4go/config.go
    • Line 92: warning: cyclomatic complexity 25 of function (*Logger).LoadConfiguration() is high (> 15) (gocyclo)
    • Line 269: warning: cyclomatic complexity 16 of function confToFileLogWriter() is high (> 15) (gocyclo)
    • log4go/filelog.go
    • Line 253: warning: cyclomatic complexity 23 of function (*FileLogWriter).intRotate() is high (> 15) (gocyclo)
    • Line 146: warning: cyclomatic complexity 17 of function NewFileLogWriter() is high (> 15) (gocyclo)

golint45%

Golint is a linter for Go source code.

    • log4go/filelog.go
    • Line 15: warning: exported type RotType should have comment or be unexported (golint)
    • Line 18: warning: exported const ROT_TYPE_DAY should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: comment on exported const DEF_ROT_TIME_SUFFIX_DAY should be of the form "DEF_ROT_TIME_SUFFIX_DAY ..." (golint)
    • Line 25: warning: comment on exported type FileLogWriter should be of the form "FileLogWriter ..." (with optional leading article) (golint)
    • Line 73: warning: comment on exported method FileLogWriter.LogWrite should be of the form "LogWrite ..." (golint)
    • Line 89: warning: exported method FileLogWriter.Close should have comment or be unexported (golint)
    • Line 111: warning: comment on exported method FileLogWriter.GetCallerFlag should be of the form "GetCallerFlag ..." (golint)
    • Line 246: warning: comment on exported method FileLogWriter.Rotate should be of the form "Rotate ..." (golint)
    • Line 432: warning: comment on exported method FileLogWriter.SetJson should be of the form "SetJson ..." (golint)
    • Line 439: warning: comment on exported method FileLogWriter.SetFormat should be of the form "SetFormat ..." (golint)
    • Line 446: warning: comment on exported method FileLogWriter.SetHeadFoot should be of the form "SetHeadFoot ..." (golint)
    • Line 457: warning: comment on exported method FileLogWriter.SetRotateLines should be of the form "SetRotateLines ..." (golint)
    • Line 466: warning: comment on exported method FileLogWriter.SetRotateSize should be of the form "SetRotateSize ..." (golint)
    • Line 475: warning: comment on exported method FileLogWriter.SetRotateDaily should be of the form "SetRotateDaily ..." (golint)
    • Line 487: warning: comment on exported method FileLogWriter.SetRotateHourly should be of the form "SetRotateHourly ..." (golint)
    • Line 499: warning: comment on exported method FileLogWriter.SetRotateParams should be of the form "SetRotateParams ..." (golint)
    • Line 548: warning: comment on exported method FileLogWriter.SetRotateMaxBackup should be of the form "SetRotateMaxBackup ..." (golint)
    • Line 566: warning: comment on exported method FileLogWriter.SetCallerFlag should be of the form "SetCallerFlag ..." (golint)
    • log4go/pattlog.go
    • Line 18: warning: exported const FORMAT_DEFAULT should have comment (or a comment on this block) or be unexported (golint)
    • Line 75: warning: comment on exported function FormatLogRecord should be of the form "FormatLogRecord ..." (golint)
    • Line 164: warning: comment on exported type FormatLogWriter should be of the form "FormatLogWriter ..." (with optional leading article) (golint)
    • Line 171: warning: comment on exported function NewFormatLogWriter should be of the form "NewFormatLogWriter ..." (golint)
    • Line 189: warning: comment on exported method FormatLogWriter.GetCallerFlag should be of the form "GetCallerFlag ..." (golint)
    • Line 192: warning: comment on exported method FormatLogWriter.SetCallerFlag should be of the form "SetCallerFlag ..." (golint)
    • Line 199: warning: comment on exported method FormatLogWriter.LogWrite should be of the form "LogWrite ..." (golint)
    • log4go/buffile.go
    • Line 21: warning: exported type BufFileWriter should have comment or be unexported (golint)
    • Line 39: warning: exported method BufFileWriter.Reset should have comment or be unexported (golint)
    • Line 64: warning: exported method BufFileWriter.Close should have comment or be unexported (golint)
    • Line 82: warning: exported method BufFileWriter.Flush should have comment or be unexported (golint)
    • Line 95: warning: exported method BufFileWriter.Seek should have comment or be unexported (golint)
    • log4go/color.go
    • Line 24: warning: comment on exported var NORMAL should be of the form "NORMAL ..." (golint)
    • Line 27: warning: exported var NBlack should have comment or be unexported (golint)
    • Line 35: warning: comment on exported var BBlack should be of the form "BBlack ..." (golint)
    • Line 49: warning: exported function CPrintfln should have comment or be unexported (golint)
    • log4go/logrecord.go
    • Line 44: warning: exported method LogRecord.IsNil should have comment or be unexported (golint)
    • Line 48: warning: comment on exported method LogRecord.JSON should be of the form "JSON ..." (golint)
    • Line 172: warning: receiver name v should be consistent with previous receiver name r for LogRecord (golint)
    • Line 179: warning: receiver name v should be consistent with previous receiver name r for LogRecord (golint)
    • Line 184: warning: receiver name v should be consistent with previous receiver name r for LogRecord (golint)
    • Line 191: warning: receiver name v should be consistent with previous receiver name r for LogRecord (golint)
    • log4go/socklog.go
    • Line 13: warning: comment on exported type SocketLogWriter should be of the form "SocketLogWriter ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported method SocketLogWriter.LogWrite should be of the form "LogWrite ..." (golint)
    • Line 46: warning: exported method SocketLogWriter.Close should have comment or be unexported (golint)
    • Line 53: warning: comment on exported method SocketLogWriter.GetCallerFlag should be of the form "GetCallerFlag ..." (golint)
    • Line 56: warning: comment on exported method SocketLogWriter.SetCallerFlag should be of the form "SetCallerFlag ..." (golint)
    • Line 63: warning: exported function NewSocketLogWriter should have comment or be unexported (golint)
    • log4go/termlog.go
    • Line 17: warning: comment on exported type ConsoleLogWriter should be of the form "ConsoleLogWriter ..." (with optional leading article) (golint)
    • Line 28: warning: comment on exported function NewConsoleLogWriter should be of the form "NewConsoleLogWriter ..." (golint)
    • Line 43: warning: exported method ConsoleLogWriter.SetJson should have comment or be unexported (golint)
    • Line 47: warning: exported method ConsoleLogWriter.SetFormat should have comment or be unexported (golint)
    • Line 51: warning: exported method ConsoleLogWriter.SetCallerFlag should have comment or be unexported (golint)
    • Line 55: warning: exported function String should have comment or be unexported (golint)
    • Line 63: warning: exported function Slice should have comment or be unexported (golint)
    • Line 109: warning: comment on exported method ConsoleLogWriter.LogWrite should be of the form "LogWrite ..." (golint)
    • Line 132: warning: comment on exported method ConsoleLogWriter.GetCallerFlag should be of the form "GetCallerFlag ..." (golint)
    • log4go/version.go
    • Line 6: warning: exported const Version should have comment (or a comment on this block) or be unexported (golint)
    • log4go/wrapper.go
    • Line 13: warning: exported var Global should have comment or be unexported (golint)
    • Line 31: warning: comment on exported function LoadConfiguration should be of the form "LoadConfiguration ..." (golint)
    • Line 41: warning: comment on exported function AddFilter should be of the form "AddFilter ..." (golint)
    • Line 46: warning: comment on exported function Close should be of the form "Close ..." (golint)
    • Line 51: warning: exported function Crash should have comment or be unexported (golint)
    • Line 58: warning: comment on exported function Crashf should be of the form "Crashf ..." (golint)
    • Line 65: warning: comment on exported function Exit should be of the form "Exit ..." (golint)
    • Line 74: warning: comment on exported function Exitf should be of the form "Exitf ..." (golint)
    • Line 81: warning: comment on exported function Stderr should be of the form "Stderr ..." (golint)
    • Line 88: warning: comment on exported function Stderrf should be of the form "Stderrf ..." (golint)
    • Line 93: warning: comment on exported function Stdout should be of the form "Stdout ..." (golint)
    • Line 100: warning: comment on exported function Stdoutf should be of the form "Stdoutf ..." (golint)
    • Line 105: warning: comment on exported function Log should be of the form "Log ..." (golint)
    • Line 111: warning: comment on exported function Logf should be of the form "Logf ..." (golint)
    • Line 117: warning: comment on exported function Logc should be of the form "Logc ..." (golint)
    • Line 123: warning: comment on exported function Finest should be of the form "Finest ..." (golint)
    • Line 142: warning: comment on exported function Fine should be of the form "Fine ..." (golint)
    • Line 161: warning: comment on exported function Debug should be of the form "Debug ..." (golint)
    • Line 183: warning: comment on exported function Trace should be of the form "Trace ..." (golint)
    • Line 202: warning: comment on exported function Info should be of the form "Info ..." (golint)
    • Line 221: warning: comment on exported function Warn should be of the form "Warn ..." (golint)
    • Line 247: warning: comment on exported function Error should be of the form "Error ..." (golint)
    • Line 273: warning: comment on exported function Critical should be of the form "Critical ..." (golint)
    • Line 284: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • log4go/config.go
    • Line 91: warning: comment on exported method Logger.LoadConfiguration should be of the form "LoadConfiguration ..." (golint)
    • log4go/log4go.go
    • Line 75: warning: exported function SetCallerLevel should have comment or be unexported (golint)
    • Line 79: warning: comment on exported type Level should be of the form "Level ..." (with optional leading article) (golint)
    • Line 83: warning: exported const FINEST should have comment (or a comment on this block) or be unexported (golint)
    • Line 115: warning: comment on exported type LogCloser should be of the form "LogCloser ..." (with optional leading article) (golint)
    • Line 120: warning: exported method LogCloser.LogCloserInit should have comment or be unexported (golint)
    • Line 124: warning: comment on exported method LogCloser.IsClosed should be of the form "IsClosed ..." (golint)
    • Line 133: warning: comment on exported method LogCloser.WaitClosed should be of the form "WaitClosed ..." (golint)
    • Line 145: warning: comment on exported type LogWriter should be of the form "LogWriter ..." (with optional leading article) (golint)
    • Line 167: warning: comment on exported type FilterMap should be of the form "FilterMap ..." (with optional leading article) (golint)
    • Line 181: warning: comment on exported function NewLogger should be of the form "NewLogger ..." (golint)
    • Line 187: warning: comment on exported function NewConsoleLogger should be of the form "NewConsoleLogger ..." (golint)
    • Line 207: warning: comment on exported function NewDefaultLogger should be of the form "NewDefaultLogger ..." (golint)
    • Line 224: warning: exported method Logger.SetAsDefaultLogger should have comment or be unexported (golint)
    • Line 229: warning: comment on exported method Logger.Close should be of the form "Close ..." (golint)
    • Line 247: warning: comment on exported method Logger.AddFilter should be of the form "AddFilter ..." (golint)
    • Line 359: warning: comment on exported method Logger.Log should be of the form "Log ..." (golint)
    • Line 587: warning: exported method Logger.Critic should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign95%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!