Showing 3,246 of 4,217 total issues

Function tbl_link_active has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function tbl_link_active($name = '', $link = '', $extra = [], $replace = [], $form)
    {
        if (is_array($name)) {
            $extra = (array) $extra + $name;
            $name = $extra['name'];
Severity: Minor
Found in plugins/form2/classes/form2/yf_form2_tbl_funcs.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 _show_themes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_themes()
    {
        $themes = $this->_get_themes();

        $num_stpls_array = cache_get($this->CACHE_NAME, 60);
Severity: Minor
Found in plugins/tpl/admin_modules/yf_template_editor.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_plugins has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_plugins()
    {
        $folder = '';
        $suffix = '/';
        $libs = [];
Severity: Minor
Found in plugins/sys/classes/yf_core_api.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 _field_type has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _field_type($type = '')
    {
        $type = trim(strtolower($type));
        if (strpos($type, 'int') !== false) {
            $type = 'int';
Severity: Minor
Found in plugins/form2/classes/form2/yf_form2_auto.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 create_table has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_table($table_name, $db)
    {
        $table_found = false;
        if (empty($table_name)) {
            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 _send_http_status has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _send_http_status($code = null, $status = null)
    {
        $code = (int) $code;
        $protocol = null;
        $status = null;
Severity: Minor
Found in plugins/api/classes/yf_api.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 go has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function go($new_file_path, $name_in_form = 'archive')
    {
        ignore_user_abort(true);
        if (empty($new_file_path)) {
            trigger_error(__CLASS__ . ': New file path id required', E_USER_WARNING);
Severity: Minor
Found in plugins/common/classes/common/yf_upload_archive.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 crop has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function crop($source_file_path, $dest_file_path, $LIMIT_X, $LIMIT_Y, $pos_left, $pos_top)
    {
        // Check source file
        if ( ! file_exists($source_file_path) || ! filesize($source_file_path) || ! is_readable($source_file_path)) {
            trigger_error('CROP_IMG: Source file is empty', E_USER_WARNING);
Severity: Minor
Found in plugins/common/classes/common/yf_image_manip.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_search_engine_url has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function is_search_engine_url($url = '')
    {
        $url = trim($url);
        if ( ! strlen($url)) {
            return false;
Severity: Minor
Found in plugins/common/classes/common/yf_spider_detection.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 _prepare_invoice_body has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _prepare_invoice_body($order_id = false)
    {
        $_class_price = $this->_class_price;
        $_class_units = $this->_class_units;
        $_class_region = $this->_class_region;

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

    public function _show_filter()
    {
        if ( ! in_array($_GET['action'], $this->_avail_filters)) {
            return false;
        }

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

    public function delete()
    {
        $user_id = (int) ($_GET['id']);
        if ( ! $user_id) {
            return false;
Severity: Minor
Found in plugins/user/admin_modules/yf_manage_users.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 _recursive_get_children_ids has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _recursive_get_children_ids($cat_id = 0, $cat_items = [], $get_sub_children = true, $return_array = false)
    {
        $children_ids = [];
        if (empty($cat_id)) {
            return $children_ids;
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 _recursive_get_parents_ids has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _recursive_get_parents_ids($cat_id = 0, $cat_items = [])
    {
        $parents_ids = [];
        if (empty($cat_id)) {
            return $parents_ids;
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 confirm has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function confirm()
    {
        // Send registration confirmation email
        if ( ! $this->CONFIRM_REGISTER) {
            return tpl()->parse('@object/confirm_messages', ['msg' => 'confirm_not_needed']);
Severity: Minor
Found in plugins/user/modules/yf_register.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 _order_step_select_payment has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _order_step_select_payment($FORCE_DISPLAY_FORM = false)
    {
        // Show previous form if needed
        if (common()->_error_exists() || empty($_POST)) {
            return module('shop')->_order_step_delivery();

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

    public function asset($type = '')
    {
        session_write_close();
        no_graphics(true);
        $name = strtolower(preg_replace('~[^a-z0-9_-]+~ims', '', trim($_GET['id'])));
Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_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 product_details has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function product_details()
    {
        if ( ! $_GET['id']) {
            return is_redirect('./?object=shop');
        }
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_product_details.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 search has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function search($start_dirs, $pattern_include = '', $pattern_exclude = '', $pattern_find)
    {
        if ( ! is_array($start_dirs)) {
            $start_dirs = [$start_dirs];
        }
Severity: Minor
Found in classes/yf_dir.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 _force_close_bb_codes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function _force_close_bb_codes($text = '')
    {
        $this->_preload_data();
        $add_text = '';
        $opened_codes = $closed_codes = [];
Severity: Minor
Found in plugins/content/classes/yf_bb_codes.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