Showing 3,246 of 4,217 total issues

Function _check_words_length has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_words_length($text, $length = 0, $do_encode_email = false)
    {
        if (empty($length)) {
            $length = 60;
            if (SITE_MAX_WORD_LENGTH != 'SITE_MAX_WORD_LENGTH' && SITE_MAX_WORD_LENGTH != '') {
Severity: Minor
Found in classes/yf_utils.class.php - About 2 hrs to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method _update_user_geo_location has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _update_user_geo_location($user_id = 0, $FORCE_IP = '')
    {
        if ( ! main()->USE_GEO_IP) {
            return false;
        }
Severity: Major
Found in plugins/geo/classes/yf_geo_ip.class.php - About 2 hrs to fix

    Method _add_asset has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _add_asset($_content, $asset_type, $_params = [])
        {
            if ( ! $_content) {
                return false;
            }
    Severity: Major
    Found in plugins/assets/classes/yf_assets.class.php - About 2 hrs to fix

      Method prepare has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function prepare($options = null)
          {
              // import options
              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
              if (empty($_currency_rate)) {
      Severity: Major
      Found in plugins/payment/classes/yf_payment_api__currency.class.php - About 2 hrs to fix

        Method confirmation_code_check has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function confirmation_code_check($options = null)
            {
                // import options
                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                // operation
        Severity: Major
        Found in plugins/payment/classes/yf_payment_api.class.php - About 2 hrs to fix

          Method api_request has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function api_request($options = null)
              {
                  if ( ! $this->ENABLE) {
                      return  null;
                  }

            Method _user_message has 56 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _user_message($options = null)
                {
                    $url = &$this->url;
                    // import operation
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            Severity: Major
            Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 2 hrs to fix

              Method edit_item has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function edit_item()
                  {
                      // TODO: save file revision to db on each save
                      if ( ! empty($_GET['id'])) {
                          $file_name = urldecode($_GET['id']);
              Severity: Major
              Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 2 hrs to fix

                Method info has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function info($name, $desc = '', $extra = [], $replace = [])
                    {
                        if (is_array($desc)) {
                            $extra = (array) $extra + $desc;
                            $desc = '';
                Severity: Major
                Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs to fix

                  Method _correct_protocol has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function _correct_protocol($url)
                      {
                          if ( ! strlen($url)) {
                              return false;
                          }
                  Severity: Major
                  Found in plugins/rewrite/classes/yf_rewrite.class.php - About 2 hrs to fix

                    Method _send_email_safe has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function _send_email_safe($email_to, $name_to, $template_name, $data = [], $old_param1 = null, $override = [])
                        {
                            $is_test = (defined('TEST_MODE') && TEST_MODE)
                                && empty($override['force_send'])
                                && empty($this->FORCE_SEND);
                    Severity: Major
                    Found in plugins/email/classes/yf_email.class.php - About 2 hrs to fix

                      Method order_by has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function order_by()
                          {
                              $sql = '';
                              $items = func_get_args();
                              $count = count((array) $items);
                      Severity: Major
                      Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 hrs to fix

                        Method delete has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function delete()
                            {
                                $i = preg_replace('~[^a-z0-9_]+~ims', '', trim($_GET['i']));
                                if ( ! $i || ! isset($this->instances[$i])) {
                                    return js_redirect('/@object');
                        Severity: Major
                        Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 2 hrs to fix

                          Method test_selects_basic has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function test_selects_basic()
                              {
                                  if ($this->_need_skip_test(__FUNCTION__)) {
                                      return;
                                  }

                            Method _payout_PerfectMoney has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function _payout_PerfectMoney($title)
                                {
                                    $payment_api = _class('payment_api');
                                    $provider_class = $payment_api->provider_class([
                                        'provider_name' => 'perfectmoney',
                            Severity: Major
                            Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                              Method api_request has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function api_request($options = null)
                                  {
                                      if ( ! $this->ENABLE) {
                                          return  null;
                                      }

                                Method recreate has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function recreate()
                                    {
                                        // var
                                        $payment_api = &$this->payment_api;
                                        $url = &$this->url;
                                Severity: Major
                                Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 2 hrs to fix

                                  Method _payout_WebMoney has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function _payout_WebMoney($title)
                                      {
                                          $payment_api = _class('payment_api');
                                          $provider_class = $payment_api->provider_class([
                                              'provider_name' => 'webmoney',
                                  Severity: Major
                                  Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix

                                    Method _payout_process has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function _payout_process($options = null)
                                        {
                                            if ( ! $this->ENABLE) {
                                                return  null;
                                            }

                                      Method _payout_Interkassa has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function _payout_Interkassa($title)
                                          {
                                              $payment_api = _class('payment_api');
                                              $provider_class = $payment_api->provider_class([
                                                  'provider_name' => 'interkassa',
                                      Severity: Major
                                      Found in plugins/payment/modules/yf_payment_test.class.php - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language