Preparing report...

Report for github.com/php2go/netpollmux

A+    Excellent!    Found 35 issues across 86 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!


gocyclo86%

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.

    • netpollmux/netpoll/net_unix.go
    • Line 84: warning: cyclomatic complexity 27 of function (*Server).Serve() is high (> 15) (gocyclo)
    • Line 274: warning: cyclomatic complexity 21 of function (*Server).reschedule() is high (> 15) (gocyclo)

golint81%

Golint is a linter for Go source code.

    • netpollmux/mux/remote.go
    • Line 10: warning: exported const XRealIP should have comment (or a comment on this block) or be unexported (golint)
    • Line 14: warning: exported function RemoteAddr should have comment or be unexported (golint)
    • Line 33: warning: exported function IpTo4 should have comment or be unexported (golint)
    • netpollmux/mux/compress.go
    • Line 38: warning: exported type CompressWriter should have comment or be unexported (golint)
    • Line 44: warning: exported type Compressor should have comment or be unexported (golint)
    • Line 76: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 81: warning: exported method Compressor.Close should have comment or be unexported (golint)
    • netpollmux/mux/render.go
    • Line 11: warning: exported var DefaultRender should have comment or be unexported (golint)
    • Line 17: warning: exported type Render should have comment or be unexported (golint)
    • Line 26: warning: exported function NewRender should have comment or be unexported (golint)
    • Line 32: warning: exported method Render.GzipAll should have comment or be unexported (golint)
    • Line 39: warning: exported method Render.DeflateAll should have comment or be unexported (golint)
    • Line 46: warning: exported method Render.Charset should have comment or be unexported (golint)
    • Line 53: warning: exported function Body should have comment or be unexported (golint)
    • Line 81: warning: exported method Render.Body should have comment or be unexported (golint)
    • Line 85: warning: exported function File should have comment or be unexported (golint)
    • Line 89: warning: exported method Render.File should have comment or be unexported (golint)
    • Line 101: warning: exported function ServeFile should have comment or be unexported (golint)
    • Line 105: warning: exported method Render.ServeFile should have comment or be unexported (golint)
    • Line 109: warning: exported function JSON should have comment or be unexported (golint)
    • Line 113: warning: exported method Render.JSON should have comment or be unexported (golint)
    • Line 130: warning: exported function XML should have comment or be unexported (golint)
    • Line 134: warning: exported method Render.XML should have comment or be unexported (golint)
    • Line 151: warning: exported function Redirect should have comment or be unexported (golint)
    • Line 155: warning: exported method Render.Redirect should have comment or be unexported (golint)
    • Line 159: warning: exported function Text should have comment or be unexported (golint)
    • Line 163: warning: exported method Render.Text should have comment or be unexported (golint)
    • Line 168: warning: exported method Render.Parse should have comment or be unexported (golint)
    • Line 172: warning: exported method Render.Execute should have comment or be unexported (golint)
    • Line 176: warning: exported method Render.ParseTemplate should have comment or be unexported (golint)
    • Line 180: warning: exported method Render.ExecuteTemplate should have comment or be unexported (golint)
    • netpollmux/mux/render_template.go
    • Line 27: warning: exported type Tmpl should have comment or be unexported (golint)
    • Line 34: warning: exported function NewTmpl should have comment or be unexported (golint)
    • Line 38: warning: exported function NewTmplWithRender should have comment or be unexported (golint)
    • Line 42: warning: exported method Tmpl.Parse should have comment or be unexported (golint)
    • Line 53: warning: exported method Tmpl.Execute should have comment or be unexported (golint)
    • Line 76: warning: exported method Tmpl.ParseTemplate should have comment or be unexported (golint)
    • Line 93: warning: exported method Tmpl.ParseFiles should have comment or be unexported (golint)
    • Line 104: warning: exported method Tmpl.ExecuteTemplate should have comment or be unexported (golint)
    • Line 127: warning: exported function Execute should have comment or be unexported (golint)
    • netpollmux/netpoll/handler.go
    • Line 18: warning: exported var ErrServeFunc should have comment or be unexported (golint)
    • Line 63: warning: exported function NewConHandler should have comment or be unexported (golint)
    • netpollmux/mux/header_access_control.go
    • Line 9: warning: exported function AllowOrigin should have comment or be unexported (golint)
    • Line 13: warning: exported function AllowOriginAll should have comment or be unexported (golint)
    • Line 17: warning: exported function AllowCredentials should have comment or be unexported (golint)
    • Line 21: warning: exported function MaxAge should have comment or be unexported (golint)
    • Line 25: warning: exported function AllowMethods should have comment or be unexported (golint)
    • Line 29: warning: exported function AllowHeaders should have comment or be unexported (golint)
    • netpollmux/mux/header_encoding.go
    • Line 8: warning: exported function CheckAcceptEncoding should have comment or be unexported (golint)
    • Line 15: warning: exported function SetContentEncoding should have comment or be unexported (golint)
    • netpollmux/test/netpoll.go
    • Line 29: warning: exported type Context should have comment or be unexported (golint)
    • Line 36: warning: exported function ListenAndServe should have comment or be unexported (golint)
    • netpollmux/mux/header.go
    • Line 6: warning: exported const ContentEncoding should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported function SetHeader should have comment or be unexported (golint)
    • Line 51: warning: exported function DelHeader should have comment or be unexported (golint)
    • Line 55: warning: exported function WriteHeader should have comment or be unexported (golint)
    • Line 59: warning: exported function GetRequestHeader should have comment or be unexported (golint)
    • Line 63: warning: exported function GetResponseHeader should have comment or be unexported (golint)
    • netpollmux/mux/header_content.go
    • Line 8: warning: exported function SetContentLength should have comment or be unexported (golint)
    • Line 12: warning: exported function SetContentType should have comment or be unexported (golint)
    • Line 16: warning: exported function SetCharset should have comment or be unexported (golint)
    • Line 22: warning: exported function SetContentTypeWithCharset should have comment or be unexported (golint)
    • netpollmux/mux/proxy.go
    • Line 9: warning: exported const MaxConnPerHost should have comment or be unexported (golint)
    • Line 20: warning: exported function Proxy should have comment or be unexported (golint)
    • netpollmux/mux/compress_deflate.go
    • Line 8: warning: exported function NewDeflateWriter should have comment or be unexported (golint)
    • Line 12: warning: exported function NewZlibWriter should have comment or be unexported (golint)
    • Line 29: warning: exported function Zlib should have comment or be unexported (golint)
    • Line 37: warning: exported function Deflate should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign84%

IneffAssign detects ineffectual assignments in Go code.

    • netpollmux/mux/response.go
    • Line 20: warning: contentLength redeclared in this block (ineffassign)
    • Line 114: warning: headerPool redeclared in this block (ineffassign)
    • Line 131: warning: freeHeader redeclared in this block (ineffassign)
    • Line 20: warning: contentLength redeclared in this block (ineffassign)
    • Line 114: warning: headerPool redeclared in this block (ineffassign)
    • Line 131: warning: freeHeader redeclared in this block (ineffassign)
    • netpollmux/mux/request.go
    • Line 17: warning: other declaration of contentLength (ineffassign)
    • Line 46: warning: other declaration of headerPool (ineffassign)
    • Line 52: warning: other declaration of freeHeader (ineffassign)
    • Line 17: warning: other declaration of contentLength (ineffassign)
    • Line 46: warning: other declaration of headerPool (ineffassign)
    • Line 52: warning: other declaration of freeHeader (ineffassign)
    • netpollmux/test/netpoll.go
    • Line 8: warning: package netpollmux/mux is not in GOROOT (/usr/local/go/src/netpollmux/mux) (ineffassign)
    • Line 9: warning: package netpollmux/netpoll is not in GOROOT (/usr/local/go/src/netpollmux/netpoll) (ineffassign)
    • Line 8: warning: could not import netpollmux/mux (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import netpollmux/netpoll (invalid package name: "") (ineffassign)

misspell98%

Misspell Finds commonly misspelled English words