Preparing report...

Report for github.com/joaosoft/connector

A    Great!    Found 31 issues across 34 files

Tweet

gofmt94%

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!


gocyclo97%

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.


golint17%

Golint is a linter for Go source code.

    • connector/server_config.go
    • Line 7: warning: exported type ServerConfig should have comment or be unexported (golint)
    • Line 12: warning: exported function NewServerConfig should have comment or be unexported (golint)
    • connector/client_manager.go
    • Line 7: warning: exported type ClientManager should have comment or be unexported (golint)
    • Line 14: warning: exported function NewClientManager should have comment or be unexported (golint)
    • Line 65: warning: exported method ClientManager.Invoke should have comment or be unexported (golint)
    • connector/response.go
    • Line 19: warning: exported method Response.WithBody should have comment or be unexported (golint)
    • Line 29: 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 126: 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)
    • connector/server.go
    • Line 15: warning: exported type Server should have comment or be unexported (golint)
    • Line 28: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 66: warning: exported method Server.AddMiddlewares should have comment or be unexported (golint)
    • Line 70: warning: exported method Server.AddMethod should have comment or be unexported (golint)
    • Line 74: warning: exported method Server.Implement should have comment or be unexported (golint)
    • Line 88: warning: exported method Server.AddMethods should have comment or be unexported (golint)
    • Line 95: warning: exported method Server.SetErrorHandler should have comment or be unexported (golint)
    • Line 151: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 159: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 188: warning: exported method Server.GetMethod should have comment or be unexported (golint)
    • Line 200: warning: exported method Server.Start should have comment or be unexported (golint)
    • Line 248: warning: exported method Server.Started should have comment or be unexported (golint)
    • Line 252: warning: exported method Server.Stop should have comment or be unexported (golint)
    • connector/status.go
    • Line 3: warning: exported type Status should have comment or be unexported (golint)
    • Line 6: warning: exported const StatusOk should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported function StatusText should have comment or be unexported (golint)
    • connector/structs.go
    • Line 9: warning: exported type Headers should have comment or be unexported (golint)
    • Line 11: warning: exported type ErrorHandler should have comment or be unexported (golint)
    • Line 12: warning: exported type HandlerFunc should have comment or be unexported (golint)
    • Line 13: warning: exported type MiddlewareFunc should have comment or be unexported (golint)
    • Line 15: warning: exported type Context should have comment or be unexported (golint)
    • Line 21: warning: exported type Base should have comment or be unexported (golint)
    • Line 31: warning: exported type Request should have comment or be unexported (golint)
    • Line 38: warning: exported type Response should have comment or be unexported (golint)
    • Line 46: warning: exported type RequestHandler should have comment or be unexported (golint)
    • Line 51: warning: exported type Servers should have comment or be unexported (golint)
    • Line 52: warning: exported type Clients should have comment or be unexported (golint)
    • connector/config.go
    • Line 3: warning: exported type AppServerConfig should have comment or be unexported (golint)
    • Line 7: warning: exported type AppClientConfig should have comment or be unexported (golint)
    • Line 11: warning: exported type AppServerManagerConfig should have comment or be unexported (golint)
    • Line 15: warning: exported type AppClientManagerConfig should have comment or be unexported (golint)
    • Line 19: warning: exported type Log should have comment or be unexported (golint)
    • connector/examples/server/main.go
    • Line 28: warning: exported function MyMiddlewareOne should have comment or be unexported (golint)
    • Line 37: warning: exported function MyMiddlewareTwo should have comment or be unexported (golint)
    • Line 46: warning: exported function HandlerSayHello should have comment or be unexported (golint)
    • connector/base.go
    • Line 8: warning: exported method Base.SetHeader should have comment or be unexported (golint)
    • Line 12: warning: exported method Base.GetHeader should have comment or be unexported (golint)
    • Line 19: warning: exported method Base.BindHeaders should have comment or be unexported (golint)
    • connector/client.go
    • Line 12: warning: exported type Client should have comment or be unexported (golint)
    • Line 19: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 52: warning: exported method Client.Invoke should have comment or be unexported (golint)
    • Line 62: warning: exported method Request.Send should have comment or be unexported (golint)
    • Line 66: warning: exported method Client.Send should have comment or be unexported (golint)
    • connector/client_config.go
    • Line 7: warning: exported type ClientConfig should have comment or be unexported (golint)
    • Line 11: warning: exported function NewClientConfig should have comment or be unexported (golint)
    • connector/client_manager_config.go
    • Line 7: warning: exported type ClientManagerConfig should have comment or be unexported (golint)
    • Line 12: warning: exported type ClientService should have comment or be unexported (golint)
    • Line 16: warning: exported function NewClientManagerConfig should have comment or be unexported (golint)
    • connector/consts.go
    • Line 6: warning: exported const HeaderTimeFormat should have comment (or a comment on this block) or be unexported (golint)
    • connector/errors.go
    • Line 8: warning: exported var ErrorMethodNotFound should have comment or be unexported (golint)
    • Line 14: warning: exported method Server.DefaultErrorHandler should have comment or be unexported (golint)
    • connector/server_manager.go
    • Line 12: warning: exported type ServerManager should have comment or be unexported (golint)
    • Line 21: warning: exported function NewServerManager should have comment or be unexported (golint)
    • Line 49: warning: exported method ServerManager.Register should have comment or be unexported (golint)
    • Line 60: warning: exported method ServerManager.Start should have comment or be unexported (golint)
    • Line 81: warning: exported method ServerManager.Started should have comment or be unexported (golint)
    • Line 85: warning: exported method ServerManager.Stop should have comment or be unexported (golint)
    • connector/server_manager_config.go
    • Line 7: warning: exported type ServerManagerConfig should have comment or be unexported (golint)
    • Line 12: warning: exported type ServerService should have comment or be unexported (golint)
    • Line 16: warning: exported function NewServerManagerConfig should have comment or be unexported (golint)
    • connector/headers.go
    • Line 4: warning: comment on exported const HeaderServer should be of the form "HeaderServer ..." (golint)
    • Line 6: warning: exported const HeaderDate should have comment (or a comment on this block) or be unexported (golint)
    • connector/server_methods.go
    • Line 3: warning: exported type Methods should have comment or be unexported (golint)
    • Line 5: warning: exported type Method should have comment or be unexported (golint)
    • Line 12: warning: exported function NewMethod should have comment or be unexported (golint)
    • connector/utils.go
    • Line 23: warning: exported function GetEnv should have comment or be unexported (golint)
    • Line 32: warning: exported function Exists should have comment or be unexported (golint)
    • Line 41: warning: exported function ReadFile should have comment or be unexported (golint)
    • Line 67: warning: exported function ReadFileLines should have comment or be unexported (golint)
    • Line 92: warning: exported function WriteFile should have comment or be unexported (golint)
    • Line 165: warning: exported function GetFunctionName should have comment or be unexported (golint)
    • Line 169: warning: exported function GetMimeType should have comment or be unexported (golint)
    • Line 178: warning: exported function NewSimpleConfig should have comment or be unexported (golint)
    • Line 186: warning: exported function GetFreePort should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign76%

IneffAssign detects ineffectual assignments in Go code.

    • connector/examples/server/main.go
    • Line 4: warning: cannot find package "." in: (ineffassign)
    • Line 5: warning: cannot find package "." in: (ineffassign)
    • Line 4: warning: could not import connector (invalid package name: "") (ineffassign)
    • Line 5: warning: could not import connector/examples/server/impl (invalid package name: "") (ineffassign)
    • connector/client.go
    • Line 8: warning: cannot find package "." in: (ineffassign)
    • Line 9: warning: cannot find package "." in: (ineffassign)
    • Line 8: warning: could not import github.com/joaosoft/color (invalid package name: "") (ineffassign)
    • Line 9: warning: could not import github.com/joaosoft/logger (invalid package name: "") (ineffassign)
    • connector/utils.go
    • Line 20: warning: cannot find package "." in: (ineffassign)
    • Line 20: warning: could not import github.com/joaosoft/errors (invalid package name: "") (ineffassign)

misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!