Showing 3,246 of 4,217 total issues

Consider simplifying this complex logical expression.
Open

        if (@$_['user_mode'] && (
            ($type['name'] == 'payment' && $_['is_balance_limit_lower'] && ($balance - $amount < $balance_limit_lower))
            || ($type['name'] == 'transfer' && $direction === 'out' && $_['is_balance_limit_lower'] && ($balance - $amount < $balance_limit_lower))
        )) {
            $result = [
Severity: Critical
Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

            if (is_array($params) && ! empty($params)) {
                isset($params['host']) && $this->host = $params['host'];
                isset($params['port']) && $this->port = $params['port'];
                isset($params['login']) && $this->login = $params['login'];
                isset($params['password']) && $this->password = $params['password'];
    Severity: Critical
    Found in plugins/rabbitmq/classes/yf_wrapper_rabbitmq.class.php - About 1 hr to fix

      Method simple_table has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function simple_table($replace = [], $extra = [])
          {
              if ( ! $replace) {
                  return false;
              }
      Severity: Minor
      Found in plugins/html/classes/yf_html.class.php - About 1 hr to fix

        Method connect has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function connect($params = [])
            {
                $this->_connected_ok = false;
        
                $ext_old_allowed = $this->FORCE_EXT ? in_array($this->FORCE_EXT, ['old', 'memcache']) : true;
        Severity: Minor
        Found in plugins/memcached/classes/yf_wrapper_memcached.class.php - About 1 hr to fix

          Method _show_files_for_lang has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _show_files_for_lang($lang, $lang_files, $var_files)
              {
                  $yf_path_len = strlen(YF_PATH);
                  $app_path_len = strlen(APP_PATH);
          
          
          Severity: Minor
          Found in plugins/locale/admin_modules/yf_locale_editor.class.php - About 1 hr to fix

            Method filters_get_avail has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function filters_get_avail()
                {
                    if (isset($this->_avail_filters)) {
                        return $this->_avail_filters;
                    }
            Severity: Minor
            Found in plugins/assets/classes/yf_assets.class.php - About 1 hr to fix

              Method _php_vars has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _php_vars($file, $params = [])
                  {
                      $code = file_get_contents($file);
              
                      $GLOBALS['_locale_editor_collect_vars'] = [];

                Method _filter_form_show has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _filter_form_show($filter, $replace)
                    {
                        $order_fields = [
                            'provider_id' => 'provider_id',
                            'currency_rate_id' => 'id',
                Severity: Minor
                Found in plugins/payment/admin_modules/yf_manage_currency.class.php - About 1 hr to fix

                  Method transfer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function transfer($options)
                      {
                          if ( ! $this->ENABLE) {
                              return  null;
                          }
                  Severity: Minor
                  Found in plugins/payment/classes/yf_payment_api__provider.class.php - About 1 hr to fix

                    Method _amount_payout has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _amount_payout($amount, $currency_id, $method, $is_request = true)
                        {
                            if ( ! $this->ENABLE) {
                                return  null;
                            }
                    Severity: Minor
                    Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 1 hr to fix

                      Method _sign_interkassa has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function _sign_interkassa()
                          {
                              $form = '';
                              $api = _class('payment_api__provider_interkassa');
                              // test signature
                      Severity: Minor
                      Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                        Method account_create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function account_create($options = null)
                            {
                                // options
                                $_ = &$options;
                                $data = [];
                        Severity: Minor
                        Found in plugins/payment/classes/yf_payment_api.class.php - About 1 hr to fix

                          Method _sign_PerfectMoney has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function _sign_PerfectMoney()
                              {
                                  $form = '';
                                  $api = _class('payment_api__provider_perfectmoney');
                                  // test signature
                          Severity: Minor
                          Found in plugins/payment/modules/yf_payment_test.class.php - About 1 hr to fix

                            Method exception_handler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function exception_handler($exception)
                                {
                                    // these are our templates
                                    $traceline = '#%s %s(%s): %s(%s)';
                                    $msg = "PHP Fatal error:  Uncaught exception '%s' with message '%s' in %s:%s\nStack trace:\n%s\n  thrown in %s on line %s";
                            Severity: Minor
                            Found in plugins/sys/classes/yf_core_errors.class.php - About 1 hr to fix

                              Method _get_denied_tasks_names has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function _get_denied_tasks_names()
                                  {
                                      $cache = 'cache_' . __FUNCTION__;
                                      if (isset($this->$cache)) {
                                          return $this->$cache;
                              Severity: Minor
                              Found in plugins/sys/classes/yf_core_blocks.class.php - About 1 hr to fix

                                Method _form has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function _form($data, $options = null)
                                    {
                                        if ( ! $this->ENABLE) {
                                            return  null;
                                        }
                                Severity: Minor
                                Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 1 hr to fix

                                  Method _prepare_to_save has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function _prepare_to_save($a)
                                      {
                                          $to_save = [];
                                          foreach ((array) $a as $k => $v) {
                                              if (is_string($v) && ! strlen($v)) {
                                  Severity: Minor
                                  Found in plugins/conf/admin_modules/yf_settings.class.php - About 1 hr to fix

                                    Method city_box has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function city_box($name = '', $desc = '', $extra = [], $replace = [], $form)
                                        {
                                            if (is_array($name)) {
                                                $extra = (array) $extra + $name;
                                                $name = '';
                                    Severity: Minor
                                    Found in plugins/form2/classes/form2/yf_form2_boxes.class.php - About 1 hr to fix

                                      Method test_send has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function test_send()
                                          {
                                              $a = $this->_get_info();
                                              if (empty($a)) {
                                                  return _404();
                                      Severity: Minor
                                      Found in plugins/email/admin_modules/yf_manage_emails.class.php - About 1 hr to fix

                                        Method set has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function set($name, $data, $ttl = 0)
                                            {
                                                if ($name === false || $name === null) {
                                                    return null;
                                                }
                                        Severity: Minor
                                        Found in plugins/cache/classes/yf_cache.class.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language