Showing 3,246 of 4,217 total issues

Function refresh_modules_list has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function refresh_modules_list($silent = false)
    {
        // Cleanup duplicate records
        $q = db()->query('SELECT name, COUNT(*) AS num FROM ' . db('admin_modules') . ' GROUP BY name HAVING num > 1');
        while ($a = db()->fetch_assoc($q)) {
Severity: Minor
Found in plugins/admin/admin_modules/yf_admin_modules.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 list_indexes has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function list_indexes($table, $extra = [], &$error = false)
    {
        if (is_array($table)) {
            $extra = (array) $extra + $table;
            $table = '';
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_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 update has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function update(array $data, $params = [])
    {
        $table = $params['table'] ?: $this->get_table();
        if ( ! $table) {
            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 _ids_sql_from_array has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _ids_sql_from_array(array $ids)
    {
        $out = [];
        foreach ((array) $ids as $v) {
            if (is_array($v)) {
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 _show_for has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_for($obj, $id = '')
    {
        $id = $id ?: $_GET['id'];
        $action = $_GET['action'];
        if (preg_match('~^[a-z0-9_]+$~ims', $id)) {
Severity: Minor
Found in plugins/docs/modules/yf_docs.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_error_message has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_error_message($cur_error_msg = '', $clear_error = true)
    {
        // Prevent recursive display
        if (strlen($cur_error_msg) && false !== strpos($cur_error_msg, '<!--YF_ERROR_MESSAGE_START-->')) {
            return t($cur_error_msg);
Severity: Minor
Found in plugins/common/classes/yf_common.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 es has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function es($string)
    {
        if ($string === null || $string === 'NULL') {
            return 'NULL';
        }
Severity: Minor
Found in plugins/db/classes/yf_db.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_static_conf has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_static_conf($type = false, $value = false, $translate = true)
    {

        //tree signs needs for status with id equal 0
        if ($type === false) {
Severity: Minor
Found in plugins/common/classes/common/yf_common_static_conf.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_image_upload has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _product_image_upload($product_id)
    {
        $products_images_dir = module('manage_shop')->products_img_dir;

        $d = sprintf('%09s', $product_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 _attributes_html has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _attributes_html($object_id = 0, $only_selected = false)
    {
        $object_id = $params['object_id'];
        $only_selected = $params['only_selected'];

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

    protected function _api_upload()
    {
        $file = $_FILES['file'];
        if (empty($file) || $file['error'] != UPLOAD_ERR_OK) {
            $this->_reject('PHP: Entity Too Large', '500 Internal Server Error', 500);

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

    public function refresh_modules_list($silent = false)
    {
        // Cleanup duplicate records
        $q = db()->query('SELECT name, COUNT(*) AS num FROM ' . db('user_modules') . ' GROUP BY name HAVING num > 1');
        while ($a = db()->fetch_assoc($q)) {
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.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 basket has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function basket($params = [])
    {
        $STPL_NAME = $params['STPL'] ? $params['STPL'] : 'shop/basket';

        $basket_contents = module('shop')->_basket_api()->get_all();
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_basket.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 edit_item has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_item()
    {
        $item_info = db()->query_fetch('SELECT * FROM ' . db('category_items') . ' WHERE id=' . (int) ($_GET['id']));
        if ( ! $item_info['id']) {
            return _e('No such item!');
Severity: Minor
Found in plugins/categories/admin_modules/yf_category_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 _order_pay_authorize_net has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function _order_pay_authorize_net($params = [])
    {
        $order_info = $params['order_info'];
        $params = $params['params'];

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

    public function _send_main_headers($content_length = 0)
    {
        if (headers_sent($file, $line) || conf('no_headers')) {
            //            trigger_error('Headers were sent in '.$file.':'.$line, E_USER_WARNING);
            return false;
Severity: Minor
Found in classes/yf_graphics.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 count_files has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function count_files($start_dir, $pattern_include = '', $pattern_exclude = '')
    {
        if ( ! $start_dir || ! file_exists($start_dir)) {
            return false;
        }
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 edit has a Cognitive Complexity of 12 (exceeds 5 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

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 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit()
    {
        $a = $this->_get_info();
        if ( ! $a) {
            return _404();
Severity: Minor
Found in plugins/content/admin_modules/yf_manage_news.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 dirsize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public function dirsize($start_dir, $pattern_include = '', $pattern_exclude = '')
    {
        if ( ! $start_dir || ! file_exists($start_dir)) {
            return false;
        }
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

Severity
Category
Status
Source
Language