Showing 3,246 of 4,217 total issues

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

<?php

/**
 * Dashboards management.
 *
Severity: Minor
Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 7 hrs to fix

    Method api_payout has 191 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Function _external_response has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _external_response($options)
          {
              $pos_data = json_decode($options['posData'], true);
              $operation_id = (int) ($pos_data['orderId']);
              $ip = common()->get_ip();
      Severity: Minor
      Found in plugins/payment/classes/yf_payment_api__provider_bitpay.class.php - About 7 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 copy_item2 has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          public function copy_item2()
          {
              if ($_POST['items_to_copy']) {
                  $items = unserialize(urldecode($_POST['items_to_copy']));
                  foreach ((array) $items as $k => $v) {
      Severity: Minor
      Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 7 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_methods has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _get_methods($params = [])
          {
              $ONLY_PRIVATE_METHODS = [];
              if (isset($params['private'])) {
                  $ONLY_PRIVATE_METHODS = $params['private'];
      Severity: Minor
      Found in plugins/sys/classes/core_api/yf_core_api_user_modules.class.php - About 7 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 generate_down has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring.
      Open

          public function generate_down($report = null, $params = [])
          {
              if ( ! isset($report)) {
                  $report = $this->compare($params);
              }
      Severity: Minor
      Found in plugins/db/classes/db/yf_db_migrator.class.php - About 7 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

      File class_html_test.Test.php has 480 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      
      require_once __DIR__ . '/yf_unit_tests_setup.php';
      
      
      Severity: Minor
      Found in .dev/tests/unit/class_html_test.Test.php - About 7 hrs to fix

        yf_model has 53 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class yf_model
        {
            const CREATED_AT = 'created_at';
            const UPDATED_AT = 'updated_at';
        
        
        Severity: Major
        Found in plugins/sys/classes/yf_model.class.php - About 7 hrs to fix

          yf_utils has 53 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_utils
          {
              /**
               * Catch missing method call.
               * @param mixed $name
          Severity: Major
          Found in classes/yf_utils.class.php - About 7 hrs to fix

            sample_html has 53 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class sample_html
            {
                /***/
                public function _init()
                {
            Severity: Major
            Found in .dev/samples/classes/sample_html.class.php - About 7 hrs to fix

              Method load_class_file has 186 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function load_class_file($class_name = '', $custom_path = '', $force_storage = '')
                  {
                      if (empty($class_name) || $class_name == 'main') {
                          return false;
                      }
              Severity: Major
              Found in classes/yf_main.class.php - About 7 hrs to fix

                Function split_sql has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function split_sql($sql)
                    {
                        $out = [];
                        // do not trim
                        $sql = rtrim($sql, "\n\r");
                Severity: Minor
                Found in plugins/db/classes/db/yf_db_utils_driver.class.php - About 7 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

                yf_debug has 52 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_debug
                {
                    public $SHOW_DB_QUERY_LOG = true;
                    public $SHOW_DB_STATS = false;
                    public $SHOW_DB_EXPLAIN_QUERY = true;
                Severity: Major
                Found in classes/yf_debug.class.php - About 7 hrs to fix

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

                  <?php
                  
                  return [
                      0 => [
                          'city_id' => '14',
                  Severity: Minor
                  Found in .dev/tests/functional/model/fixtures/city.data.php - About 7 hrs to fix

                    Method _url has 182 lines of code (exceeds 25 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: Major
                    Found in plugins/rewrite/classes/yf_rewrite.class.php - About 7 hrs to fix

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

                      <?php
                      
                      return [
                        1 => [
                          'id' => '1',
                      Severity: Minor
                      Found in .dev/install/installer_data/db_tables_en/static_pages.data.php - About 7 hrs to fix

                        Function _build has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function _build($a, $class_rewrite)
                            {
                                $u = false;
                                if ( ! empty($class_rewrite->BUILD_RULES)) {
                                    foreach ((array) $class_rewrite->BUILD_RULES as $func) {
                        Severity: Minor
                        Found in plugins/rewrite/classes/rewrite/yf_rewrite_pattern_yf.class.php - About 7 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 render has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function render($params = [])
                            {
                                if (DEBUG_MODE) {
                                    $ts = microtime(true);
                                }
                        Severity: Minor
                        Found in plugins/table2/classes/yf_table2.class.php - About 7 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 init_constants has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function init_constants()
                            {
                                $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
                                // Save current working directory (to restore it later when execute shutdown functions)
                                $this->_CWD = getcwd();
                        Severity: Minor
                        Found in classes/yf_main.class.php - About 7 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 show has 181 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function show()
                            {
                                $object = &$this->object;
                                $action = &$this->action;
                                $filter_name = &$this->filter_name;
                        Severity: Major
                        Found in plugins/payment/admin_modules/yf_manage_payment_operation.class.php - About 7 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language