Showing 3,246 of 4,217 total issues

Function _get_avail_drivers_list has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_avail_drivers_list()
    {
        $prefix = 'cache_driver_';
        $suffix = '.class.php';
        $plen = strlen($prefix);
Severity: Minor
Found in plugins/cache/classes/yf_cache.class.php - About 25 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_ip has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_ip($options = null)
    {
        // import options
        is_array($options) && extract($options, EXTR_PREFIX_ALL | EXTR_REFS, '');
        // filter
Severity: Minor
Found in plugins/api/classes/yf_api.class.php - About 25 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 _is_link_allowed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _is_link_allowed($link = '')
    {
        $link = trim($link);
        if ( ! strlen($link)) {
            return true;
Severity: Minor
Found in plugins/table2/classes/yf_table2.class.php - About 25 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_messages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function show_messages()
    {
        if ( ! $this->is_messages()) {
            return false;
        }
Severity: Minor
Found in plugins/common/classes/yf_common.class.php - About 25 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 error_403 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function error_403($msg = '')
    {
        if ((MAIN_TYPE_ADMIN && is_logged_in()) || DEBUG_MODE) {
            // Do not override status header for logged in admin, just display error inlined
            ! $msg && $msg = t('403 Forbidden');
Severity: Minor
Found in plugins/common/classes/yf_common.class.php - About 25 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 footer_add has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function footer_add($name = '', $link = '', $extra = [])
    {
        if (is_array($name)) {
            $extra = $name;
            $name = $extra['name'];
Severity: Minor
Found in plugins/table2/classes/yf_table2.class.php - About 25 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 admin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function admin($name = '', $link = '', $data = '', $extra = [])
    {
        if (is_array($link)) {
            $extra = (array) $extra + $link;
            $link = '';
Severity: Minor
Found in plugins/table2/classes/yf_table2.class.php - About 25 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 getset has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getset($name, callable $func, $ttl = 0, array $params = [])
    {
        if ($name === false || $name === null || ! is_string($name)) {
            return null;
        }
Severity: Minor
Found in plugins/cache/classes/yf_cache.class.php - About 25 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 multi_query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function multi_query($sql = [])
    {
        if ( ! $this->_connected && ! $this->connect()) {
            return false;
        }
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 25 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_http_headers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _send_http_headers($cache_last_modified_time = 0)
    {
        // Send correct headers
        header('Content-Type: text/html; charset=' . conf('charset'), 1);
        header('Content-language: ' . conf('language'), 1);
Severity: Minor
Found in plugins/cache/classes/yf_output_cache.class.php - About 25 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 escape_val has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function escape_val($data)
    {
        if ($data === null || $data === 'NULL') {
            return 'NULL';
        } elseif (is_array($data)) {
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 25 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 _real_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _real_name($name)
    {
        $name = trim($name);
        if ( ! strlen($name)) {
            return false;
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 25 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 _fix_table_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _fix_table_name($name = '')
    {
        $name = trim($name);
        if ( ! strlen($name)) {
            return false;
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 25 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 _mysql_escape_mimic has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _mysql_escape_mimic($string)
    {
        if (is_array($string)) {
            return array_map([$this, __FUNCTION__], $string);
        }
Severity: Minor
Found in plugins/db/classes/yf_db.class.php - About 25 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 _render_debug_info has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _render_debug_info(&$params, $ts = 0, $trace = '')
    {
        if ( ! DEBUG_MODE) {
            return false;
        }
Severity: Minor
Found in plugins/table2/classes/yf_table2.class.php - About 25 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 _not_blacklisted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _not_blacklisted($ip)
    {
        if (empty($ip)) {
            return false;
        }
Severity: Minor
Found in plugins/common/classes/common/yf_remote_files.class.php - About 25 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 bs_get_avail_themes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function bs_get_avail_themes($css_fw = '')
    {
        if ( ! $css_fw) {
            $css_fw = conf('css_framework');
        }
Severity: Minor
Found in plugins/common/classes/yf_common.class.php - About 25 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 __call has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __call($name, $args)
    {
        if (DEBUG_MODE) {
            $time_start = microtime(true);
        }
Severity: Minor
Found in plugins/redis/classes/yf_wrapper_redis.class.php - About 25 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_watermark has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function add_watermark($source_img_path, $watermark_path)
    {
        $img_info = getimagesize($source_img_path);
        $source_mime_type = $this->ALLOWED_MIME_TYPES[$img_info['mime']];
        if ( ! $source_mime_type) {
Severity: Minor
Found in plugins/common/classes/common/yf_make_thumb.class.php - About 25 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 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function _rename($id, $name)
    {
        $dir = $this->_path($id);
        if ($dir === $this->base) {
            throw new Exception('Cannot rename root');
Severity: Minor
Found in plugins/ckeditor/admin_modules/yf_ck_file_browser.class.php - About 25 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