kubenetworks/kubevpn

View on GitHub
pkg/util/portforward.go

Summary

Maintainability
A
3 hrs
Test Coverage

Method PortForwarder.handleConnection has 67 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (pf *PortForwarder) handleConnection(conn net.Conn, port ForwardedPort) {
    defer conn.Close()

    if pf.out != nil {
        fmt.Fprintf(pf.out, "Handling connection for %d\n", port.Local)
Severity: Minor
Found in pkg/util/portforward.go - About 1 hr to fix

    Function NewOnAddresses has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) {
    Severity: Minor
    Found in pkg/util/portforward.go - About 45 mins to fix

      Function NewOnAddresses has 5 return statements (exceeds 4 allowed).
      Open

      func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) {
          if len(addresses) == 0 {
              return nil, errors.New("you must specify at least 1 address")
          }
          parsedAddresses, err := parseAddresses(addresses)
      Severity: Major
      Found in pkg/util/portforward.go - About 35 mins to fix

        Function parsePorts has 5 return statements (exceeds 4 allowed).
        Open

        func parsePorts(ports []string) ([]ForwardedPort, error) {
            var forwards []ForwardedPort
            for _, portString := range ports {
                parts := strings.Split(portString, ":")
                var localString, remoteString string
        Severity: Major
        Found in pkg/util/portforward.go - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status