Showing 3,246 of 4,217 total issues

Function daterange_select has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    public function _find_field_desc($name)
    {
        if ( ! strlen($name)) {
            return '';
        }
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 _get_methods_for_select has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_methods_for_select($params = [])
    {
        $cache_name = 'admin_modules_for_select';
        $data = cache_get($cache_name);
        if ( ! $data) {
Severity: Minor
Found in plugins/admin/admin_modules/yf_admin_modules.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 _set_update_batch_data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _set_update_batch_data($key, $index = '')
    {
        if ( ! is_array($key)) {
            return false;
        }
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 get_real_table_sql_php has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_real_table_sql_php($table)
    {
        $utils = $this->db->utils();
        $db_prefix = $this->db->DB_PREFIX;

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 create_trigger has a Cognitive Complexity of 11 (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_pgsql.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_email_text has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_email_text($replace = [], $extra = [])
    {
        if ($extra['tpl_name']) {
            $lang = $extra['locale'] ?: conf('language');
            $a = db()->from(self::table_tpls)->where('name', $extra['tpl_name'])->where('locale', $lang)->get();
Severity: Minor
Found in plugins/email/classes/yf_email.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 send has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

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

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

    public function compile_update($table, array $data, $where, $params = [])
    {
        if (empty($table) || empty($data) || empty($where)) {
            return false;
        }
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 _hidden_data_container has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hidden_data_container($row, $params, $instance_params)
    {
        $extra = $params['extra'];
        $hidden_data = $extra['hidden_data'];
        if (empty($hidden_data)) {
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 _init has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        ini_set('html_errors', 0);
        // ob_start();
        $class = &$this->class;
Severity: Minor
Found in plugins/api/classes/yf_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 bs_current_theme has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function bs_current_theme($main_type = '', $force = false)
    {
        if ( ! $main_type) {
            $main_type = MAIN_TYPE;
        }
Severity: Minor
Found in plugins/common/classes/yf_common.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 utf2win1251 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function utf2win1251($s)
    {
        $out = '';

        for ($i = 0; $i < strlen($s); $i++) {
Severity: Minor
Found in plugins/common/classes/common/yf_translit.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 url_remove_dot_segments has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function url_remove_dot_segments($path)
    {
        // multi-byte character explode
        $inSegs = preg_split('!/!u', $path);
        $outSegs = [];
Severity: Minor
Found in plugins/common/classes/common/yf_url_to_absolute.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 filemtime_remote has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function filemtime_remote($uri)
    {
        $CONNECTION_TIMEOUT = 1; // In seconds
        $uri = @parse_url($uri);
        $h = @fsockopen($uri['host'], $uri['port'] ? $uri['port'] : 80, $errno, $errstr, $CONNECTION_TIMEOUT);
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.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 pretty_dump_curl_opts has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function pretty_dump_curl_opts($curl_opts = [])
    {
        if ( ! isset($this->_curlopt_consts)) {
            $all_consts = get_defined_constants(true);
            foreach ((array) $all_consts['curl'] as $name => $id) {
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.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 call_try has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function call_try($name, $args)
    {
        $result = null;
        $call_try = $this->call_try;
        while ($call_try > 0) {
Severity: Minor
Found in plugins/redis/classes/yf_wrapper_redis.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 express_pdf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function express_pdf($send_mail = false)
    {
        $date = date('Y-m-d');
        $hours = (int) ($_GET['hours']);
        $orders = db()->get_2d('SELECT id FROM ' . db('shop_orders') . " WHERE delivery_time LIKE '" . $date . ' ' . $hours . "%' AND status = 1");

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

    public function merge_order()
    {
        $_GET['id'] = (int) ($_GET['id']);
        if ($_GET['id']) {
            $order_info = db()->query_fetch('SELECT * FROM ' . db('shop_orders') . ' WHERE id=' . (int) ($_GET['id']));

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