kubenetworks/kubevpn

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

Summary

Maintainability
B
4 hrs
Test Coverage

Method Server.Clone has 101 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func (svr *Server) Clone(req *rpc.CloneRequest, resp rpc.Daemon_CloneServer) (err error) {
    defer func() {
        util.InitLoggerForServer(true)
        log.SetOutput(svr.LogFile)
        config.Debug = false
Severity: Major
Found in pkg/daemon/action/clone.go - About 3 hrs to fix

    Method Server.Clone has 10 return statements (exceeds 4 allowed).
    Open

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

      Avoid deeply nested control flow statements.
      Open

              } else if code := status.Code(err); code == codes.AlreadyExists {
                  return fmt.Errorf("connect with cluster already established, disconnect required before proceeding")
              } else {
                  return err
              }
      Severity: Major
      Found in pkg/daemon/action/clone.go - About 45 mins to fix

        There are no issues that match your filters.

        Category
        Status