Showing 3,246 of 4,217 total issues

Function _debug_get_vars has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_get_vars($string = '')
    {
        $not_replaced = [];
        $patterns = [
            '/\{([a-z0-9\_]{1,64})\}/ims',
Severity: Minor
Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.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_begin has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function form_begin($name = '', $method = '', $extra = [], $replace = [])
    {
        if (is_array($name)) {
            $extra = (array) $extra + $name;
            $name = '';
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 parse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function parse($name, $replace = [], $params = [])
    {
        $name = strtolower(trim($name));
        // Support for the driver name in prefix, example: "twig:user/account", "smarty:user/account"
        if (strpos($name, ':') !== false) {
Severity: Minor
Found in plugins/tpl/classes/yf_tpl.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 edit_stpl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_stpl()
    {
        $theme_name = $_GET['theme'];
        $stpl_name = $_GET['name'];
        if ( ! validate([$theme_name, $stpl_name], 'trim|required')) {
Severity: Minor
Found in plugins/tpl/admin_modules/yf_template_editor.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 tpl_row has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function tpl_row($type = 'input', $replace = [], $name = '', $desc = '', $extra = [])
    {
        $name = trim($name);
        if ($name && $name[0] == '%') {
            $_name = substr($name, 1);
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 _api_user_select_box has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _api_user_select_box($options = null)
    {
        // etc
        $api = _class('api');
        $api->JSON_VULNERABILITY_PROTECTION = false;
Severity: Minor
Found in plugins/form2/classes/yf_form_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 tbl_link has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function ajax($force_id = false)
    {
        $id = (int) ($force_id ?: $_GET['id']);
        $admin = from(self::table)->whereid($id)->get();
        if ( ! $id || ! $admin) {
Severity: Minor
Found in plugins/admin/admin_modules/yf_admin.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_key_name has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_key_name($table = '')
    {
        $pk = '';
        if (strlen($table)) {
            if (main()->USE_SYSTEM_CACHE) {
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_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 _cleanup_table_sql_php has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _cleanup_table_sql_php($sql_php = [], $db_prefix = '')
    {
        $prefix_len = strlen($db_prefix);
        foreach ((array) $sql_php['fields'] as $field_name => $field_info) {
            $sql_php['fields'][$field_name] = $this->_cleanup_column_sql_php($field_info);
Severity: Minor
Found in plugins/db/classes/db/yf_db_migrator.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 connect has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function connect()
    {
        $dsn = 'mysql:host=' . $this->params['host'];
        if ($this->params['port'] && $this->params['port'] != $this->DEF_PORT) {
            $dsn .= ';port=' . $this->params['port'];
Severity: Minor
Found in plugins/db/classes/db/yf_db_driver_pdo_mysql.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 truncate_database has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function truncate_database($db_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_mysql.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 _process_link_params has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _process_link_params($link, $row = [], $extra = [])
    {
        if ( ! strlen($link) || empty($row) || false === strpos($link, '%')) {
            return $link;
        }
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 footer_link has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function footer_link($name, $link, $extra = [])
    {
        $item = [
            'type' => __FUNCTION__,
            'name' => $name,
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 go has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function go($text = '')
    {
        $cur_page_md5 = md5($_GET['object'] . '%%' . $_GET['action'] . '%%' . $_GET['id']);
        // Verify and send email
        if ( ! empty($_POST['go'])) {
Severity: Minor
Found in plugins/common/classes/common/yf_email_page.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 _display_preview has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _display_preview($params = [], $template = '')
    {
        $replace = $params['replace'];
        $PARENT_OBJECT = $_REQUEST['parent_object'];
        $PARENT_ACTION = $_REQUEST['parent_action'];
Severity: Minor
Found in plugins/common/classes/common/yf_preview.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_oauth_header has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_oauth_header($url, $params, $method = 'POST', $oauth_token_secret = '', $add_to_sign = [])
    {
        if ( ! is_array($params)) {
            $params = [];
        }
Severity: Minor
Found in plugins/oauth/classes/oauth/yf_oauth_driver1.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        // Set found paths
        if (empty($this->FOUND_NETPBM_PATH) && defined('NETPBM_PATH') && NETPBM_PATH != '') {
            $this->FOUND_NETPBM_PATH = NETPBM_PATH;
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 _show_suggesting_messages has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_suggesting_messages()
    {
        $admin_modules = module('admin_modules')->_get_modules();
        $user_modules_methods = module('admin_modules')->_get_methods(['private' => '1']);

Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.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 show_old has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_old()
    {
        // Path to project.conf.php
        $proj_conf_path = INCLUDE_PATH . 'project_conf.php';

Severity: Minor
Found in plugins/admin_home/admin_modules/yf_admin_home.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