Showing 3,246 of 4,217 total issues

Function _do has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _do($text = '', $params = [])
    {
        if ( ! strlen($text)) {
            return '';
        }
Severity: Minor
Found in plugins/common/classes/common/yf_utf8_clean.class.php - About 55 mins 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 _netpbm_rotate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _netpbm_rotate($source_file_path, $dest_file_path, $LIMIT)
    {
        $PATH_TO_NETPBM = $this->FOUND_NETPBM_PATH;
        $dest_file_path = $source_file_path;
        // Check operation system
Severity: Minor
Found in plugins/common/classes/common/yf_image_manip.class.php - About 55 mins 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 edit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit()
    {
        if ( ! $this->ENABLED_IMG_EDIT) {
            return false;
        }
Severity: Minor
Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 55 mins 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_cloud has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _create_cloud($cloud_data = [], $params = [])
    {
        if (empty($cloud_data)) {
            return '';
        }
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.class.php - About 55 mins 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 _netpbm_cut has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _netpbm_cut($source_file_path, $dest_file_path, $LIMIT_Width, $LIMIT_Height, $pos_left, $pos_top)
    {
        // Generate correct resize command for NetPBM library
        $PATH_TO_NETPBM = $this->FOUND_NETPBM_PATH;
        //        $dest_file_path = $source_file_path;
Severity: Minor
Found in plugins/common/classes/common/yf_image_manip.class.php - About 55 mins 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 pics_browser has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function pics_browser()
    {
        if (isset($_GET['active']) && $_GET['active'] == 1) {
            $active = ' AND p.active = \'1\' ';
        } elseif (isset($_GET['active']) && $_GET['active'] == 0) {

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

    public function order_product_add_ajax()
    {
        if (empty($_POST['order_id']) || empty($_POST['product_id'])) {
            return json_encode('ko');
        }
Severity: Minor
Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_orders.class.php - About 55 mins 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_check_first_revision has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _product_check_first_revision($type = false, $ids = false)
    {
        $db = $this->get_revision_db($type);
        if ($type == 'product_images') {
            $sql = 'SELECT COUNT(*) as cnt FROM ' . $db . ' WHERE product_id=' . $ids;

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

    public function show()
    {
        if (main()->ADMIN_GROUP != 1) {
            $admin_user = db()->get('SELECT * FROM ' . db('admin') . ' WHERE id=' . (int) main()->ADMIN_ID);
            if ($admin_user['go_after_login']) {
Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.class.php - About 55 mins 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 coupon_add has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function coupon_add()
    {
        if (main()->is_post()) {
            if ( ! $_POST['code']) {
                _re('Code must be entered');
Severity: Minor
Found in plugins/shop/admin_modules/manage_shop/yf_manage_shop_coupons.class.php - About 55 mins 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 edit_locale_stpl has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_locale_stpl()
    {
        no_graphics(true);
        if ( ! DEBUG_MODE || ! tpl()->ALLOW_INLINE_DEBUG) {
            return print 'Access denied';
Severity: Minor
Found in plugins/dynamic/modules/dynamic/yf_dynamic_edit.class.php - About 55 mins 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_methods_names_from_text has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_methods_names_from_text($text = '', $ONLY_PRIVATE_METHODS = false)
    {
        $methods = [];
        if (empty($text)) {
            return $methods;
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 55 mins 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 _data has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _data()
    {
        $_sub_action = [
            '0' => '- не выбрано -',
            'load' => 'загрузить',

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

    public function _init()
    {
        $supplier = db()->get('SELECT supplier_id, main_cat_id FROM ' . db('shop_admin_to_supplier') . ' WHERE admin_id=' . (int) (main()->ADMIN_ID));
        if ($supplier['supplier_id']) {
            $this->SUPPLIER_ID = $supplier['supplier_id'];
Severity: Minor
Found in plugins/shop/admin_modules/yf_manage_shop.class.php - About 55 mins 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 filter_save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filter_save()
    {
        $_GET['id'] = preg_replace('~[^0-9a-z_]+~ims', '', $_GET['id']);
        if ($_GET['id'] && false !== strpos($_GET['id'], $_GET['object'] . '__')) {
            $filter_name = $_GET['id'];
Severity: Minor
Found in plugins/shop/admin_modules/yf_manage_shop_revisions.class.php - About 55 mins 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 _site_map_items has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _site_map_items($sm_obj)
    {
        if ( ! is_object($sm_obj)) {
            return false;
        }
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop__site_map_items.class.php - About 55 mins 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_recursive_cat_ids has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_recursive_cat_ids($cat_id = 0, $all_cats = false)
    {
        $cat_id = (int) $cat_id;
        if (empty($all_cats)) {
            $all_cats = conf('all_cats');
Severity: Minor
Found in plugins/categories/classes/yf_cats.class.php - About 55 mins 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 novaposhta_ua__import_old has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function novaposhta_ua__import_old()
    {
        // get data
        // $file = '/tmp/warenhouses_ru.xls';
        // $content = file_get_contents( $file );

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

    public function _cache_fetch()
    {
        $cache = &$this->cache;
        // category
        $items = db()->from('sys_category_items')->where('cat_id', '=', $this->set_cat_id)->order_by('name')->all();

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

    protected function _save_upload_list($data = null)
    {
        $upload_list__file_name = $this->upload_list__file_name;
        $upload_list__field = $this->upload_list__field;
        $upload_list = &$this->upload_list;

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