Showing 526 of 526 total issues
Function InitFactory
has 6 return statements (exceeds 4 allowed). Open
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)
Function DownloadFileWithName
has 6 return statements (exceeds 4 allowed). Open
Open
func DownloadFileWithName(uri, name string) (string, error) {
resp, err := getWithRetry(uri)
if err != nil {
return "", err
}
Function fromPatchToProbe
has 6 return statements (exceeds 4 allowed). Open
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
Function RunCmdWithElevated
has 6 return statements (exceeds 4 allowed). Open
Open
func RunCmdWithElevated(exe string, arg []string) error {
verb := "runas"
cwd, err := os.Getwd()
if err != nil {
return err
Function StartClient
has 6 return statements (exceeds 4 allowed). Open
Open
func StartClient(ctx context.Context, localDir string, localAddr, remoteAddr string) error {
if err := MakeSureGui(); err != nil {
return err
}
err := cmdutil.SetConfigDataLocationsFromFlags(pkgconfig.GetSyncthingPath(), "", "")
Function addTunRoutes
has 6 return statements (exceeds 4 allowed). Open
Open
func addTunRoutes(tunName string, routes ...types.Route) error {
name, err2 := net.InterfaceByName(tunName)
if err2 != nil {
return err2
}
Function NewTunEndpoint
has 6 return statements (exceeds 4 allowed). Open
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() {
Method Server.Logs
has 6 return statements (exceeds 4 allowed). Open
Open
func (svr *Server) Logs(req *rpc.LogRequest, resp rpc.Daemon_LogsServer) error {
path := GetDaemonLogPath()
lines, err2 := countLines(path)
if err2 != nil {
Function serve
has 6 return statements (exceeds 4 allowed). Open
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
Function init
has 6 return statements (exceeds 4 allowed). Open
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 {
Method Options.InitClient
has 6 return statements (exceeds 4 allowed). Open
Open
func (option *Options) InitClient(f cmdutil.Factory) (err error) {
option.factory = f
if option.config, err = option.factory.ToRESTConfig(); err != nil {
return
}
Method Server.Disconnect
has 6 return statements (exceeds 4 allowed). Open
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
Function RunCmd
has 6 return statements (exceeds 4 allowed). Open
Open
func RunCmd(exe string, arg []string) error {
verb := "open"
cwd, err := os.Getwd()
if err != nil {
return err
Function PullImage
has 6 return statements (exceeds 4 allowed). Open
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)
Method Server.SshStart
has 6 return statements (exceeds 4 allowed). Open
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
Function NewKrb5InitiatorClientWithKeytab
has 6 return statements (exceeds 4 allowed). Open
Open
func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf string) (kcl Krb5InitiatorClient, err error) {
c, err := config.Load(krb5Conf)
if err != nil {
return
}
Function NewKrb5InitiatorClientWithCache
has 6 return statements (exceeds 4 allowed). Open
Open
func NewKrb5InitiatorClientWithCache(krb5Conf, cacheFile string) (kcl Krb5InitiatorClient, err error) {
c, err := config.Load(krb5Conf)
if err != nil {
return
}
Function StartServer
has 6 return statements (exceeds 4 allowed). Open
Open
func StartServer(ctx context.Context, detach bool, remoteDir string) error {
if err := MakeSureGui(); err != nil {
return err
}
Method Config.SetupDNS
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Config) SetupDNS(ctx context.Context) error {
clientConfig := c.Config
tunName := c.TunName
tun, err := net.InterfaceByName(tunName)
Method Config.removeHosts
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Config) removeHosts(hosts []Entry) error {
if len(hosts) == 0 {
return nil
}