Showing 3,246 of 4,217 total issues

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

<?php

if ( ! function_exists('array_replace_recursive')) {
    trigger_error('Not exists function "array_replace_recursive ( PHP 5 >= 5.3.0 )"', E_USER_ERROR);
}
Severity: Major
Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 2 days to fix

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

    <?php
    
    _class('payment_api__provider_remote');
    
    class yf_payment_api__provider_payeer extends yf_payment_api__provider_remote
    Severity: Major
    Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 2 days to fix

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

      <?php
      
      /**
       * Class where most common used functions are stored.
       *
      Severity: Major
      Found in plugins/common/classes/yf_common.class.php - About 2 days to fix

        yf_common has 143 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_common
        {
            /** @var bool Store user-level errors */
            public $TRACK_USER_ERRORS = false;
            /** @var bool Display debug info for the empty page */
        Severity: Major
        Found in plugins/common/classes/yf_common.class.php - About 2 days to fix

          Function render has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render($extra = [], $replace = [])
              {
                  if (isset($this->_rendered)) {
                      return $this->_rendered;
                  }
          Severity: Minor
          Found in plugins/form2/classes/yf_form2.class.php - About 2 days 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 _url has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
          Open

              public function _url($params = [], $host = '', $url_str = '', $for_section = null)
              {
                  if (DEBUG_MODE && ! $this->FORCE_NO_DEBUG) {
                      $time_start = microtime(true);
                  }
          Severity: Minor
          Found in plugins/rewrite/classes/yf_rewrite.class.php - About 2 days 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

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

          <?php
          
          _class('payment_api__provider_remote');
          
          class yf_payment_api__provider_yandexmoney extends yf_payment_api__provider_remote
          Severity: Major
          Found in plugins/payment/classes/yf_payment_api__provider_yandexmoney.class.php - About 2 days to fix

            File sys_category_items.data.php has 1023 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            return [
              1 => [
                'id' => '1',
            Severity: Major
            Found in .dev/install/installer_data/db_tables/sys_category_items.data.php - About 2 days to fix

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

              <?php
              
              /**
               * File uploads wrapper.
               *
              Severity: Major
              Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 days to fix

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

                <?php
                
                _class('payment_api__provider_remote');
                
                class yf_payment_api__provider_ecommpay extends yf_payment_api__provider_remote
                Severity: Major
                Found in plugins/payment/classes/yf_payment_api__provider_ecommpay.class.php - About 2 days to fix

                  Function _process_where has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function _process_where(array $where, $func_name = 'where', $return_array = false)
                      {
                          $sql = '';
                          if ($count = count((array) $where)) {
                              $all_numeric = $this->_is_where_all_numeric($where);
                  Severity: Minor
                  Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 days 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

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

                  <?php
                  
                  /**
                   * Validation common methods, part of this was inspired by codeigniter 2.1 form_validate.
                   */
                  Severity: Major
                  Found in classes/yf_validate.class.php - About 2 days to fix

                    Method view_order has 417 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function view_order()
                        {
                            $_GET['id'] = (int) ($_GET['id']);
                            if ($_GET['id']) {
                                if ($this->SUPPLIER_ID) {
                    Severity: Major
                    Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_orders.class.php - About 2 days to fix

                      Function view_order has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function view_order()
                          {
                              $_GET['id'] = (int) ($_GET['id']);
                              if ($_GET['id']) {
                                  if ($this->SUPPLIER_ID) {
                      Severity: Minor
                      Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_orders.class.php - About 2 days 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

                      File customer.data.php has 839 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      return [
                          0 => [
                              'customer_id' => '1',
                      Severity: Major
                      Found in .dev/tests/functional/model/fixtures/customer.data.php - About 2 days to fix

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

                        <?php
                        
                        /**
                         * Template driver YF built-in.
                         */
                        Severity: Major
                        Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 2 days to fix

                          Function _email_verify has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function _email_verify($email = '', $check_mx = false, $check_by_smtp = false, $check_blacklists = false)
                              {
                                  if (empty($email)) {
                                      return false;
                                  }
                          Severity: Minor
                          Found in plugins/common/classes/common/yf_remote_files.class.php - About 1 day 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

                          File class_db_real_utils_pgsql.TODO.php has 807 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          require_once __DIR__ . '/db_real_abstract.php';
                          
                          /**
                          Severity: Major
                          Found in .dev/tests/functional/db/class_db_real_utils_pgsql.TODO.php - About 1 day to fix

                            File address.data.php has 803 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            
                            return [
                                0 => [
                                    'address_id' => '1',
                            Severity: Major
                            Found in .dev/tests/functional/model/fixtures/address.data.php - About 1 day to fix

                              Function read has a Cognitive Complexity of 95 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function read($filename)
                                  {
                                      // split the file into lines, we'll process it line by line
                                      $config_file = file($filename);
                              
                              
                              Severity: Minor
                              Found in plugins/search/admin_modules/yf_manage_sphinx.class.php - About 1 day 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