Showing 4,217 of 4,217 total issues

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

    public function mail_copy_find(&$mails, $options = null)
    {
        if (empty($this->MAIL_COPY_TO)) {
            return;
        }
Severity: Minor
Found in plugins/payment/classes/yf_payment_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 balance has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function balance()
    {
        $object = &$this->object;
        $action = &$this->action;
        $filter_name = &$this->filter_name;
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payment.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 _recreate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _recreate($options = null)
    {
        // import operation
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        // var
Severity: Minor
Found in plugins/payment/admin_modules/yf_manage_payout.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 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show($return_array = false)
    {
        if ($return_array) {
            $this->_nav_item_as_array = true;
        }
Severity: Minor
Found in plugins/site_nav_bar/modules/yf_site_nav_bar.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_response has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _api_response($request)
    {
        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 edit_item has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function edit_item()
    {
        $item_info = db()->query_fetch('SELECT * FROM ' . db('menu_items') . ' WHERE id=' . (int) ($_GET['id']));
        if (empty($item_info['id'])) {
            return _e('No such menu item!');
Severity: Minor
Found in plugins/sys/admin_modules/yf_menus_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 show has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        // TODO: show preview if file is image
        // TODO: doubleclick should edit file
        // TODO: buttons near eacj table row (edit/show revisions)
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_css_class has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _prepare_css_class($default_class = '', $value = '', &$extra)
    {
        $css_class = $default_class;
        if ($extra['badge']) {
            $badge = is_array($extra['badge']) && isset($extra['badge'][$value]) ? $extra['badge'][$value] : $extra['badge'];
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 _show_stpls_list has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_stpls_list($files_array = [], $level = 0)
    {
        asort($files_array);
        $body = [];
        foreach ((array) $files_array as $cur_file_path => $file_name) {
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 _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

Severity
Category
Status
Source
Language