Preparing report...

Report for github.com/Ehco1996/ehco

A    Great!    Found 18 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!


gocyclo100%

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.

No problems detected. Good job!


golint10%

Golint is a linter for Go source code.

    • ehco/internal/config/config.go
    • Line 13: warning: exported type RelayConfig should have comment or be unexported (golint)
    • Line 22: warning: exported type JsonConfig should have comment or be unexported (golint)
    • Line 25: warning: exported type Config should have comment or be unexported (golint)
    • Line 30: warning: exported function NewConfigByPath should have comment or be unexported (golint)
    • Line 34: warning: exported method Config.LoadConfig should have comment or be unexported (golint)
    • ehco/internal/relay/relay.go
    • Line 19: warning: exported type Relay should have comment or be unexported (golint)
    • Line 31: warning: exported function NewRelay should have comment or be unexported (golint)
    • Line 58: warning: exported method Relay.ListenAndServe should have comment or be unexported (golint)
    • Line 88: warning: exported method Relay.LogRelay should have comment or be unexported (golint)
    • Line 93: warning: exported method Relay.RunLocalTCPServer should have comment or be unexported (golint)
    • Line 113: warning: exported method Relay.RunLocalUDPServer should have comment or be unexported (golint)
    • Line 139: warning: exported method Relay.RunLocalWSServer should have comment or be unexported (golint)
    • Line 158: warning: exported method Relay.RunLocalWSSServer should have comment or be unexported (golint)
    • Line 179: warning: exported method Relay.RunLocalMWSSServer should have comment or be unexported (golint)
    • ehco/internal/web/server.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 18: warning: exported function Index should have comment or be unexported (golint)
    • Line 23: warning: exported function Welcome should have comment or be unexported (golint)
    • Line 27: warning: exported function AttachProfiler should have comment or be unexported (golint)
    • Line 71: warning: exported function StartWebServer should have comment or be unexported (golint)
    • ehco/internal/transporter/conn.go
    • Line 22: warning: exported function NewMWSSTransporter should have comment or be unexported (golint)
    • Line 96: warning: exported type MWSSServer should have comment or be unexported (golint)
    • Line 102: warning: exported function NewMWSSServer should have comment or be unexported (golint)
    • Line 109: warning: exported method MWSSServer.Upgrade should have comment or be unexported (golint)
    • Line 146: warning: exported method MWSSServer.Accept should have comment or be unexported (golint)
    • Line 154: warning: exported method MWSSServer.Close should have comment or be unexported (golint)
    • ehco/internal/transporter/ws.go
    • Line 12: warning: exported type Ws should have comment or be unexported (golint)
    • Line 16: warning: exported method Ws.GetOrCreateBufferCh should have comment or be unexported (golint)
    • Line 20: warning: exported method Ws.HandleUDPConn should have comment or be unexported (golint)
    • Line 24: warning: exported method Ws.HandleTCPConn should have comment or be unexported (golint)
    • ehco/internal/constant/constant.go
    • Line 6: warning: exported const Version should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: don't use underscores in Go names; const Listen_RAW should be ListenRAW (golint)
    • Line 13: warning: don't use underscores in Go names; const Listen_WS should be ListenWS (golint)
    • Line 14: warning: don't use underscores in Go names; const Listen_WSS should be ListenWSS (golint)
    • Line 15: warning: don't use underscores in Go names; const Listen_MWSS should be ListenMWSS (golint)
    • Line 17: warning: don't use underscores in Go names; const Transport_RAW should be TransportRAW (golint)
    • Line 18: warning: don't use underscores in Go names; const Transport_WS should be TransportWS (golint)
    • Line 19: warning: don't use underscores in Go names; const Transport_WSS should be TransportWSS (golint)
    • Line 20: warning: don't use underscores in Go names; const Transport_MWSS should be TransportMWSS (golint)
    • ehco/test/echo.go
    • Line 38: warning: exported function ServeTcp should have comment or be unexported (golint)
    • Line 48: warning: exported function ServeUdp should have comment or be unexported (golint)
    • Line 63: warning: exported function RunEchoServer should have comment or be unexported (golint)
    • Line 100: warning: exported function SendTcpMsg should have comment or be unexported (golint)
    • Line 116: warning: exported function SendUdpMsg should have comment or be unexported (golint)
    • ehco/internal/web/ping_metrics.go
    • Line 43: warning: exported var PingResponseDurationSeconds should have comment or be unexported (golint)
    • Line 62: warning: exported type PingGroup should have comment or be unexported (golint)
    • Line 83: warning: exported function NewPingGroup should have comment or be unexported (golint)
    • Line 127: warning: exported method PingGroup.Describe should have comment or be unexported (golint)
    • Line 131: warning: exported method PingGroup.Collect should have comment or be unexported (golint)
    • Line 145: warning: exported method PingGroup.Run should have comment or be unexported (golint)
    • ehco/cmd/ehco/main.go
    • Line 18: warning: exported var LocalAddr should have comment or be unexported (golint)
    • Line 19: warning: exported var ListenType should have comment or be unexported (golint)
    • Line 20: warning: exported var RemoteAddr should have comment or be unexported (golint)
    • Line 21: warning: exported var UDPRemoteAddr should have comment or be unexported (golint)
    • Line 22: warning: exported var TransportType should have comment or be unexported (golint)
    • Line 23: warning: exported var ConfigPath should have comment or be unexported (golint)
    • Line 24: warning: exported var WebfPort should have comment or be unexported (golint)
    • Line 25: warning: exported var WebToken should have comment or be unexported (golint)
    • Line 26: warning: exported var SystemFilePath should have comment or be unexported (golint)
    • Line 28: warning: exported const SystemDTMPL should have comment or be unexported (golint)
    • ehco/internal/transporter/buffer.go
    • Line 16: warning: exported var OutboundBufferPool should have its own declaration (golint)
    • Line 23: warning: exported function NewBufferPool should have comment or be unexported (golint)
    • Line 112: warning: exported type BufferCh should have comment or be unexported (golint)
    • ehco/internal/transporter/picker.go
    • Line 10: warning: comment on exported type RelayTransporter should be of the form "RelayTransporter ..." (with optional leading article) (golint)
    • Line 21: warning: exported function PickTransporter should have comment or be unexported (golint)
    • ehco/internal/transporter/mwss.go
    • Line 10: warning: exported type Mwss should have comment or be unexported (golint)
    • Line 15: warning: exported method Mwss.GetOrCreateBufferCh should have comment or be unexported (golint)
    • Line 19: warning: exported method Mwss.HandleUDPConn should have comment or be unexported (golint)
    • Line 23: warning: exported method Mwss.HandleTCPConn should have comment or be unexported (golint)
    • ehco/internal/transporter/raw.go
    • Line 16: warning: exported type Raw should have comment or be unexported (golint)
    • Line 23: warning: exported method Raw.GetOrCreateBufferCh should have comment or be unexported (golint)
    • Line 35: warning: exported method Raw.HandleUDPConn should have comment or be unexported (golint)
    • Line 92: warning: exported method Raw.HandleTCPConn should have comment or be unexported (golint)
    • Line 108: warning: exported method Raw.HandleWsRequset should have comment or be unexported (golint)
    • Line 131: warning: exported method Raw.HandleWssRequset should have comment or be unexported (golint)
    • Line 154: warning: exported method Raw.HandleMWssRequset should have comment or be unexported (golint)
    • ehco/internal/transporter/wss.go
    • Line 13: warning: exported type Wss should have comment or be unexported (golint)
    • Line 17: warning: exported method Wss.GetOrCreateBufferCh should have comment or be unexported (golint)
    • Line 21: warning: exported method Wss.HandleUDPConn should have comment or be unexported (golint)
    • Line 25: warning: exported method Wss.HandleTCPConn should have comment or be unexported (golint)
    • ehco/internal/logger/logger.go
    • Line 10: warning: exported var Logger should have comment or be unexported (golint)
    • Line 31: warning: exported function Info should have comment or be unexported (golint)
    • Line 35: warning: exported function Fatal should have comment or be unexported (golint)
    • Line 39: warning: exported function Infof should have comment or be unexported (golint)
    • Line 43: warning: exported function Fatalf should have comment or be unexported (golint)
    • Line 47: warning: exported function Errorf should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!