Showing 3,246 of 4,217 total issues

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

    public function chained_wrapper($replace = [], $params = [])
    {
        if ($replace && is_string($replace)) {
            $sql = $replace;
            $this->_sql = $sql;
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 user_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function user_info($name = '', $desc = '', $extra = [], $replace = [], $form)
    {
        $name = 'user_name';
        $user_id = $form->_replace['user_id'];

Severity: Minor
Found in plugins/form2/classes/form2/yf_form2_info.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 _check_multi_accounts has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_multi_accounts()
    {
        if (empty($_SESSION[$this->VAR_USER_ID]) || empty($_SESSION[$this->VAR_USER_GROUP_ID])) {
            return false;
        }
Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_user.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 _html_control has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _html_control($name, $values, $extra = [], $replace = [], $func_html_control = '')
    {
        if ( ! is_array($extra)) {
            $extra = [];
        }
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 list_foreign_keys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function rename_database($db_name, $new_name, $extra = [], &$error = false)
    {
        if ( ! strlen($db_name)) {
            $error = 'db_name is empty';
            return false;
Severity: Minor
Found in plugins/db/classes/db/yf_db_utils_driver.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/admin/admin_modules/yf_admin_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 send has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function send(array $params = [], &$error_message = '')
    {
        require_php_lib('sendgrid');

        $error_message = null;
Severity: Minor
Found in plugins/email/classes/mail/yf_mail_driver_sendgrid.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 add_index has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function add_index($table, $index_name = '', $fields = [], $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 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 dump has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function dump($params = [])
    {
        $utils = $this->db->utils();
        $installer = $this->db->installer();
        $db_prefix = $this->db->DB_PREFIX;
Severity: Minor
Found in plugins/db/classes/db/yf_db_migrator.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 send has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function send(array $params = [], &$error_message = '')
    {
        $CRLF = "\r\n";
        $TAB = "\t";

Severity: Minor
Found in plugins/email/classes/mail/yf_mail_driver_internal.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 list_views has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function _connect($params = [])
    {
        if ( ! $this->DRIVER) {
            return null;
        }
Severity: Minor
Found in plugins/cache/classes/yf_cache.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_access_token has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_access_token()
    {
        $access_token = $this->_storage_get('access_token');
        if ($access_token) {
            return $access_token;
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver1.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 divide_pages has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function divide_pages($sql = '', $url_path = '', $render_type = '', $records_on_page = 0, $num_records = 0, $tpls_path = '', $add_get_vars = 1, $extra = [])
    {
        if (is_array($sql)) {
            $sql_is_array = true;
        } elseif (is_callable($sql)) {
Severity: Minor
Found in plugins/common/classes/yf_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 _model_load has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _model_load($name)
    {
        $main = main();
        $model_class = $name . '_model';
        $custom_storages = &$main->_custom_class_storages;
Severity: Minor
Found in plugins/db/classes/yf_db.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 update_batch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function update_batch($table, $data, $index = null, $only_sql = false)
    {
        if ($this->DB_REPLICATION_SLAVE && ! $only_sql) {
            return false;
        }
Severity: Minor
Found in plugins/db/classes/yf_db.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 _ip_is_banned has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _ip_is_banned($CUR_IP = '')
    {
        if ( ! $CUR_IP) {
            $CUR_IP = common()->get_ip();
        }
Severity: Minor
Found in plugins/common/classes/yf_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 _gd_rotate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _gd_rotate($original_path, $dest_file_path, $angle)
    {
        if ( ! extension_loaded('gd')) {
            return false;
        }
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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function create($cloud_data = [], $params = [])
    {
        if (empty($cloud_data)) {
            return '';
        }
Severity: Minor
Found in plugins/common/classes/common/yf_common_tags_cloud.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

Severity
Category
Status
Source
Language