kubenetworks/kubevpn

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

Summary

Maintainability
C
7 hrs
Test Coverage

Method Server.Connect has 93 lines of code (exceeds 50 allowed). Consider refactoring.
Open

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

    Method Server.redirectToSudoDaemon has 83 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

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

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

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

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

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

          There are no issues that match your filters.

          Category
          Status