kubenetworks/kubevpn

View on GitHub

Showing 526 of 526 total issues

Function InitFactory has 6 return statements (exceeds 4 allowed).
Open

func InitFactory(kubeconfigBytes string, ns string) cmdutil.Factory {
    configFlags := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag()
    configFlags.WrapConfigFn = func(c *rest.Config) *rest.Config {
        if path, ok := os.LookupEnv(config.EnvSSHJump); ok {
            bytes, err := os.ReadFile(path)
Severity: Major
Found in pkg/util/ns.go - About 40 mins to fix

    Function DownloadFileWithName has 6 return statements (exceeds 4 allowed).
    Open

    func DownloadFileWithName(uri, name string) (string, error) {
        resp, err := getWithRetry(uri)
        if err != nil {
            return "", err
        }
    Severity: Major
    Found in pkg/util/file.go - About 40 mins to fix

      Function fromPatchToProbe has 6 return statements (exceeds 4 allowed).
      Open

      func fromPatchToProbe(spec *v1.PodTemplateSpec, path []string, patch []P) {
          // 3 = readiness + liveness + startup
          if len(patch) != 3*len(spec.Spec.Containers) {
              log.Debugf("patch not match container num, not restore")
              return
      Severity: Major
      Found in pkg/inject/proxy.go - About 40 mins to fix

        Function RunCmdWithElevated has 6 return statements (exceeds 4 allowed).
        Open

        func RunCmdWithElevated(exe string, arg []string) error {
            verb := "runas"
            cwd, err := os.Getwd()
            if err != nil {
                return err
        Severity: Major
        Found in pkg/daemon/elevate/elevate_windows.go - About 40 mins to fix

          Function StartClient has 6 return statements (exceeds 4 allowed).
          Open

          func StartClient(ctx context.Context, localDir string, localAddr, remoteAddr string) error {
              if err := MakeSureGui(); err != nil {
                  return err
              }
              err := cmdutil.SetConfigDataLocationsFromFlags(pkgconfig.GetSyncthingPath(), "", "")
          Severity: Major
          Found in pkg/syncthing/syncthing.go - About 40 mins to fix

            Function addTunRoutes has 6 return statements (exceeds 4 allowed).
            Open

            func addTunRoutes(tunName string, routes ...types.Route) error {
                name, err2 := net.InterfaceByName(tunName)
                if err2 != nil {
                    return err2
                }
            Severity: Major
            Found in pkg/tun/tun_windows.go - About 40 mins to fix

              Function NewTunEndpoint has 6 return statements (exceeds 4 allowed).
              Open

              func NewTunEndpoint(ctx context.Context, tun net.Conn, mtu uint32, engine config.Engine, in chan<- *DataElem, out chan *DataElem) stack.LinkEndpoint {
                  addr, _ := tcpip.ParseMACAddress("02:03:03:04:05:06")
                  endpoint := channel.New(tcp.DefaultReceiveBufferSize, mtu, addr)
              
                  go func() {
              Severity: Major
              Found in pkg/core/gvisortunendpoint.go - About 40 mins to fix

                Method Server.Logs has 6 return statements (exceeds 4 allowed).
                Open

                func (svr *Server) Logs(req *rpc.LogRequest, resp rpc.Daemon_LogsServer) error {
                    path := GetDaemonLogPath()
                
                    lines, err2 := countLines(path)
                    if err2 != nil {
                Severity: Major
                Found in pkg/daemon/action/logs.go - About 40 mins to fix

                  Function serve has 6 return statements (exceeds 4 allowed).
                  Open

                  func serve(w http.ResponseWriter, r *http.Request, admit admitHandler) {
                      var body []byte
                      if r.Body != nil {
                          if data, err := io.ReadAll(r.Body); err == nil {
                              body = data
                  Severity: Major
                  Found in pkg/webhook/mutateadmissionwebhook.go - About 40 mins to fix

                    Function init has 6 return statements (exceeds 4 allowed).
                    Open

                    func init() {
                        http.Handle("/ws", websocket.Handler(func(conn *websocket.Conn) {
                            var sshConfig pkgssh.SshConfig
                            b := conn.Request().Header.Get("ssh")
                            if err := json.Unmarshal([]byte(b), &sshConfig); err != nil {
                    Severity: Major
                    Found in pkg/daemon/handler/ssh.go - About 40 mins to fix

                      Method Options.InitClient has 6 return statements (exceeds 4 allowed).
                      Open

                      func (option *Options) InitClient(f cmdutil.Factory) (err error) {
                          option.factory = f
                          if option.config, err = option.factory.ToRESTConfig(); err != nil {
                              return
                          }
                      Severity: Major
                      Found in pkg/dev/options.go - About 40 mins to fix

                        Method Server.Disconnect has 6 return statements (exceeds 4 allowed).
                        Open

                        func (svr *Server) Disconnect(req *rpc.DisconnectRequest, resp rpc.Daemon_DisconnectServer) error {
                            defer func() {
                                util.InitLoggerForServer(true)
                                log.SetOutput(svr.LogFile)
                                config.Debug = false
                        Severity: Major
                        Found in pkg/daemon/action/disconnect.go - About 40 mins to fix

                          Function RunCmd has 6 return statements (exceeds 4 allowed).
                          Open

                          func RunCmd(exe string, arg []string) error {
                              verb := "open"
                              cwd, err := os.Getwd()
                              if err != nil {
                                  return err
                          Severity: Major
                          Found in pkg/daemon/elevate/elevate_windows.go - About 40 mins to fix

                            Function PullImage has 6 return statements (exceeds 4 allowed).
                            Open

                            func PullImage(ctx context.Context, platform *v1.Platform, cli *client.Client, dockerCli *command.DockerCli, img string, out io.Writer) error {
                                var readCloser io.ReadCloser
                                var plat string
                                if platform != nil && platform.Architecture != "" && platform.OS != "" {
                                    plat = fmt.Sprintf("%s/%s", platform.OS, platform.Architecture)
                            Severity: Major
                            Found in pkg/ssh/image.go - About 40 mins to fix

                              Method Server.SshStart has 6 return statements (exceeds 4 allowed).
                              Open

                              func (svr *Server) SshStart(ctx context.Context, req *rpc.SshStartRequest) (resp *rpc.SshStartResponse, err error) {
                                  mux.Lock()
                                  defer mux.Unlock()
                              
                                  var clientIP net.IP
                              Severity: Major
                              Found in pkg/daemon/action/sshdaemon.go - About 40 mins to fix

                                Function NewKrb5InitiatorClientWithKeytab has 6 return statements (exceeds 4 allowed).
                                Open

                                func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf string) (kcl Krb5InitiatorClient, err error) {
                                    c, err := config.Load(krb5Conf)
                                    if err != nil {
                                        return
                                    }
                                Severity: Major
                                Found in pkg/ssh/gssapi.go - About 40 mins to fix

                                  Function NewKrb5InitiatorClientWithCache has 6 return statements (exceeds 4 allowed).
                                  Open

                                  func NewKrb5InitiatorClientWithCache(krb5Conf, cacheFile string) (kcl Krb5InitiatorClient, err error) {
                                      c, err := config.Load(krb5Conf)
                                      if err != nil {
                                          return
                                      }
                                  Severity: Major
                                  Found in pkg/ssh/gssapi.go - About 40 mins to fix

                                    Function StartServer has 6 return statements (exceeds 4 allowed).
                                    Open

                                    func StartServer(ctx context.Context, detach bool, remoteDir string) error {
                                        if err := MakeSureGui(); err != nil {
                                            return err
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in pkg/syncthing/syncthing.go - About 40 mins to fix

                                      Method Config.SetupDNS has 6 return statements (exceeds 4 allowed).
                                      Open

                                      func (c *Config) SetupDNS(ctx context.Context) error {
                                          clientConfig := c.Config
                                          tunName := c.TunName
                                      
                                          tun, err := net.InterfaceByName(tunName)
                                      Severity: Major
                                      Found in pkg/dns/dns_windows.go - About 40 mins to fix

                                        Method Config.removeHosts has 6 return statements (exceeds 4 allowed).
                                        Open

                                        func (c *Config) removeHosts(hosts []Entry) error {
                                            if len(hosts) == 0 {
                                                return nil
                                            }
                                        
                                        
                                        Severity: Major
                                        Found in pkg/dns/dns.go - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language