Showing 3,246 of 4,217 total issues

Function pcntl_test has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function pcntl_test()
    {
        if (is_console()) {
            // var
            $is_terminate = &self::$_pcntl_is_terminate;
Severity: Minor
Found in plugins/sys/classes/yf_pcntl_signal.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 _form has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _form($data, $options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_payeer.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 _form has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _form($data, $options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_api__provider_webmoney.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_all_hooks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_all_hooks($section = 'all', $hooks_prefix = '_hook_')
    {
        $hooks_pl = strlen($hooks_prefix);
        $hooks = [];
        foreach ((array) $this->get_private_methods($section) as $module => $methods) {
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 _form has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _form($data, $options = null)
    {
        if ( ! $this->ENABLE) {
            return  null;
        }

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

    public function unzip_item()
    {
        $dir_name = urldecode($_POST['dir_name']);
        $_old_dir_name = str_replace('\\', '/', getcwd());
        foreach ((array) $_POST as $k => $name) {
Severity: Minor
Found in plugins/sys/admin_modules/yf_file_manager.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_selected has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _prepare_selected($name, &$extra, &$r)
    {
        $is_array = strpos($name, '[');
        if ($is_array !== false) {
            $value = &$r;
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 city_box has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    public function _escape_key($key = '')
    {
        $key = trim(trim($key), '`');
        if ( ! strlen($key)) {
            return '';
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 create_trigger has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_trigger($name, $table, $trigger_time, $trigger_event, $trigger_body, $extra = [], &$error = false)
    {
        if (strpos($name, '.') !== false) {
            list($db_name, $name) = explode('.', trim($name));
        }
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 _init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init($params = [])
    {
        // Assign group_id = 1 for guests
        if (empty($_SESSION['user_group'])) {
            $_SESSION['user_group'] = 1;
Severity: Minor
Found in plugins/cache/classes/yf_output_cache.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 insert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function insert($table, $data, $only_sql = false, $replace = false, $ignore = false, $on_duplicate_key_update = false, $extra = [])
    {
        if ($this->DB_REPLICATION_SLAVE && ! $only_sql) {
            return false;
        }
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 update has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($table, $data, $where, $only_sql = false, $extra = [])
    {
        if ($this->DB_REPLICATION_SLAVE && ! $only_sql) {
            return false;
        }
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_deep_array has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_deep_array($sql, $max_levels = 0, $use_cache = true)
    {
        if ( ! strlen($sql)) {
            return false;
        }
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 _gd_crop has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _gd_crop($source_path, $dest_file_path, $crop_width, $crop_height, $pos_left, $pos_top)
    {
        if ( ! extension_loaded('gd')) {
            return false;
        }
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 _apply_badges has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _apply_badges($text, $extra = [], $field = null)
    {
        if ($extra['badge']) {
            $badge = is_array($extra['badge']) && isset($extra['badge'][$field]) ? $extra['badge'][$field] : $extra['badge'];
            if ($badge) {
Severity: Minor
Found in plugins/table2/classes/yf_table2.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_rss_feed_array has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_rss_feed_array($rss_url = '', $feed_ttl = 3600, $num_items = 15)
    {
        require_php_lib('yf_domit');

        // Prepare cache params
Severity: Minor
Found in plugins/common/classes/common/yf_rss_data.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 _init has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        if ( ! extension_loaded('imagick')) {
            $this->ALLOW_IMAGICK = false;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_make_thumb.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 delete_img has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete_img()
    {
        $res = [];
        if ($this->ENABLED_IMG_DELETE && is_ajax() && is_post() && ! empty($_POST['path'])) {
            $fs_path = parse_url($_POST['path'], PHP_URL_PATH);
Severity: Minor
Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.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