Preparing report...

Report for github.com/genshen/wssocks

A    Great!    Found 27 issues across 31 files

Tweet

gofmt93%

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!


gocyclo96%

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.


golint12%

Golint is a linter for Go source code.

    • wssocks/wss/concurrent_websocket.go
    • Line 12: warning: exported type ConcurrentWebSocketInterface should have comment or be unexported (golint)
    • Line 17: warning: comment on exported type ConcurrentWebSocket should be of the form "ConcurrentWebSocket ..." (with optional leading article) (golint)
    • Line 22: warning: comment on exported method ConcurrentWebSocket.WSClose should be of the form "WSClose ..." (golint)
    • Line 27: warning: comment on exported method ConcurrentWebSocket.WriteProxyMessage should be of the form "WriteProxyMessage ..." (golint)
    • Line 48: warning: context.Context should be the first parameter of a function (golint)
    • Line 48: warning: exported function NewWebSocketWriter should have comment or be unexported (golint)
    • Line 52: warning: context.Context should be the first parameter of a function (golint)
    • Line 52: warning: exported function NewWebSocketWriterWithMutex should have comment or be unexported (golint)
    • Line 75: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • wssocks/wss/heart_beat.go
    • Line 10: warning: exported type HeartBeat should have comment or be unexported (golint)
    • Line 16: warning: exported function NewHeartBeat should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method HeartBeat.Close should be of the form "Close ..." (golint)
    • Line 33: warning: comment on exported method HeartBeat.Start should be of the form "Start ..." (golint)
    • wssocks/wss/proxy_client_https.go
    • Line 11: warning: exported type HttpsClient should have comment or be unexported (golint)
    • Line 14: warning: exported method HttpsClient.ProxyType should have comment or be unexported (golint)
    • Line 18: warning: exported method HttpsClient.Trigger should have comment or be unexported (golint)
    • Line 22: warning: exported method HttpsClient.EstablishData should have comment or be unexported (golint)
    • Line 26: warning: comment on exported method HttpsClient.ParseHeader should be of the form "ParseHeader ..." (golint)
    • Line 31: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 35: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 38: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • wssocks/wss/term_view/writer.go
    • Line 3: warning: don't use an underscore in package name (golint)
    • Line 36: warning: comment on exported method Writer.ClearLines should be of the form "ClearLines ..." (golint)
    • Line 49: warning: comment on exported method Writer.NormalWrite should be of the form "NormalWrite ..." (golint)
    • wssocks/wss/status/status.go
    • Line 10: warning: exported type Version should have comment or be unexported (golint)
    • Line 16: warning: exported type Info should have comment or be unexported (golint)
    • Line 29: warning: exported type Statistics should have comment or be unexported (golint)
    • Line 35: warning: exported type Status should have comment or be unexported (golint)
    • Line 48: warning: comment on exported function NewStatusHandle should be of the form "NewStatusHandle ..." (golint)
    • wssocks/wss/proxy_server.go
    • Line 20: warning: exported type Connector should have comment or be unexported (golint)
    • Line 24: warning: comment on exported type ProxyEstablish should be of the form "ProxyEstablish ..." (with optional leading article) (golint)
    • Line 36: warning: exported type ClientData should have comment or be unexported (golint)
    • Line 38: warning: error var ConnCloseByClient should have name of the form ErrFoo (golint)
    • Line 38: warning: exported var ConnCloseByClient should have comment or be unexported (golint)
    • Line 82: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 98: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 126: warning: comment on exported type ChanDone should be of the form "ChanDone ..." (with optional leading article) (golint)
    • Line 132: warning: comment on exported type DefaultProxyEst should be of the form "DefaultProxyEst ..." (with optional leading article) (golint)
    • Line 145: warning: exported method DefaultProxyEst.Close should have comment or be unexported (golint)
    • Line 194: warning: exported type HttpProxyEst should have comment or be unexported (golint)
    • Line 208: warning: exported method HttpProxyEst.Close should have comment or be unexported (golint)
    • wssocks/wss/conn_records.go
    • Line 9: warning: comment on exported type ConnRecord should be of the form "ConnRecord ..." (with optional leading article) (golint)
    • Line 18: warning: comment on exported type ConnStatus should be of the form "ConnStatus ..." (with optional leading article) (golint)
    • Line 25: warning: exported function NewConnRecord should have comment or be unexported (golint)
    • Line 32: warning: exported method ConnRecord.Update should have comment or be unexported (golint)
    • wssocks/wss/hub.go
    • Line 10: warning: exported type ProxyServer should have comment or be unexported (golint)
    • Line 25: warning: exported type ProxyRegister should have comment or be unexported (golint)
    • Line 32: warning: exported method Hub.Close should have comment or be unexported (golint)
    • Line 49: warning: exported method Hub.GetProxyById should have comment or be unexported (golint)
    • Line 58: warning: comment on exported method Hub.GetConnectorSize should be of the form "GetConnectorSize ..." (golint)
    • Line 65: warning: comment on exported method Hub.CloseProxyConn should be of the form "CloseProxyConn ..." (golint)
    • Line 74: warning: exported method Hub.RemoveProxy should have comment or be unexported (golint)
    • wssocks/wss/proxy_client_interface.go
    • Line 8: warning: exported const ProxyTypeSocks5 should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: exported function ProxyTypeStr should have comment or be unexported (golint)
    • Line 25: warning: comment on exported type ProxyInterface should be of the form "ProxyInterface ..." (with optional leading article) (golint)
    • wssocks/wss/proxy_client_socks5.go
    • Line 12: warning: exported type Socks5Client should have comment or be unexported (golint)
    • Line 15: warning: exported method Socks5Client.ProxyType should have comment or be unexported (golint)
    • Line 19: warning: exported method Socks5Client.Trigger should have comment or be unexported (golint)
    • Line 23: warning: exported method Socks5Client.EstablishData should have comment or be unexported (golint)
    • Line 27: warning: comment on exported method Socks5Client.ParseHeader should be of the form "ParseHeader ..." (golint)
    • wssocks/client/client_plugin.go
    • Line 10: warning: comment on exported type OptionPlugin should be of the form "OptionPlugin ..." (with optional leading article) (golint)
    • Line 16: warning: comment on exported type RequestPlugin should be of the form "RequestPlugin ..." (with optional leading article) (golint)
    • Line 21: warning: exported type VersionPlugin should have comment or be unexported (golint)
    • Line 32: warning: exported var ErrPluginOccupied should have comment or be unexported (golint)
    • Line 34: warning: comment on exported method Plugins.HasOptionPlugin should be of the form "HasOptionPlugin ..." (golint)
    • Line 40: warning: comment on exported method Plugins.HasRequestPlugin should be of the form "HasRequestPlugin ..." (golint)
    • Line 46: warning: exported method Plugins.HasVersionPlugin should have comment or be unexported (golint)
    • Line 52: warning: comment on exported function AddPluginOption should be of the form "AddPluginOption ..." (golint)
    • Line 61: warning: comment on exported function AddPluginRequest should be of the form "AddPluginRequest ..." (golint)
    • Line 70: warning: comment on exported function AddPluginVersion should be of the form "AddPluginVersion ..." (golint)
    • wssocks/wss/wssocks_client.go
    • Line 14: warning: error var StoppedError should have name of the form ErrFoo (golint)
    • Line 14: warning: exported var StoppedError should have comment or be unexported (golint)
    • Line 16: warning: comment on exported type Client should be of the form "Client ..." (with optional leading article) (golint)
    • Line 24: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 31: warning: comment on exported method Client.Reply should be of the form "Reply ..." (golint)
    • Line 62: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 69: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 75: warning: comment on exported method Client.ListenAndServe should be of the form "ListenAndServe ..." (golint)
    • wssocks/cmd/client/client.go
    • Line 19: warning: exported const CommandNameClient should have comment or be unexported (golint)
    • Line 78: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • wssocks/wss/buffered_reader_writer.go
    • Line 10: warning: exported type BufferedWR should have comment or be unexported (golint)
    • Line 18: warning: exported method BufferedWR.Close should have comment or be unexported (golint)
    • Line 71: warning: exported function NewBufferWR should have comment or be unexported (golint)
    • wssocks/wss/websocket_client.go
    • Line 25: warning: comment on exported method WebSocketClient.ConnSize should be of the form "ConnSize ..." (golint)
    • Line 32: warning: comment on exported function NewWebSocketClient should be of the form "NewWebSocketClient ..." (golint)
    • Line 48: warning: comment on exported method WebSocketClient.NewProxy should be of the form "NewProxy ..." (golint)
    • Line 61: warning: exported method WebSocketClient.GetProxyById should have comment or be unexported (golint)
    • Line 70: warning: comment on exported method WebSocketClient.TellClose should be of the form "TellClose ..." (golint)
    • Line 86: warning: comment on exported method WebSocketClient.RemoveProxy should be of the form "RemoveProxy ..." (golint)
    • Line 95: warning: comment on exported method WebSocketClient.ListenIncomeMsg should be of the form "ListenIncomeMsg ..." (golint)
    • Line 151: warning: exported method WebSocketClient.Close should have comment or be unexported (golint)
    • wssocks/wss/term_view/log.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 12: warning: exported type ProgressLog should have comment or be unexported (golint)
    • Line 17: warning: exported function NewPLog should have comment or be unexported (golint)
    • Line 25: warning: comment on exported method ProgressLog.SetLogBuffer should be of the form "SetLogBuffer ..." (golint)
    • wssocks/client/client.go
    • Line 21: warning: exported function NewHttpClient should have comment or be unexported (golint)
    • Line 43: warning: exported type Options should have comment or be unexported (golint)
    • Line 53: warning: exported type Handles should have comment or be unexported (golint)
    • Line 62: warning: exported function NewClientHandles should have comment or be unexported (golint)
    • Line 66: warning: comment on exported method Handles.NotifyClose should be of the form "NotifyClose ..." (golint)
    • Line 90: warning: comment on exported method Handles.CreateServerConn should be of the form "CreateServerConn ..." (golint)
    • Line 91: warning: context.Context should be the first parameter of a function (golint)
    • Line 131: warning: exported method Handles.NegotiateVersion should have comment or be unexported (golint)
    • Line 135: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 161: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 173: warning: exported method Handles.StartClient should have comment or be unexported (golint)
    • Line 270: warning: exported method Handles.Wait should have comment or be unexported (golint)
    • wssocks/wss/hub_collection.go
    • Line 18: warning: exported function NewHubCollection should have comment or be unexported (golint)
    • Line 24: warning: comment on exported method HubCollection.NewHub should be of the form "NewHub ..." (golint)
    • Line 39: warning: comment on exported method HubCollection.GetConnCount should be of the form "GetConnCount ..." (golint)
    • Line 52: warning: comment on exported method HubCollection.RemoveProxy should be of the form "RemoveProxy ..." (golint)
    • wssocks/wss/proxy_client.go
    • Line 14: warning: exported const TagData should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: comment on exported type ProxyClient should be of the form "ProxyClient ..." (with optional leading article) (golint)
    • Line 28: warning: exported type ServerData should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method ProxyClient.Establish should be of the form "Establish ..." (golint)
    • wssocks/wss/proxy_client_http.go
    • Line 15: warning: exported type HttpClient should have comment or be unexported (golint)
    • Line 20: warning: exported function NewHttpProxy should have comment or be unexported (golint)
    • Line 129: warning: exported method HttpClient.ProxyType should have comment or be unexported (golint)
    • wssocks/wss/version.go
    • Line 9: warning: comment on exported const VersionCode should be of the form "VersionCode ..." (golint)
    • Line 11: warning: exported const CompVersion should have comment or be unexported (golint)
    • Line 12: warning: exported const CoreVersion should have comment or be unexported (golint)
    • Line 14: warning: exported type VersionNeg should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function ExchangeVersion should be of the form "ExchangeVersion ..." (golint)
    • Line 36: warning: comment on exported function NegVersionServer should be of the form "NegVersionServer ..." (golint)
    • wssocks/wss/ws_datatypes.go
    • Line 11: warning: exported const WsTpVer should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: comment on exported type Base64WSBufferWriter should be of the form "Base64WSBufferWriter ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported method Base64WSBufferWriter.Flush should be of the form "Flush ..." (golint)
    • Line 53: warning: exported type WebSocketMessage should have comment or be unexported (golint)
    • Line 59: warning: comment on exported type ProxyData should be of the form "ProxyData ..." (with optional leading article) (golint)
    • Line 68: warning: comment on exported type ProxyEstMessage should be of the form "ProxyEstMessage ..." (with optional leading article) (golint)
    • wssocks/wss/wssocks_server.go
    • Line 11: warning: exported type WebsocksServerConfig should have comment or be unexported (golint)
    • Line 18: warning: exported type ServerWS should have comment or be unexported (golint)
    • Line 23: warning: comment on exported function NewServeWS should be of the form "NewServeWS ..." (golint)
    • wssocks/wss/http_utils.go
    • Line 10: warning: exported function HttpRequestHeader should have comment or be unexported (golint)
    • Line 22: warning: exported function HttpRespHeader should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!