Showing 3,246 of 4,217 total issues

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

    public function _tinymce_html($extra = [], $replace = [], $form)
    {
        if ( ! is_array($extra)) {
            return '';
        }
Severity: Minor
Found in plugins/form2/classes/form2/yf_form2_tinymce.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 _row_html has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _row_html($content, $extra = [], $replace = [])
    {
        if ( ! strlen($content) && ($extra['hide_empty'] || $this->_params['hide_empty'])) {
            return '';
        }
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 input has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function save_and_clear($name = '', $desc = '', $extra = [], $replace = [])
    {
        if ( ! $name) {
            $name = 'clear_link';
            $r = $replace ? $replace : $this->_replace;
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 show has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $r = [];
        foreach ((array) conf() as $k => $v) {
            if (is_array($v)) {
Severity: Minor
Found in plugins/conf/admin_modules/yf_settings.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 _success_login_redirect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _success_login_redirect($user_info = [], $group_info = [])
    {
        if ($this->INSIDE_LOGIN_FROM_ADMIN) {
            return js_redirect('/');
        // Auto-redirect to the page before login form if needed
Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_user.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 template_select_box has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function save_and_back($name = '', $desc = '', $extra = [], $replace = [])
    {
        if ( ! $name) {
            $name = 'back_link';
            $r = $replace ? $replace : $this->_replace;
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 method_select_box has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function _remove_items_by_name($name = '')
    {
        if (is_array($name)) {
            $func = __FUNCTION__;
            foreach ((array) $name as $_name) {
Severity: Minor
Found in plugins/form2/classes/yf_form2.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 _prepare_inline_error has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function _do_logout($no_redirect = false)
    {
        if ($this->STORE_ONLINE_USERS) {
            db()->_add_shutdown_query('DELETE FROM ' . db('online') . ' WHERE user_id=' . (int) ($_SESSION[$this->VAR_USER_ID]));
            $MAIN = &main();
Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_user.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 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    public function __clone()
    {
        $keep_prefix = 'CLASS_';
        $keep_len = strlen($keep_prefix);
        $keep_prefix2 = 'CONF_';
Severity: Minor
Found in plugins/form2/classes/yf_form2.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/email/admin_modules/yf_manage_emails.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 create_column_line has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function create_column_line($name = '', $v = [], $params = [])
    {
        if (is_array($name)) {
            $v = $name;
            $name = $v['name'];
Severity: Minor
Found in plugins/db/classes/db/yf_db_ddl_parser_mysql.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 increment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function increment($field, $step = 1, $as_sql = false)
    {
        if ( ! $field) {
            return false;
        }
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.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 alter_table has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function insert(array $data, $params = [])
    {
        if (empty($data)) {
            return false;
        }
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.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 _migration_commands_into_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _migration_commands_into_string($cmds = [], $num_tabs = 2)
    {
        // TODO: use new syntax with create_table() closures
        $TAB = "\t";
        $prefix = str_repeat($TAB, $num_tabs) . '$utils->';
Severity: Minor
Found in plugins/db/classes/db/yf_db_migrator.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