Showing 3,246 of 4,217 total issues

Function tip has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function tip($in = null, $extra = [])
    {
        if ( ! is_array($extra)) {
            $extra = [];
        }
Severity: Minor
Found in classes/yf_graphics.class.php - About 4 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 _do_debug_db_connection_queries has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function _do_debug_db_connection_queries($db, $connect_trace = [])
    {
        if ( ! $this->SHOW_DB_QUERY_LOG) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 4 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 write_string has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function write_string($server_info = [], $string = '', $remote_file = '')
    {
        $remote_file = _class('ssh')->_prepare_path($remote_file);
        if ( ! _class('ssh')->_INIT_OK || ! $server_info || ! $string || ( ! strlen($remote_file) && ! is_array($string))) {
            return false;
Severity: Major
Found in plugins/ssh/classes/ssh/yf_ssh_files.class.php - About 4 hrs to fix

    Method test_complex has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function test_complex()
        {
            $to_merge_1 = [
                'auth_user' => [
                    'EXEC_AFTER_LOGIN' => [
    Severity: Major
    Found in .dev/tests/unit/functions/function_my_array_merge_test.Test.php - About 4 hrs to fix

      Method tasks has 105 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function tasks($allowed_check = false)
          {
              $main = main();
              if ($main->is_console() || $main->is_ajax()) {
                  $main->no_graphics(true);
      Severity: Major
      Found in plugins/sys/classes/yf_core_blocks.class.php - About 4 hrs to fix

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

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

          yf_payment_api__provider_remote has 33 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class yf_payment_api__provider_remote
          {
              public $ENABLE = null;
              public $TEST_MODE = null;
          
          
          Severity: Minor
          Found in plugins/payment/classes/yf_payment_api__provider_remote.class.php - About 4 hrs to fix

            sample_core_api has 33 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class sample_core_api
            {
                public function _init()
                {
                    _class('core_api')->SOURCE_ONLY_FRAMEWORK = true;
            Severity: Minor
            Found in .dev/samples/classes/sample_core_api.class.php - About 4 hrs to fix

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

              <?php
              
              /**
               * Static/HTML pages content editor.
               *
              Severity: Minor
              Found in plugins/static_pages/admin_modules/yf_static_pages.class.php - About 4 hrs to fix

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

                <?php
                
                /**
                 * Custom error handler.
                 *
                Severity: Minor
                Found in plugins/sys/classes/yf_core_errors.class.php - About 4 hrs to fix

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

                  <?php
                  
                  return [
                      'fields' => [
                          'id' => [
                  Severity: Minor
                  Found in plugins/sys/share/db/sql_php/sys_category_items.sql_php.php - About 4 hrs to fix

                    Method csv_ecommpay has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function csv_ecommpay($options = null)
                        {
                            $operation_id = &$_POST['operation_id'];
                            if ( ! is_array($operation_id) || count($operation_id) < 1) {
                                common()->message_info('Отсутствуют данные');
                    Severity: Major
                    Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 4 hrs to fix

                      Method _generate_sitemap has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _generate_sitemap()
                          {
                              main()->NO_GRAPHICS = true;
                              if ( ! $this->SITE_MAP_ENABLED) {
                                  return false;
                      Severity: Major
                      Found in plugins/site_map/modules/yf_site_map.class.php - About 4 hrs to fix

                        Method _validate_rules_cleanup has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function _validate_rules_cleanup($validate_rules = [])
                            {
                                // Trim names with spaces
                                foreach ((array) $validate_rules as $name => $raw) {
                                    $trimmed = trim($name);
                        Severity: Major
                        Found in classes/yf_validate.class.php - About 4 hrs to fix

                          File class_db_real_migrator_mysql.Test__off__.php has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          require_once __DIR__ . '/db_real_abstract.php';
                          
                          /**
                          Severity: Minor
                          Found in .dev/tests/functional/db/class_db_real_migrator_mysql.Test__off__.php - About 4 hrs to fix

                            Function _tree_items has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _tree_items(&$data, $extra = [])
                                {
                                    if ($extra['show_controls'] && ! is_callable($extra['show_controls'])) {
                                        $r = [
                                            'edit_link' => isset($extra['edit_link']) ? $extra['edit_link'] : url('/@object/edit_item/%d/@page'),
                            Severity: Minor
                            Found in plugins/html/classes/html/yf_html_tree.class.php - About 4 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 go has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function go()
                                {
                                    if ( ! db()->QUERY_LOG) {
                                        return false;
                                    }
                            Severity: Minor
                            Found in plugins/logs/classes/logs/yf_logs_db_queries.class.php - About 4 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 _loop_detected has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function _loop_detected($cur_url)
                                {
                                    if ( ! $this->LOOP_DEFENCE) {
                                        return false;
                                    }
                            Severity: Minor
                            Found in classes/yf_redirect.class.php - About 4 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_for_object has 102 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _show_for_object($params = [])
                                {
                                    if ($this->USE_TREE_MODE) {
                                        return $this->_show_for_object_tree($params);
                                    }
                            Severity: Major
                            Found in plugins/comments/modules/yf_comments.class.php - About 4 hrs to fix

                              Method _process_where has 102 lines of code (exceeds 25 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: Major
                              Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language