Showing 3,246 of 4,217 total issues

Function _apply_custom_fields has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _apply_custom_fields($cur_menu_info, $menu_items)
    {
        $custom_fields = [];
        if ($cur_menu_info['custom_fields']) {
            foreach (explode(',', str_replace(';', ',', trim($cur_menu_info['custom_fields']))) as $f) {
Severity: Minor
Found in plugins/sys/classes/yf_core_menu.class.php - About 2 hrs 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 _check_operations has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_operations($type = 'payout')
    {
        $payment_api = &$this->payment_api;
        $successful_operations = [];
        switch ($type) {
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_bitaps.class.php - About 2 hrs 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 info has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function info($name, $desc = '', $extra = [], $replace = [])
    {
        if (is_array($desc)) {
            $extra = (array) $extra + $desc;
            $desc = '';
Severity: Minor
Found in plugins/form2/classes/yf_form2.class.php - About 2 hrs 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_github_link has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_github_link($input, $section = 'all')
    {
        $is_module = false;
        $is_func = false;
        if (is_array($input)) {
Severity: Minor
Found in plugins/sys/classes/yf_core_api.class.php - About 2 hrs 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_comments has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_comments($NUM_NEWEST_COMMENTS, $user_id = '')
    {
        foreach ((array) module('comments')->COMMENT_LINKS as $key => $value) {
            $where .= 'object_name="' . $key . '"';
            if ($value !== end(module('comments')->COMMENT_LINKS)) {
Severity: Minor
Found in plugins/comments/modules/comments/yf_comments_integration.class.php - About 2 hrs 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 _sort_to_tree has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _sort_to_tree($comment, $level = 0)
    {
        if (empty($comment)) {
            return false;
        }
Severity: Minor
Found in plugins/comments/modules/yf_comments.class.php - About 2 hrs 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_column has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function compare_column($c1, $c2)
    {
        $changes = [];
        $skip = [
            'charset',
Severity: Minor
Found in plugins/db/classes/db/yf_db_migrator.class.php - About 2 hrs 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 query_fetch has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function query_fetch($sql, $use_cache = true, $assoc = true, $return_sql = false)
    {
        if ( ! strlen($sql)) {
            return false;
        }
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 2 hrs 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 _init_settings has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init_settings($params = [])
    {
        // backwards compatibility
        if ($this->FILES_TTL) {
            $this->TTL = $this->FILES_TTL;
Severity: Minor
Found in plugins/cache/classes/yf_cache.class.php - About 2 hrs 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 alternate_remote_file_size has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function alternate_remote_file_size($url, $retry = 3)
    {
        $method = 'GET';

        $time_start = microtime(true);
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.class.php - About 2 hrs 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_total_records has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_total_records($sql = '', $num_records = 0, $extra = [])
    {
        $sql_callback = $extra['sql_callback'];
        if (is_array($sql)) {
            $total_records = count((array) $sql);
Severity: Minor
Found in plugins/common/classes/common/yf_divide_pages.class.php - About 2 hrs 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 load_spiders_ips has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function load_spiders_ips()
    {
        $ext = '.txt';
        $ext_len = strlen($ext);
        $pattern = '{,plugins/*/}share/spiders/*' . $ext;
Severity: Minor
Found in plugins/common/classes/common/yf_spider_detection.class.php - About 2 hrs 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_relative_path has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_relative_path($target, $fromdir)
    {
        // Check that the fromdir has a trailing slash, otherwise realpath will
        // strip the last directory name off
        if (($fromdir[strlen($fromdir) - 1] != '\\') && ($fromdir[strlen($fromdir) - 1] != '/')) {
Severity: Minor
Found in plugins/common/classes/common/yf_other_common.class.php - About 2 hrs 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 _do_delete has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _do_delete($r, $id, $keys_to_del = [])
    {
        if ( ! $keys_to_del) {
            return false;
        }
Severity: Minor
Found in plugins/redis/admin_modules/yf_manage_redis.class.php - About 2 hrs 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 attribute_add has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function attribute_add()
    {
        if (main()->is_post()) {
            if (empty($_POST['title'])) {
                _re('Title is required');

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

    public function _db_get($options)
    {
        $cache = &$this->cache;
        $_ = $options;
        $_name = $_['name'];

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

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

    public function view($params = [])
    {
        if ( ! is_array($params)) {
            $params = [];
        }
Severity: Minor
Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 2 hrs 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_site_title has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_site_title()
    {
        if (defined('SITE_ADVERT_NAME')) {
            $title = SITE_ADVERT_NAME;
        }
Severity: Minor
Found in classes/yf_graphics.class.php - About 2 hrs 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 _server_info has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function _server_info($server_id)
    {
        $cached_server_info = &main()->_cached_server_info;
        if (is_numeric($server_id)) {
            $server_id = (int) $server_id;
Severity: Minor
Found in classes/yf_utils.class.php - About 2 hrs 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