kubenetworks/kubevpn

View on GitHub
pkg/daemon/action/connect-fork.go

Summary

Maintainability
B
6 hrs
Test Coverage

Method Server.redirectConnectForkToSudoDaemon has 81 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (svr *Server) redirectConnectForkToSudoDaemon(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectServer) (err error) {
    cli := svr.GetClient(true)
    if cli == nil {
        return fmt.Errorf("sudo daemon not start")
    }
Severity: Major
Found in pkg/daemon/action/connect-fork.go - About 2 hrs to fix

    Method Server.ConnectFork has 79 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func (svr *Server) ConnectFork(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectForkServer) (err error) {
        defer func() {
            util.InitLoggerForServer(true)
            log.SetOutput(svr.LogFile)
            config.Debug = false
    Severity: Major
    Found in pkg/daemon/action/connect-fork.go - About 2 hrs to fix

      Method Server.redirectConnectForkToSudoDaemon has 13 return statements (exceeds 4 allowed).
      Open

      func (svr *Server) redirectConnectForkToSudoDaemon(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectServer) (err error) {
          cli := svr.GetClient(true)
          if cli == nil {
              return fmt.Errorf("sudo daemon not start")
          }
      Severity: Major
      Found in pkg/daemon/action/connect-fork.go - About 1 hr to fix

        Method Server.ConnectFork has 11 return statements (exceeds 4 allowed).
        Open

        func (svr *Server) ConnectFork(req *rpc.ConnectRequest, resp rpc.Daemon_ConnectForkServer) (err error) {
            defer func() {
                util.InitLoggerForServer(true)
                log.SetOutput(svr.LogFile)
                config.Debug = false
        Severity: Major
        Found in pkg/daemon/action/connect-fork.go - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status