Preparing report...

Report for github.com/datastax/cql-proxy

A+    Excellent!    Found 24 issues across 37 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!


gocyclo94%

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.


golint37%

Golint is a linter for Go source code.

    • cql-proxy/parser/parser.go
    • Line 28: warning: exported const CountValueName should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported type AliasSelector should have comment or be unexported (golint)
    • Line 38: warning: exported type IDSelector should have comment or be unexported (golint)
    • Line 42: warning: exported type StarSelector should have comment or be unexported (golint)
    • Line 44: warning: exported type CountStarSelector should have comment or be unexported (golint)
    • Line 48: warning: exported type ErrorSelectStatement should have comment or be unexported (golint)
    • Line 52: warning: exported type SelectStatement should have comment or be unexported (golint)
    • Line 57: warning: exported type UseStatement should have comment or be unexported (golint)
    • Line 61: warning: exported type ValueLookupFunc should have comment or be unexported (golint)
    • Line 63: warning: exported function Parse should have comment or be unexported (golint)
    • Line 73: warning: exported function FilterValues should have comment or be unexported (golint)
    • Line 109: warning: exported function FilterColumns should have comment or be unexported (golint)
    • Line 130: warning: exported function IsCountStarQuery should have comment or be unexported (golint)
    • Line 153: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • cql-proxy/proxy/proxy_test.go
    • Line 48: 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)
    • cql-proxy/proxycore/cluster.go
    • Line 30: warning: exported const DefaultRefreshWindow should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported type AddEvent should have comment or be unexported (golint)
    • Line 39: warning: exported type RemoveEvent should have comment or be unexported (golint)
    • Line 43: warning: exported type BootstrapEvent should have comment or be unexported (golint)
    • Line 47: warning: exported type SchemaChangeEvent should have comment or be unexported (golint)
    • Line 51: warning: exported type ReconnectEvent should have comment or be unexported (golint)
    • Line 55: warning: exported type ClusterListener should have comment or be unexported (golint)
    • Line 59: warning: exported type ClusterListenerFunc should have comment or be unexported (golint)
    • Line 61: warning: exported method ClusterListenerFunc.OnEvent should have comment or be unexported (golint)
    • Line 65: warning: exported type ClusterConfig should have comment or be unexported (golint)
    • Line 76: warning: exported type ClusterInfo should have comment or be unexported (golint)
    • Line 82: warning: exported type Cluster should have comment or be unexported (golint)
    • Line 98: warning: exported function ConnectCluster should have comment or be unexported (golint)
    • Line 137: warning: exported method Cluster.Listen should have comment or be unexported (golint)
    • Line 146: warning: exported method Cluster.OnEvent should have comment or be unexported (golint)
    • Line 312: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • cql-proxy/proxycore/lb.go
    • Line 22: warning: exported type QueryPlan should have comment or be unexported (golint)
    • Line 26: warning: exported type LoadBalancer should have comment or be unexported (golint)
    • Line 31: warning: exported function NewRoundRobinLoadBalancer should have comment or be unexported (golint)
    • cql-proxy/proxycore/reconnpolicy.go
    • Line 28: warning: exported type ReconnectPolicy should have comment or be unexported (golint)
    • Line 41: warning: exported function NewReconnectPolicy should have comment or be unexported (golint)
    • Line 45: warning: exported function NewReconnectPolicyWithDelays should have comment or be unexported (golint)
    • cql-proxy/proxy/proxy.go
    • Line 41: warning: exported type Config should have comment or be unexported (golint)
    • Line 50: warning: exported type Proxy should have comment or be unexported (golint)
    • Line 64: warning: exported method Proxy.OnEvent should have comment or be unexported (golint)
    • Line 86: warning: exported function NewProxy should have comment or be unexported (golint)
    • Line 97: warning: exported method Proxy.ListenAndServe should have comment or be unexported (golint)
    • Line 105: warning: exported method Proxy.Listen should have comment or be unexported (golint)
    • Line 155: warning: exported method Proxy.Serve should have comment or be unexported (golint)
    • cql-proxy/proxycore/auth.go
    • Line 22: warning: exported type Authenticator should have comment or be unexported (golint)
    • Line 65: warning: exported function NewPasswordAuth should have comment or be unexported (golint)
    • cql-proxy/parser/metadata.go
    • Line 23: warning: exported var SystemLocalColumns should have comment or be unexported (golint)
    • Line 150: warning: exported function FindColumnMetadata should have comment or be unexported (golint)
    • cql-proxy/proxycore/conn.go
    • Line 28: warning: error var Closed should have name of the form ErrFoo (golint)
    • Line 28: warning: exported var Closed should have comment or be unexported (golint)
    • Line 29: warning: error var AlreadyClosed should have name of the form ErrFoo (golint)
    • Line 33: warning: exported const MaxMessages should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported type Conn should have comment or be unexported (golint)
    • Line 47: warning: exported type Receiver should have comment or be unexported (golint)
    • Line 52: warning: exported type Sender should have comment or be unexported (golint)
    • Line 56: warning: exported type SenderFunc should have comment or be unexported (golint)
    • Line 58: warning: exported method SenderFunc.Send should have comment or be unexported (golint)
    • Line 62: warning: exported function Connect should have comment or be unexported (golint)
    • Line 92: warning: exported function NewConn should have comment or be unexported (golint)
    • Line 103: warning: exported method Conn.Start should have comment or be unexported (golint)
    • Line 145: warning: exported method Conn.WriteBytes should have comment or be unexported (golint)
    • Line 175: warning: exported method Conn.Close should have comment or be unexported (golint)
    • Line 186: warning: exported method Conn.Err should have comment or be unexported (golint)
    • Line 193: warning: exported method Conn.IsClosed should have comment or be unexported (golint)
    • Line 197: warning: exported method Conn.LocalAddr should have comment or be unexported (golint)
    • Line 201: warning: exported method Conn.RemoteAddr should have comment or be unexported (golint)
    • cql-proxy/proxycore/host.go
    • Line 17: warning: exported type Host should have comment or be unexported (golint)
    • Line 21: warning: exported function NewHostFromRow should have comment or be unexported (golint)
    • Line 25: warning: exported method Host.Endpoint should have comment or be unexported (golint)
    • Line 29: warning: exported method Host.Key should have comment or be unexported (golint)
    • cql-proxy/proxycore/mockcluster.go
    • Line 41: warning: exported type MockHost should have comment or be unexported (golint)
    • Line 55: warning: exported type MockRequestHandler should have comment or be unexported (golint)
    • Line 57: warning: exported function MockDefaultOptionsHandler should have comment or be unexported (golint)
    • Line 61: warning: exported function MockDefaultStartupHandler should have comment or be unexported (golint)
    • Line 65: warning: exported function MockDefaultRegisterHandler should have comment or be unexported (golint)
    • Line 70: warning: exported function MockDefaultQueryHandler should have comment or be unexported (golint)
    • Line 73: 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 83: warning: exported type MockRequestHandlers should have comment or be unexported (golint)
    • Line 85: warning: exported var DefaultMockRequestHandlers should have comment or be unexported (golint)
    • Line 92: warning: exported function NewMockRequestHandlers should have comment or be unexported (golint)
    • Line 103: warning: exported type MockClient should have comment or be unexported (golint)
    • Line 120: warning: exported method MockClient.Register should have comment or be unexported (golint)
    • Line 124: warning: exported method MockClient.Keyspace should have comment or be unexported (golint)
    • Line 128: warning: exported method MockClient.Local should have comment or be unexported (golint)
    • Line 132: warning: exported method MockClient.Receive should have comment or be unexported (golint)
    • Line 168: warning: exported method MockClient.InterceptQuery should have comment or be unexported (golint)
    • Line 192: 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 199: 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 232: warning: exported method MockClient.Closing should have comment or be unexported (golint)
    • Line 236: warning: exported type MockServer should have comment or be unexported (golint)
    • Line 247: warning: exported method MockServer.Add should have comment or be unexported (golint)
    • Line 268: warning: exported method MockServer.Remove should have comment or be unexported (golint)
    • Line 284: warning: exported method MockServer.Event should have comment or be unexported (golint)
    • Line 300: warning: exported method MockServer.Serve should have comment or be unexported (golint)
    • Line 380: warning: exported type MockCluster should have comment or be unexported (golint)
    • Line 389: warning: exported function NewMockCluster should have comment or be unexported (golint)
    • Line 409: warning: exported method MockCluster.Add should have comment or be unexported (golint)
    • Line 440: warning: exported method MockCluster.Start should have comment or be unexported (golint)
    • Line 444: warning: exported method MockCluster.Remove should have comment or be unexported (golint)
    • Line 464: warning: exported method MockCluster.Stop should have comment or be unexported (golint)
    • cql-proxy/astra/bundle.go
    • Line 28: warning: exported type Bundle should have comment or be unexported (golint)
    • Line 34: warning: exported function LoadBundleZip should have comment or be unexported (golint)
    • Line 75: warning: exported function LoadBundleZipFromPath should have comment or be unexported (golint)
    • Line 88: warning: exported method Bundle.Host should have comment or be unexported (golint)
    • Line 92: warning: exported method Bundle.Port should have comment or be unexported (golint)
    • Line 96: warning: exported method Bundle.TLSConfig should have comment or be unexported (golint)
    • cql-proxy/astra/bundle_test.go
    • Line 306: 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)
    • cql-proxy/proxycore/clientconn.go
    • Line 30: warning: exported const MaxStreams should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported type EventHandler should have comment or be unexported (golint)
    • Line 39: warning: exported type EventHandlerFunc should have comment or be unexported (golint)
    • Line 41: warning: exported method EventHandlerFunc.OnEvent should have comment or be unexported (golint)
    • Line 45: warning: exported type ClientConn should have comment or be unexported (golint)
    • Line 52: warning: exported function ConnectClient should have comment or be unexported (golint)
    • Line 56: warning: exported function ConnectClientWithEvents should have comment or be unexported (golint)
    • Line 70: warning: exported method ClientConn.Handshake should have comment or be unexported (golint)
    • Line 186: warning: exported method ClientConn.Inflight should have comment or be unexported (golint)
    • Line 190: warning: exported method ClientConn.Query should have comment or be unexported (golint)
    • Line 211: warning: exported method ClientConn.SetKeyspace should have comment or be unexported (golint)
    • Line 232: warning: exported method ClientConn.Receive should have comment or be unexported (golint)
    • Line 258: warning: exported method ClientConn.Closing should have comment or be unexported (golint)
    • Line 262: warning: exported method ClientConn.Send should have comment or be unexported (golint)
    • Line 273: warning: exported method ClientConn.SendAndReceive should have comment or be unexported (golint)
    • Line 295: warning: exported method ClientConn.Close should have comment or be unexported (golint)
    • Line 299: warning: exported method ClientConn.IsClosed should have comment or be unexported (golint)
    • Line 303: warning: exported method ClientConn.Err should have comment or be unexported (golint)
    • cql-proxy/proxycore/clientconn_test.go
    • Line 237: 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 286: 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)
    • cql-proxy/proxycore/codecs.go
    • Line 46: warning: exported function EncodeType should have comment or be unexported (golint)
    • Line 54: warning: exported function DecodeType should have comment or be unexported (golint)
    • cql-proxy/proxycore/endpoint.go
    • Line 26: warning: exported type Endpoint should have comment or be unexported (golint)
    • Line 58: warning: exported type EndpointResolver should have comment or be unexported (golint)
    • Line 68: warning: exported function NewEndpoint should have comment or be unexported (golint)
    • Line 72: warning: exported function NewResolver should have comment or be unexported (golint)
    • Line 76: warning: exported function NewResolverWithDefaultPort should have comment or be unexported (golint)
    • Line 127: warning: exported function LookupEndpoint should have comment or be unexported (golint)
    • Line 130: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • cql-proxy/proxycore/errors.go
    • Line 27: warning: error var StreamsExhausted should have name of the form ErrFoo (golint)
    • Line 27: warning: exported var StreamsExhausted should have comment or be unexported (golint)
    • Line 28: warning: error var AuthExpected should have name of the form ErrFoo (golint)
    • Line 29: warning: error var ProtocolNotSupported should have name of the form ErrFoo (golint)
    • Line 32: warning: exported type UnexpectedResponse should have comment or be unexported (golint)
    • Line 41: warning: exported type CqlError should have comment or be unexported (golint)
    • cql-proxy/proxycore/resultset.go
    • Line 24: warning: error var ColumnNameNotFound should have name of the form ErrFoo (golint)
    • Line 24: warning: exported var ColumnNameNotFound should have comment or be unexported (golint)
    • Line 27: warning: exported type ResultSet should have comment or be unexported (golint)
    • Line 33: warning: exported type Row should have comment or be unexported (golint)
    • Line 38: warning: exported function NewResultSet should have comment or be unexported (golint)
    • Line 50: warning: exported method ResultSet.Row should have comment or be unexported (golint)
    • Line 56: warning: exported method ResultSet.RowCount should have comment or be unexported (golint)
    • Line 60: warning: exported method Row.ByPos should have comment or be unexported (golint)
    • Line 68: warning: exported method Row.ByName should have comment or be unexported (golint)
    • Line 71: 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)
    • cql-proxy/proxycore/session.go
    • Line 27: warning: error var NoConnForHost should have name of the form ErrFoo (golint)
    • Line 27: warning: exported var NoConnForHost should have comment or be unexported (golint)
    • Line 30: warning: exported type SessionConfig should have comment or be unexported (golint)
    • Line 40: warning: exported type Session should have comment or be unexported (golint)
    • Line 49: warning: exported function ConnectSession should have comment or be unexported (golint)
    • Line 74: warning: exported method Session.Send should have comment or be unexported (golint)
    • Line 90: warning: exported method Session.OnEvent should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.

    • cql-proxy/parser/parser.go
    • Line 18: warning: package cql-proxy/proxycore/antlr is not in GOROOT (/usr/local/go/src/cql-proxy/proxycore/antlr) (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)
    • Line 69: warning: cannot use listener (variable of type *queryListener) as "github.com/antlr/antlr4/runtime/Go/antlr".ParseTreeListener value in argument to antlr.ParseTreeWalkerDefault.Walk: missing method EnterEveryRule (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)
    • Line 69: warning: cannot use listener (variable of type *queryListener) as "github.com/antlr/antlr4/runtime/Go/antlr".ParseTreeListener value in argument to antlr.ParseTreeWalkerDefault.Walk: missing method EnterEveryRule (ineffassign)
    • Line 18: warning: package cql-proxy/proxycore/antlr is not in GOROOT (/usr/local/go/src/cql-proxy/proxycore/antlr) (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)
    • /home/shawn/mygo/src/github.com/gojp/goreportcard/_repos/src/github.com/datastax/cql-proxy/parser/parser.go
    • Line 18: warning: package cql-proxy/proxycore/antlr is not in GOROOT (/usr/local/go/src/cql-proxy/proxycore/antlr) (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)
    • Line 18: warning: package cql-proxy/proxycore/antlr is not in GOROOT (/usr/local/go/src/cql-proxy/proxycore/antlr) (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)
    • Line 18: warning: package cql-proxy/proxycore/antlr is not in GOROOT (/usr/local/go/src/cql-proxy/proxycore/antlr) (ineffassign)
    • Line 18: warning: could not import cql-proxy/proxycore/antlr (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!