Showing 3,246 of 4,217 total issues

Function clone_cat has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function clone_cat()
    {
        $_GET['id'] = (int) ($_GET['id']);
        if ( ! empty($_GET['id'])) {
            $cat_info = db()->query_fetch('SELECT * FROM ' . db('categories') . ' WHERE id=' . (int) ($_GET['id']));
Severity: Minor
Found in plugins/categories/admin_modules/yf_category_editor.class.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function filter_save()
    {
        $filter_name = $_GET['object'];
        if ($_GET['page'] == 'clear') {
            $_SESSION[$filter_name] = [];
Severity: Minor
Found in plugins/user/admin_modules/yf_watch_online_users.class.php - About 35 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 rollback_revision has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function rollback_revision()
    {
        $_GET['id'] = (int) ($_GET['id']);
        $revision_data = db()->get('SELECT * FROM ' . db('shop_revisions') . ' WHERE id=' . $_GET['id']);
        if (empty($revision_data)) {
Severity: Minor
Found in plugins/shop/admin_modules/yf_manage_shop_revisions.class.php - About 35 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_tip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_tip()
    {
        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 35 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_user_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_user_info()
    {
        if ( ! empty($this->_user_info)) {
            return '';
        }
Severity: Minor
Found in plugins/user/modules/yf_user_profile.class.php - About 35 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 _upload_item__get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _upload_item__get($id)
    {
        $result = [
            'status' => 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 products_similar_by_basket has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function products_similar_by_basket($id)
    {
        $sql_order_id = 'SELECT order_id FROM ' . db('shop_order_items') . ' WHERE product_id =  ' . $id;
        $orders = db()->query($sql_order_id);
        while ($A = db()->fetch_assoc($orders)) {
Severity: Minor
Found in plugins/shop/modules/shop/yf_shop_products_similar_by_basket.class.php - About 35 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 _send_custom_http_headers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _send_custom_http_headers()
    {
        // Override headers
        $conf_headers = conf('http_headers');
        if (is_array($conf_headers)) {
Severity: Minor
Found in classes/yf_graphics.class.php - About 35 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_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_data($name = '', $force_ttl = 0, $params = [])
    {
        DEBUG_MODE && $time_start = microtime(true);
        if (empty($name)) {
            return null;
Severity: Minor
Found in classes/yf_main.class.php - About 35 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_ticks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_ticks($data)
    {
        $max = 0;
        foreach ((array) $data as $val) {
            if ($val['val'] > $max) {
Severity: Minor
Found in plugins/charts/classes/yf_charts.class.php - About 35 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 _debug_memcached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_memcached(&$params = [])
    {
        if ( ! $this->SHOW_MEMCACHED_INFO) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 35 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 _read_last_lines has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _read_last_lines($file, $amount)
    {
        if ( ! is_readable($file)) {
            return _e('Error!. File ' . $file . ' is not readable! Please check permissions.');
        }
Severity: Minor
Found in plugins/search/admin_modules/yf_manage_sphinx.class.php - About 35 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 _debug_globals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_globals(&$params = [])
    {
        if ( ! $this->SHOW_GLOBALS) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 35 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 text_filter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function text_filter($str)
    {
        $str = htmlspecialchars($str);
        if (defined('SITE_BAD_WORD_FILTER') && SITE_BAD_WORD_FILTER == 1) {
            $bad_words = conf('BAD_WORDS_ARRAY');
Severity: Minor
Found in classes/yf_utils.class.php - About 35 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 highlight has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function highlight($string, $search_words, $tag = 'span', $class = 's_word')
    {
        if (empty($string) || empty($search_words)) {
            return $string;
        }
Severity: Minor
Found in classes/yf_utils.class.php - About 35 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 spider_detection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function spider_detection()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        if ( ! $this->SPIDERS_DETECTION) {
            return false;
Severity: Minor
Found in classes/yf_main.class.php - About 35 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_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_info($id = null, $lang = null)
    {
        $id = isset($id) ? $id : $_GET['id'];
        $lang = isset($lang) ? $lang : $_GET['page'];
        $a = db()->from(self::table)
Severity: Minor
Found in plugins/content/admin_modules/yf_manage_tips.class.php - About 35 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 set_symbols_array has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_symbols_array($input = [])
    {
        if (empty($input)) {
            return false;
        }
Severity: Minor
Found in plugins/content/classes/yf_captcha.class.php - About 35 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 _set_new_size_auto has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _set_new_size_auto()
    {
        if (empty($this->source_width) || empty($this->source_height)) {
            if ( ! $this->SILENT_MODE) {
                trigger_error('Missing source image sizes!', E_USER_WARNING);
Severity: Minor
Found in plugins/content/classes/yf_resize_images.class.php - About 35 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 _preload_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _preload_data()
    {
        if ($this->_preload_complete) {
            return true;
        }
Severity: Minor
Found in plugins/content/classes/yf_bb_codes.class.php - About 35 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

Severity
Category
Status
Source
Language