Showing 3,246 of 4,217 total issues

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

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

    public function category_revision_checkout()
    {
        $type = 'category';
        $object = 'category_editor';
        $action = 'edit_item';

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

    public function product_clone()
    {
        $_GET['id'] = (int) ($_GET['id']);
        if ($_GET['id']) {
            $a = $this->_get_product($_GET['id']);

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

    public function _order_view()
    {
        if ($_POST['order_id']) {
            $_GET['id'] = (int) ($_POST['order_id']);
        } else {
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_order_view.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_nav_by_item_id has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_nav_by_item_id($item_id = 0, $cat_items = [], $STPL_NAME = '', $prepare_link_callback = null)
    {
        if (empty($STPL_NAME)) {
            $STPL_NAME = __CLASS__ . '/nav_item';
        }
Severity: Minor
Found in plugins/categories/classes/yf_cats.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 _attributes_save has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _attributes_save($object_id = 0)
    {
        if (empty($object_id)) {
            return;
        }

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

    public function _order_step_finish($FORCE_DISPLAY_FORM = false)
    {
        module('shop')->_basket_api()->clean();

        if (isset($_GET['page'])) {
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop__order_step_finish.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 _format_db_explain_result has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function _format_db_explain_result($explain_result = [])
    {
        if (empty($explain_result)) {
            return false;
        }
Severity: Minor
Found in plugins/logs/classes/logs/yf_logs_db_queries.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