Preparing report...

Report for github.com/txthinking/brook

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


golint20%

Golint is a linter for Go source code.

    • brook/hijackhttps.go
    • Line 34: warning: comment on exported type HijackHTTPS should be of the form "HijackHTTPS ..." (with optional leading article) (golint)
    • Line 48: warning: comment on exported function NewHijackHTTPS should be of the form "NewHijackHTTPS ..." (golint)
    • Line 97: warning: comment on exported method HijackHTTPS.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • Line 138: warning: exported method HijackHTTPS.RunUDPDNSServer should have comment or be unexported (golint)
    • Line 149: warning: exported method HijackHTTPS.RunTCPDNSServer should have comment or be unexported (golint)
    • Line 160: warning: exported method HijackHTTPS.DNSHandle should have comment or be unexported (golint)
    • Line 218: warning: exported method HijackHTTPS.RunHTTPSServer should have comment or be unexported (golint)
    • Line 245: warning: exported method HijackHTTPS.HTTPSHandle should have comment or be unexported (golint)
    • Line 397: warning: exported method HijackHTTPS.Shutdown should have comment or be unexported (golint)
    • Line 401: warning: exported method HijackHTTPS.Has should have comment or be unexported (golint)
    • brook/link.go
    • Line 26: warning: comment on exported function Link should be of the form "Link ..." (golint)
    • Line 52: warning: comment on exported function ParseLink should be of the form "ParseLink ..." (golint)
    • brook/relay.go
    • Line 81: warning: comment on exported method Relay.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • brook/streamserver.go
    • Line 32: warning: exported type StreamServer should have comment or be unexported (golint)
    • Line 45: warning: exported function NewStreamServer should have comment or be unexported (golint)
    • Line 149: warning: exported var StreamServerInit should have comment or be unexported (golint)
    • Line 165: warning: exported method StreamServer.Exchange should have comment or be unexported (golint)
    • Line 233: warning: exported method StreamServer.Clean should have comment or be unexported (golint)
    • brook/util.go
    • Line 25: warning: exported function ErrorReply should have comment or be unexported (golint)
    • Line 38: warning: exported function GetAddressFromURL should have comment or be unexported (golint)
    • brook/map.go
    • Line 29: warning: comment on exported type Map should be of the form "Map ..." (with optional leading article) (golint)
    • Line 46: warning: comment on exported function NewMap should be of the form "NewMap ..." (golint)
    • Line 85: warning: comment on exported method Map.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • brook/packetserver.go
    • Line 33: warning: exported type PacketServer should have comment or be unexported (golint)
    • Line 38: warning: exported type WriterFunc should have comment or be unexported (golint)
    • Line 39: warning: exported type WriteFunc should have comment or be unexported (golint)
    • Line 45: warning: exported function NewPacketServer should have comment or be unexported (golint)
    • Line 51: warning: exported method PacketServer.RemoteToClient should have comment or be unexported (golint)
    • Line 90: warning: exported var ServerPacket should have comment or be unexported (golint)
    • Line 97: warning: exported function PacketClientToRemote should have comment or be unexported (golint)
    • Line 131: warning: exported method PacketServer.Clean should have comment or be unexported (golint)
    • brook/socks5tohttp.go
    • Line 28: warning: exported type Socks5ToHTTP should have comment or be unexported (golint)
    • Line 38: warning: exported function NewSocks5ToHTTP should have comment or be unexported (golint)
    • Line 67: warning: exported method Socks5ToHTTP.ListenAndServe should have comment or be unexported (golint)
    • Line 95: warning: exported method Socks5ToHTTP.Handle should have comment or be unexported (golint)
    • Line 187: warning: exported method Socks5ToHTTP.Shutdown should have comment or be unexported (golint)
    • brook/wsclient.go
    • Line 39: warning: comment on exported type WSClient should be of the form "WSClient ..." (with optional leading article) (golint)
    • Line 53: warning: comment on exported function NewWSClient should be of the form "NewWSClient ..." (golint)
    • Line 95: warning: exported method WSClient.DialWebsocket should have comment or be unexported (golint)
    • brook/pac.go
    • Line 31: warning: exported type PAC should have comment or be unexported (golint)
    • Line 41: warning: exported function NewPAC should have comment or be unexported (golint)
    • Line 61: warning: exported method PAC.MakeBody should have comment or be unexported (golint)
    • Line 96: warning: exported method PAC.ListenAndServe should have comment or be unexported (golint)
    • Line 108: warning: exported method PAC.Shutdown should have comment or be unexported (golint)
    • Line 112: warning: exported method PAC.WriteToFile should have comment or be unexported (golint)
    • Line 127: warning: exported method PAC.WriteToStdout should have comment or be unexported (golint)
    • brook/packetclient.go
    • Line 33: warning: exported type PacketClient should have comment or be unexported (golint)
    • Line 43: warning: exported function NewPacketClient should have comment or be unexported (golint)
    • Line 50: warning: exported var ClientPacket should have comment or be unexported (golint)
    • Line 57: warning: exported method PacketClient.LocalToServer should have comment or be unexported (golint)
    • Line 96: warning: exported method PacketClient.RunServerToLocal should have comment or be unexported (golint)
    • Line 105: warning: exported method PacketClient.ServerToLocal should have comment or be unexported (golint)
    • Line 147: warning: exported method PacketClient.Clean should have comment or be unexported (golint)
    • brook/packetstream.go
    • Line 23: warning: exported type PacketStream should have comment or be unexported (golint)
    • Line 29: warning: exported function NewPacketStream should have comment or be unexported (golint)
    • Line 65: warning: exported method PacketStream.Close should have comment or be unexported (golint)
    • Line 70: warning: exported method PacketStream.LocalAddr should have comment or be unexported (golint)
    • Line 74: warning: exported method PacketStream.RemoteAddr should have comment or be unexported (golint)
    • Line 78: warning: exported method PacketStream.SetDeadline should have comment or be unexported (golint)
    • Line 82: warning: exported method PacketStream.SetReadDeadline should have comment or be unexported (golint)
    • Line 86: warning: exported method PacketStream.SetWriteDeadline should have comment or be unexported (golint)
    • brook/tproxy/tcp_linux.go
    • Line 27: warning: exported function ListenTCP should have comment or be unexported (golint)
    • Line 50: warning: exported function DialTCP should have comment or be unexported (golint)
    • brook/client.go
    • Line 27: warning: comment on exported type Client should be of the form "Client ..." (with optional leading article) (golint)
    • Line 106: warning: exported type UDPExchange should have comment or be unexported (golint)
    • brook/dns.go
    • Line 36: warning: comment on exported type DNS should be of the form "DNS ..." (with optional leading article) (golint)
    • Line 55: warning: comment on exported function NewDNS should be of the form "NewDNS ..." (golint)
    • Line 107: warning: comment on exported method DNS.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • Line 394: warning: exported method DNS.Has should have comment or be unexported (golint)
    • Line 410: warning: exported function ReadList should have comment or be unexported (golint)
    • brook/init.go
    • Line 22: warning: exported var Dial should have comment or be unexported (golint)
    • Line 24: warning: exported var Debug should have comment or be unexported (golint)
    • Line 26: warning: comment on exported function EnableDebug should be of the form "EnableDebug ..." (golint)
    • brook/server.go
    • Line 30: warning: comment on exported type Server should be of the form "Server ..." (with optional leading article) (golint)
    • Line 44: warning: comment on exported function NewServer should be of the form "NewServer ..." (golint)
    • Line 72: warning: comment on exported method Server.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • brook/tproxy_linux.go
    • Line 34: warning: comment on exported type Tproxy should be of the form "Tproxy ..." (with optional leading article) (golint)
    • Line 54: warning: comment on exported function NewTproxy should be of the form "NewTproxy ..." (golint)
    • Line 124: warning: exported method Tproxy.RunAutoScripts should have comment or be unexported (golint)
    • Line 237: warning: exported method Tproxy.ClearAutoScripts should have comment or be unexported (golint)
    • Line 257: warning: comment on exported method Tproxy.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • Line 345: warning: exported method Tproxy.HasIP should have comment or be unexported (golint)
    • Line 448: warning: exported method Tproxy.UDPHandle should have comment or be unexported (golint)
    • Line 496: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 546: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • brook/wsserver.go
    • Line 35: warning: comment on exported type WSServer should be of the form "WSServer ..." (with optional leading article) (golint)
    • Line 48: warning: comment on exported function NewWSServer should be of the form "NewWSServer ..." (golint)
    • Line 74: warning: comment on exported method WSServer.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • brook/tproxy/udp_linux.go
    • Line 29: warning: exported function ListenUDP should have comment or be unexported (golint)
    • Line 56: warning: exported function ReadFromUDP should have comment or be unexported (golint)
    • Line 104: warning: exported function DialUDP should have comment or be unexported (golint)
    • brook/nonce.go
    • Line 19: warning: exported function NextNonce should have comment or be unexported (golint)
    • brook/streamclient.go
    • Line 32: warning: exported type StreamClient should have comment or be unexported (golint)
    • Line 46: warning: exported function NewStreamClient should have comment or be unexported (golint)
    • Line 146: warning: exported var StreamClientInit should have comment or be unexported (golint)
    • Line 156: warning: exported method StreamClient.Exchange should have comment or be unexported (golint)
    • Line 190: warning: exported method StreamClient.WriteL should have comment or be unexported (golint)
    • Line 202: warning: exported method StreamClient.ReadL should have comment or be unexported (golint)
    • Line 221: warning: exported method StreamClient.Clean should have comment or be unexported (golint)

gocyclo73%

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.

    • brook/tproxy_linux.go
    • Line 124: warning: cyclomatic complexity 27 of function (*Tproxy).RunAutoScripts() is high (> 15) (gocyclo)
    • Line 448: warning: cyclomatic complexity 26 of function (*Tproxy).UDPHandle() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 19 of function (*Tproxy).TCPHandle() is high (> 15) (gocyclo)
    • brook/wsclient.go
    • Line 95: warning: cyclomatic complexity 20 of function (*WSClient).DialWebsocket() is high (> 15) (gocyclo)
    • brook/hijackhttps.go
    • Line 245: warning: cyclomatic complexity 37 of function (*HijackHTTPS).HTTPSHandle() is high (> 15) (gocyclo)
    • Line 160: warning: cyclomatic complexity 17 of function (*HijackHTTPS).DNSHandle() is high (> 15) (gocyclo)
    • brook/dns.go
    • Line 193: warning: cyclomatic complexity 28 of function (*DNS).TCPHandle() is high (> 15) (gocyclo)
    • Line 297: warning: cyclomatic complexity 21 of function (*DNS).UDPHandle() is high (> 15) (gocyclo)
    • Line 410: warning: cyclomatic complexity 16 of function ReadList() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


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!