Preparing report...

Report for github.com/astaxie/bat

A    Great!    Found 7 issues across 9 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!


golint33%

Golint is a linter for Go source code.

    • bat/color.go
    • Line 11: warning: exported const Gray should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported function Color should have comment or be unexported (golint)
    • Line 27: warning: exported function ColorStart should have comment or be unexported (golint)
    • Line 31: warning: exported function ColorfulRequest should have comment or be unexported (golint)
    • Line 52: warning: exported function ColorfulResponse should have comment or be unexported (golint)
    • Line 65: warning: exported function ColorfulJson should have comment or be unexported (golint)
    • Line 152: warning: exported function ColorfulHTML should have comment or be unexported (golint)
    • bat/pb.go
    • Line 12: warning: exported const DEFAULT_REFRESH_RATE should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type ProgressBar should have comment or be unexported (golint)
    • Line 35: warning: exported function NewProgressBar should have comment or be unexported (golint)
    • Line 54: warning: exported method ProgressBar.Start should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method ProgressBar.Update should be of the form "Update ..." (golint)
    • Line 99: warning: exported method ProgressBar.Add64 should have comment or be unexported (golint)
    • Line 103: warning: comment on exported method ProgressBar.Finish should be of the form "Finish ..." (golint)
    • bat/utils.go
    • Line 64: warning: comment on exported function FormatBytes should be of the form "FormatBytes ..." (golint)
    • bat/httplib/httplib.go
    • Line 16: warning: package comment should be of the form "Package httplib ..." (golint)
    • Line 66: warning: comment on exported function SetDefaultSetting should be of the form "SetDefaultSetting ..." (golint)
    • Line 79: warning: comment on exported function NewBeegoRequest should be of the form "NewBeegoRequest ..." (golint)
    • Line 122: warning: comment on exported type BeegoHttpSettings should be of the form "BeegoHttpSettings ..." (with optional leading article) (golint)
    • Line 148: warning: comment on exported method BeegoHttpRequest.GetRequest should be of the form "GetRequest ..." (golint)
    • Line 153: warning: comment on exported method BeegoHttpRequest.Setting should be of the form "Setting ..." (golint)
    • Line 183: warning: comment on exported method BeegoHttpRequest.DumpBody should be of the form "DumpBody ..." (golint)
    • Line 189: warning: comment on exported method BeegoHttpRequest.DumpRequest should be of the form "DumpRequest ..." (golint)
    • Line 213: warning: comment on exported method BeegoHttpRequest.SetHost should be of the form "SetHost ..." (golint)
    • Line 219: warning: comment on exported method BeegoHttpRequest.SetProtocolVersion should be of the form "SetProtocolVersion ..." (golint)
    • Line 242: warning: comment on exported method BeegoHttpRequest.SetTransport should be of the form "SetTransport ..." (golint)
    • Line 248: warning: comment on exported method BeegoHttpRequest.SetProxy should be of the form "SetProxy ..." (golint)
    • Line 267: warning: exported method BeegoHttpRequest.PostFile should have comment or be unexported (golint)
    • Line 368: warning: exported method BeegoHttpRequest.SendOut should have comment or be unexported (golint)
    • bat/bat.go
    • Line 61: warning: exported var URL should have comment or be unexported (golint)
    • bat/bench.go
    • Line 21: warning: exported function RunBench should have comment or be unexported (golint)
    • Line 45: warning: should omit values from range; this loop is equivalent to `for range ...` (golint)

gocyclo55%

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.

    • bat/bat.go
    • Line 110: warning: cyclomatic complexity 58 of function main() is high (> 15) (gocyclo)
    • bat/color.go
    • Line 65: warning: cyclomatic complexity 24 of function ColorfulJson() is high (> 15) (gocyclo)
    • bat/http.go
    • Line 27: warning: cyclomatic complexity 23 of function getHTTP() is high (> 15) (gocyclo)
    • bat/pb.go
    • Line 116: warning: cyclomatic complexity 17 of function (*ProgressBar).write() is high (> 15) (gocyclo)

ineffassign88%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!