Showing 3,246 of 4,217 total issues

Function query has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function query($sql, $need_meta = false)
    {
        if (empty($sql)) {
            return false;
        }
Severity: Minor
Found in plugins/search/classes/yf_sphinxsearch.class.php - About 5 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 yf_db_utils_helper_create_table.class.php has 378 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php


class yf_db_utils_helper_create_table
{
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_helper_create_table.class.php - About 5 hrs to fix

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

    <?php
    
    /**
     * Site Map Generator (implementation of the http://www.sitemaps.org/protocol.php).
     *
    Severity: Minor
    Found in plugins/site_map/modules/yf_site_map.class.php - About 5 hrs to fix

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

      <?php
      
      /**
       * Comments management.
       */
      Severity: Minor
      Found in plugins/comments/modules/comments/yf_comments_manage.class.php - About 5 hrs to fix

        Method _operation has 125 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _operation($options = null)
            {
                // import options
                is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
                // class
        Severity: Major
        Found in plugins/payment/admin_modules/yf_manage_deposit.class.php - About 5 hrs to fix

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

          <?php
          
          /**
           * Menu API methods.
           *
          Severity: Minor
          Found in plugins/sys/classes/yf_core_menu.class.php - About 5 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                        if (( ! is_array($rule_info['methods']) || $matched_method)
                            && ( ! is_array($rule_info['user_groups']) || $matched_user_group)
                            && ( ! is_array($rule_info['themes']) || $matched_theme || ! $CUR_USER_THEME)
                            && ( ! is_array($rule_info['locales']) || $matched_locale || ! $CUR_LOCALE)
                            && ( ! is_array($rule_info['site_ids']) || $matched_site || ! $CUR_SITE)
            Severity: Critical
            Found in plugins/sys/classes/yf_core_blocks.class.php - About 5 hrs to fix

              File sys_log_redirects.sql_php.php has 375 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_redirects.sql_php.php - About 5 hrs to fix

                Method _process_ifs has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _process_ifs($string = '', array &$replace, $stpl_name = '')
                    {
                        if (false === strpos($string, '{/if}') || empty($string)) {
                            return $string;
                        }
                Severity: Major
                Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 4 hrs to fix

                  Method test_check_box has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function test_check_box()
                      {
                          $html = html();
                          $def_class = $html->CLASS_LABEL_CHECKBOX . ' ' . $html->CLASS_LABEL_CHECKBOX_INLINE;
                  
                  
                  Severity: Major
                  Found in .dev/tests/unit/class_html_test.Test.php - About 4 hrs to fix

                    Function get_asset_from_bower has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function get_asset_from_bower($name, $version = 'master', $asset_data = [], $asset_type)
                        {
                            if ( ! $name || ! $asset_data || ! isset($asset_data[$asset_type])) {
                                return false;
                            }
                    Severity: Minor
                    Found in plugins/assets/classes/yf_assets.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 search_used has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function search_used()
                        {
                            $exclude_paths = [
                                '*/.git/*',
                                '*/.dev/*',
                    Severity: Minor
                    Found in plugins/assets/admin_modules/yf_manage_assets.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 _show_block has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _show_block($input = [])
                        {
                            if ( ! isset($this->_blocks_infos)) {
                                $this->_blocks_infos = main()->get_data('blocks_all');
                            }
                    Severity: Minor
                    Found in plugins/sys/classes/yf_core_blocks.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 _db_change_if_ok has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _db_change_if_ok($table, $fields, $type, $extra = [])
                        {
                            $func = function ($table, $fields, $type, $extra, $form) {
                                if ( ! $table || ! $type || empty($_POST)) {
                                    return $form;
                    Severity: Minor
                    Found in plugins/form2/classes/yf_form2.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 _get_update_batch_sql has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _get_update_batch_sql($table, $values, $index)
                        {
                            $ids = [];
                            $final = [];
                            $where = [];
                    Severity: Minor
                    Found in plugins/db/classes/db/yf_db_query_builder_driver.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 _parse has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _parse($host, $url, $query, $url_str, $class_rewrite)
                        {
                            $s = '';
                            if (false !== strpos($url[0], '%')) {
                                $url[0] = urldecode($url[0]);
                    Severity: Minor
                    Found in plugins/rewrite/classes/rewrite/yf_rewrite_pattern_yf.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 _check_ip has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _check_ip($ip, $ignore_ips = '', $check_type = 'force')
                        {
                            $masks = [
                                '0.0.0.0/8',        // Current network (only valid as source address)    RFC 1700
                                '10.0.0.0/8',        // Private network    RFC 1918
                    Severity: Minor
                    Found in plugins/common/classes/common/yf_client_utils.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 _try_to_find has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function _try_to_find($input_name = '', $CUR_CHECKS = [], $where_search = '')
                        {
                            // Default value
                            $IS_FOUND = false;
                            $WHAT_FOUND = '';
                    Severity: Minor
                    Found in plugins/common/classes/common/yf_user_ban.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 _is_spider has a Cognitive Complexity of 33 (exceeds 5 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: Minor
                    Found in plugins/common/classes/common/yf_spider_detection.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 33 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function go($new_file_path, $name_in_form = 'image', $max_image_size = 0, $is_local = false)
                        {
                            // We do not want to user break our operation
                            ignore_user_abort(true);
                            // New name is required
                    Severity: Minor
                    Found in plugins/common/classes/common/yf_upload_image.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

                    Severity
                    Category
                    Status
                    Source
                    Language