Showing 4,217 of 4,217 total issues

Method _debug_stpls has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function _debug_stpls(&$params = [])
    {
        if ( ! $this->SHOW_STPLS) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 1 hr to fix

    Method call_class_method has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function call_class_method($class_name = '', $custom_path = '', $method_name = '', $method_params = '', $tpl_name = '', $silent = false, $use_cache = false, $cache_ttl = -1, $cache_key_override = '')
        {
            if ( ! strlen($class_name) || ! strlen($method_name)) {
                return false;
            }
    Severity: Minor
    Found in classes/yf_main.class.php - About 1 hr to fix

      Method edit has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function edit()
          {
              $id = (int) $_GET['id'];
              if ($id) {
                  $a = from(self::table)->whereid($id)->get();
      Severity: Minor
      Found in plugins/content/admin_modules/yf_manage_faq.class.php - About 1 hr to fix

        Method test_real_escape_string has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function test_real_escape_string()
            {
                if ($this->_need_skip_test(__FUNCTION__)) {
                    return;
                }
        Severity: Minor
        Found in .dev/tests/functional/db/class_db_real_mysql_test.Test.php - About 1 hr to fix

          Method import_base_db_structure has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function import_base_db_structure()
              {
                  $import_tables = [
                      'dashboards',
                      'static_pages',
          Severity: Minor
          Found in .dev/install/install.php - About 1 hr to fix

            Function _url_control has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _url_control()
                {
                    if ( ! $this->ALLOW_URL_CONTROL) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/assets/classes/yf_assets.class.php - About 1 hr 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 _user_message has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function _user_message($options = null)
                {
                    $url = &$this->url;
                    // import operation
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
            Severity: Minor
            Found in plugins/payment/admin_modules/yf_manage_payout.class.php - About 1 hr 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 _user_message has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function _user_message($options = null)
                {
                    $url = &$this->url;
                    // import operation
                    is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');

            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 edit_item has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function edit_item()
                {
                    // TODO: save file revision to db on each save
                    if ( ! empty($_GET['id'])) {
                        $file_name = urldecode($_GET['id']);
            Severity: Minor
            Found in plugins/sys/admin_modules/yf_file_manager.class.php - About 1 hr 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 _action_on_block_denied has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _action_on_block_denied($block_name = '')
                {
                    if ($block_name == 'center_area') {
                        if ($this->TASK_DENIED_403_HEADER) {
                            header(($_SERVER['SERVER_PROTOCOL'] ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1') . ' 403 Forbidden');
            Severity: Minor
            Found in plugins/sys/classes/yf_core_blocks.class.php - About 1 hr 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_sites_info has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _get_sites_info()
                {
                    foreach ((array) $this->info as $site_id => $info) {
                        $tmp_string = '';
                        $found = [];
            Severity: Minor
            Found in plugins/sys/classes/core_api/yf_core_api_sites_info.class.php - About 1 hr 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_sites_info has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _get_sites_info()
                {
                    // Process config files
                    foreach ((array) $this->info as $site_id => $info) {
                        $tmp_string = '';
            Severity: Minor
            Found in plugins/sys/classes/yf_sites_info.class.php - About 1 hr 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 ui_range has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function ui_range($name, $desc = '', $extra = [], $replace = [], $form)
                {
                    if (is_array($desc)) {
                        $extra += $desc;
                        $desc = '';
            Severity: Minor
            Found in plugins/form2/classes/form2/yf_form2_ui_range.class.php - About 1 hr 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 update_batch has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function update_batch($table, array $data, $index = null, $only_sql = false, $params = [])
                {
                    if ( ! $index) {
                        $index = $this->get_key_name($table);
                    }
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr 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 _sql_part_to_array has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _sql_part_to_array($part, $data = null, $config = null, $return_raw = false)
                {
                    if ( ! $part) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr 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_where_all_numeric has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _is_where_all_numeric(&$where)
                {
                    if (empty($where) || ( ! is_array($where) && ! is_numeric($where))) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 1 hr 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 alter_table has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function alter_table($table_name, $column_name, $db)
                {
                    if ( ! $this->get_lock()) {
                        return false;
                    }
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_installer.class.php - About 1 hr 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 compare has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function compare($params = [])
                {
                    $installer = $this->db->installer();
                    $utils = $this->db->utils();
                    $db_prefix = $this->db->DB_PREFIX;
            Severity: Minor
            Found in plugins/db/classes/db/yf_db_migrator.class.php - About 1 hr 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_browser_info has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _get_browser_info()
                {
                    if ( ! empty($_SERVER['HTTP_USER_AGENT'])) {
                        $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
                    } elseif ( ! isset($HTTP_USER_AGENT)) {
            Severity: Minor
            Found in plugins/common/classes/common/yf_client_utils.class.php - About 1 hr 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 upload_file has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function upload_file()
                {
                    no_graphics(true);
                    if ( ! MAIN_TYPE_ADMIN) {
                        return print 'access denied';
            Severity: Minor
            Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 1 hr 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