Showing 3,246 of 4,217 total issues

Method send has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function send(array $params = [], &$error_message = '')
    {
        $CRLF = "\r\n";
        $TAB = "\t";

Severity: Major
Found in plugins/email/classes/mail/yf_mail_driver_internal.class.php - About 2 hrs to fix

    Method get_access_token has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function get_access_token()
        {
            $access_token = $this->_storage_get('access_token');
            if ($access_token) {
                return $access_token;
    Severity: Major
    Found in plugins/oauth/classes/oauth/yf_oauth_driver1.class.php - About 2 hrs to fix

      Method _currency_convert has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _currency_convert($number = 0, $c_from = '', $c_to = '')
          {
              if ( ! $number || ! $c_from || ! $c_to) {
                  return $number;
              }
      Severity: Major
      Found in plugins/common/classes/common/yf_other_common.class.php - About 2 hrs to fix

        Method _is_spider has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _is_spider($ip = '', $ua = '')
            {
                $CHECK_IP = false;
                $CHECK_UA = false;
                if ($ip && preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $ip)) {
        Severity: Major
        Found in plugins/common/classes/common/yf_spider_detection.class.php - About 2 hrs to fix

          Method coupon_edit has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function coupon_edit()
              {
                  $_GET['id'] = (int) ($_GET['id']);
                  if (empty($_GET['id'])) {
                      return _e('Empty ID!');

            Method express has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function express()
                {
                    $date = date('Y-m-d');
                    $orders_info = db()->query_fetch_all('SELECT * FROM ' . db('shop_orders') . " WHERE delivery_time LIKE '" . $date . "%' AND status = 1");
                    if ( ! empty($orders_info)) {

              Method _do_check_data_is_valid has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function _do_check_data_is_valid($rules = [], &$data)
                  {
                      $validate_ok = true;
                      $_all = '__all__';
                      if (isset($rules[$_all])) {
              Severity: Major
              Found in classes/yf_validate.class.php - About 2 hrs to fix

                Method test_validate_multi_select has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function test_validate_multi_select()
                    {
                        $_SERVER['REQUEST_METHOD'] = 'POST';
                        $params = ['do_not_remove_errors' => 1];
                
                
                Severity: Major
                Found in .dev/tests/functional/class_form_real_test.Test.php - About 2 hrs to fix

                  Method test_sql_to_php_db_installer has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function test_sql_to_php_db_installer()
                      {
                          if ($this->_need_skip_test(__FUNCTION__)) {
                              return;
                          }
                  Severity: Major
                  Found in .dev/tests/unit/db/class_db_ddl_parser_mysql_test.Test.php - About 2 hrs to fix

                    File yf_captcha.class.php has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     * Class to handle CAPTCHA images (to prevent auto-registering, flooding etc).
                     *
                    Severity: Minor
                    Found in plugins/content/classes/yf_captcha.class.php - About 2 hrs to fix

                      Function _sub_add has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function _sub_add($info, $asset_type, $_params = [])
                          {
                              if ( ! $info) {
                                  return false;
                              }
                      Severity: Minor
                      Found in plugins/assets/classes/yf_assets.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

                      Function var_edit has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function var_edit()
                          {
                              $a = $this->_get_var_info($_GET['id']);
                              if ( ! $a) {
                                  return _e('Wrong var id');
                      Severity: Minor
                      Found in plugins/locale/admin_modules/yf_locale_editor.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

                      Function cancel has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function cancel($options = null)
                          {
                              // import options
                              is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                              // var
                      Severity: Minor
                      Found in plugins/payment/classes/yf_payment_api.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

                      Function mail has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function mail()
                          {
                              $mail_tpl = [
                                  'payin_success' => [
                                      'type' => 'payin',
                      Severity: Minor
                      Found in plugins/payment/modules/yf_payment_test.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

                      Function _check_payout_operation has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function _check_payout_operation($operation_id)
                          {
                              $payment_api = &$this->payment_api;
                              $operation = $payment_api->operation(['operation_id' => $operation_id]);
                              $address = $operation['options']['request'][0]['options']['address'] ?: false;
                      Severity: Minor
                      Found in plugins/payment/classes/yf_payment_api__provider_bitaps.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

                      Function api_payout has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function api_payout($options = null)
                          {
                              if ( ! $this->ENABLE) {
                                  return  null;
                              }
                      Severity: Minor
                      Found in plugins/payment/classes/yf_payment_api__provider_bitaps.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

                      Function api_payout has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function api_payout($options = null)
                          {
                              if ( ! $this->ENABLE) {
                                  return  null;
                              }
                      Severity: Minor
                      Found in plugins/payment/classes/yf_payment_api__provider_webmoney.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

                      Function get_data has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function get_data()
                          {
                              $relation = $this->_relation;
                              $model = $this->_model;
                              $db = $model->_db;
                      Severity: Minor
                      Found in plugins/sys/classes/model/yf_model_relation.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

                      Function get_submodules has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function get_submodules($section = 'all')
                          {
                              $data = [];
                              foreach ($this->section_paths as $_section => $folder) {
                                  if ($section != 'all' && $section != $_section) {
                      Severity: Minor
                      Found in plugins/sys/classes/yf_core_api.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

                      Function options_to_str has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function options_to_str(array $options, $is_request = true, $level = 1)
                          {
                              if ($level > $this->options_level_max) {
                                  return  null;
                              }
                      Severity: Minor
                      Found in plugins/payment/classes/payment_provider/ecommpay/EcommPay.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

                      Severity
                      Category
                      Status
                      Source
                      Language