Preparing report...

Report for github.com/kobehaha/tcp-proxy-system

B    Not bad!    Found 15 issues across 15 files

Tweet

gofmt53%

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!


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!


golint0%

Golint is a linter for Go source code.

    • tcp-proxy-system/proxy/strategy/strategy.go
    • Line 4: warning: exported const PollName should have comment (or a comment on this block) or be unexported (golint)
    • Line 11: warning: comment on exported type Strategy should be of the form "Strategy ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported function GetStrategy should be of the form "GetStrategy ..." (golint)
    • tcp-proxy-system/server/server.go
    • Line 19: warning: comment on exported type ProxyServer should be of the form "ProxyServer ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported method ProxyServer.Init should be of the form "Init ..." (golint)
    • Line 51: warning: comment on exported method ProxyServer.LoadConfg should be of the form "LoadConfg ..." (golint)
    • Line 57: warning: comment on exported method ProxyServer.Address should be of the form "Address ..." (golint)
    • Line 63: warning: comment on exported method ProxyServer.Start should be of the form "Start ..." (golint)
    • Line 90: warning: comment on exported method ProxyServer.Stop should be of the form "Stop ..." (golint)
    • Line 99: warning: comment on exported method ProxyServer.WatchStopSignal should be of the form "WatchStopSignal ..." (golint)
    • Line 102: warning: don't use underscores in Go names; var signal_channel should be signalChannel (golint)
    • tcp-proxy-system/proxy/proxy.go
    • Line 8: warning: comment on exported type Proxy should be of the form "Proxy ..." (with optional leading article) (golint)
    • Line 12: warning: don't use underscores in Go names; interface method parameter request_size should be requestSize (golint)
    • tcp-proxy-system/config/config.go
    • Line 11: warning: exported const DefaultHost should have comment (or a comment on this block) or be unexported (golint)
    • Line 21: warning: comment on exported type Config should be of the form "Config ..." (with optional leading article) (golint)
    • Line 37: warning: comment on exported function Load should be of the form "Load ..." (golint)
    • tcp-proxy-system/util/util.go
    • Line 11: warning: comment on exported function HostPortToAddress should be of the form "HostPortToAddress ..." (golint)
    • Line 17: warning: comment on exported function SliceIndex should be of the form "SliceIndex ..." (golint)
    • Line 38: warning: comment on exported function DefaultPath should be of the form "DefaultPath ..." (golint)
    • Line 48: warning: comment on exported function UrlToHost should be of the form "UrlToHost ..." (golint)
    • Line 54: warning: comment on exported function IP4ToInt should be of the form "IP4ToInt ..." (golint)
    • tcp-proxy-system/system/backend.go
    • Line 5: warning: comment on exported type Backend should be of the form "Backend ..." (with optional leading article) (golint)
    • Line 12: warning: comment on exported method Backend.Url should be of the form "Url ..." (golint)
    • tcp-proxy-system/system/system.go
    • Line 5: warning: comment on exported const ChannelPairNum should be of the form "ChannelPairNum ..." (golint)
    • Line 12: warning: exported type Channel should have comment or be unexported (golint)
    • Line 17: warning: comment on exported method Channel.SrcUrl should be of the form "SrcUrl ..." (golint)
    • Line 23: warning: comment on exported method Channel.DstUrl should be of the form "DstUrl ..." (golint)
    • Line 29: warning: comment on exported method Channel.Close should be of the form "Close ..." (golint)
    • tcp-proxy-system/system/channelManager.go
    • Line 8: warning: comment on exported type ChannelManager should be of the form "ChannelManager ..." (with optional leading article) (golint)
    • Line 19: warning: comment on exported method ChannelManager.Init should be of the form "Init ..." (golint)
    • Line 29: warning: comment on exported method ChannelManager.GetChannelsLen should be of the form "GetChannelsLen ..." (golint)
    • Line 44: warning: comment on exported method ChannelManager.Clean should be of the form "Clean ..." (golint)
    • Line 55: warning: comment on exported method ChannelManager.Put should be of the form "Put ..." (golint)
    • Line 65: warning: comment on exported method ChannelManager.Delete should be of the form "Delete ..." (golint)
    • Line 80: warning: comment on exported method ChannelManager.GetChannels should be of the form "GetChannels ..." (golint)
    • tcp-proxy-system/proxy/proxy_tcp.go
    • Line 14: warning: exported const DefaultTimeoutTime should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: comment on exported type TcpProxy should be of the form "TcpProxy ..." (with optional leading article) (golint)
    • Line 25: warning: comment on exported method TcpProxy.Init should be of the form "Init ..." (golint)
    • Line 47: warning: comment on exported method TcpProxy.Dispatch should be of the form "Dispatch ..." (golint)
    • Line 149: warning: comment on exported method TcpProxy.Check should be of the form "Check ..." (golint)
    • tcp-proxy-system/proxy/strategy/iphash.go
    • Line 7: warning: exported type IpHash should have comment or be unexported (golint)
    • Line 10: warning: comment on exported method IpHash.Init should be of the form "Init ..." (golint)
    • Line 15: warning: comment on exported method IpHash.Choose should be of the form "Choose ..." (golint)
    • tcp-proxy-system/proxy/strategy/random.go
    • Line 7: warning: comment on exported type Random should be of the form "Random ..." (with optional leading article) (golint)
    • Line 12: warning: exported method Random.Init should have comment or be unexported (golint)
    • Line 14: warning: comment on exported method Random.Choose should be of the form "Choose ..." (golint)
    • tcp-proxy-system/proxy/proxy_data.go
    • Line 9: warning: comment on exported type ProxyData should be of the form "ProxyData ..." (with optional leading article) (golint)
    • Line 21: warning: comment on exported method ProxyData.Init should be of the form "Init ..." (golint)
    • Line 50: warning: comment on exported method ProxyData.BackendUrls should be of the form "BackendUrls ..." (golint)
    • Line 63: warning: comment on exported method ProxyData.Clear should be of the form "Clear ..." (golint)
    • Line 73: warning: comment on exported method ProxyData.Recover should be of the form "Recover ..." (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!


misspell80%

Misspell Finds commonly misspelled English words