Showing 3,246 of 4,217 total issues

Method _filter_array has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _filter_array(&$data, $filter = [], $filter_params = [], $table = null)
    {
        if ( ! $data || ! $filter) {
            return false;
        }
Severity: Major
Found in plugins/table2/classes/table2/yf_table2_filter.class.php - About 4 hrs to fix

    Method read has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function read($filename)
        {
            // split the file into lines, we'll process it line by line
            $config_file = file($filename);
    
    

      Method _do_debug_db_connection_queries has 102 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function _do_debug_db_connection_queries($db, $connect_trace = [])
          {
              if ( ! $this->SHOW_DB_QUERY_LOG) {
                  return '';
              }
      Severity: Major
      Found in classes/yf_debug.class.php - About 4 hrs to fix

        Method read has 102 lines of code (exceeds 25 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: Major
        Found in plugins/search/admin_modules/yf_manage_sphinx.class.php - About 4 hrs to fix

          Method _get_modules_from_files has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function _get_modules_from_files($include_framework = true, $with_sub_modules = false)
              {
                  $admin_modules_array = [];
          
                  $pattern_include = '-f ~/' . preg_quote(ADMIN_MODULES_DIR, '~') . '.*' . preg_quote(YF_CLS_EXT, '~') . '$~';
          Severity: Major
          Found in plugins/sys/classes/core_api/yf_core_api_admin_modules.class.php - About 4 hrs to fix

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

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

              Method test_whereid has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

                yf_payment_api__provider_webmoney has 32 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class yf_payment_api__provider_webmoney extends yf_payment_api__provider_remote
                {
                    // номер перевода в системе учета отправителя; любое целое число без знака (целое число > 0; максимально 2^31 - 1), должно быть уникальным в пределах WMID, который подписывает запрос.
                    // Два перевода с одним и тем же tranid с одного WMID (даже с разных кошельков) осуществить невозможно.
                    // Уникальность значения tranid контролируется в интервале не менее одного года.
                Severity: Minor
                Found in plugins/payment/classes/yf_payment_api__provider_webmoney.class.php - About 4 hrs to fix

                  Method text has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function text($name, $desc = '', $extra = [])
                      {
                          // Shortcut: use second param as $extra
                          if (is_array($desc)) {
                              $extra = (array) $extra + $desc;
                  Severity: Major
                  Found in plugins/table2/classes/yf_table2.class.php - About 4 hrs to fix

                    yf_ssh has 32 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class yf_ssh
                    {
                        // TODO: chained mode like in form and table, mass actions on one server, array of servers, named group(s) of servers:
                        // ssh('s23.dev')->exec('service memcached restart');
                        // ssh('s23*.dev')->exec('service memcached restart');
                    Severity: Minor
                    Found in plugins/ssh/classes/yf_ssh.class.php - About 4 hrs to fix

                      Method _show_info_items has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function _show_info_items()
                          {
                              // Array of text fields
                              $text_fields = [
                                  'name' => 'Name',
                      Severity: Major
                      Found in plugins/user/modules/yf_user_profile.class.php - About 4 hrs to fix

                        yf_graphics has 32 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class yf_graphics
                        {
                            /** @var bool Add pages names to the title */
                            public $ADD_TITLE_PAGES = true;
                            /** @var bool Show auto-parsed (and tried to translate) task name */
                        Severity: Minor
                        Found in classes/yf_graphics.class.php - About 4 hrs to fix

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

                          <?php
                          
                          /**
                           * Redis API wrapper.
                           */
                          Severity: Minor
                          Found in plugins/redis/classes/yf_wrapper_redis.class.php - About 4 hrs to fix

                            Method _try_to_find_libs has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _try_to_find_libs()
                                {
                                    if ( ! $this->AUTO_FIND_PATHS) {
                                        return false;
                                    }
                            Severity: Major
                            Found in plugins/common/classes/common/yf_image_manip.class.php - About 3 hrs to fix

                              Method form_row has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function form_row($content, $extra = [], $replace = [], $form)
                                  {
                                      $name = $extra['name'];
                                      $is_html_array = (false !== strpos($name, '['));
                                      if ($is_html_array) {
                              Severity: Major
                              Found in plugins/html/classes/html5fw/yf_html5fw_bs3.class.php - About 3 hrs to fix

                                Function start has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function start()
                                    {
                                        $main = main();
                                        if ( ! empty($this->_started) || $main->is_console() || conf('SESSION_OFF') || $this->OFF) {
                                            return false;
                                Severity: Minor
                                Found in plugins/session/classes/yf_session.class.php - About 3 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 _show_menu has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _show_menu($params = [])
                                    {
                                        $return_array = isset($params['return_array']) ? $params['return_array'] : false;
                                        $force_stpl_name = isset($params['force_stpl_name']) ? $params['force_stpl_name'] : false;
                                        $menu_name = $params['name'];
                                Severity: Minor
                                Found in plugins/sys/classes/yf_core_menu.class.php - About 3 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 _external_response has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _external_response()
                                    {
                                        $ip = common()->get_ip();
                                        if ( ! in_array($ip, ['185.71.65.92', '185.71.65.189', '149.202.17.210'])) {
                                            $this->external_response_errors[] = 'Invalid sender IP address ' . $ip;
                                Severity: Minor
                                Found in plugins/payment/classes/yf_payment_api__provider_payeer.class.php - About 3 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 _show_for_object has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function _show_for_object($params = [])
                                    {
                                        if ($this->USE_TREE_MODE) {
                                            return $this->_show_for_object_tree($params);
                                        }
                                Severity: Minor
                                Found in plugins/comments/modules/yf_comments.class.php - About 3 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 27 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function go($source_file_path = '', $dest_file_path = '', $LIMIT_X = -1, $LIMIT_Y = -1, $watermark_path = '', $ext = '')
                                    {
                                        $_prev_num_errors = count((array) main()->_all_core_error_msgs);
                                        $LIMIT_X = (int) ($LIMIT_X != -1 ? $LIMIT_X : THUMB_WIDTH);
                                        $LIMIT_Y = (int) ($LIMIT_Y != -1 ? $LIMIT_Y : THUMB_HEIGHT);
                                Severity: Minor
                                Found in plugins/common/classes/common/yf_make_thumb.class.php - About 3 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