Showing 4,217 of 4,217 total issues

Function _get_compiled_string has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_compiled_string($name, $replace = [], $params = [])
    {
        $compiled_string = null;
        // TODO: add ability to use memcached or other fast cache-oriented storage instead of files => lower disk IO
        $compiled_storage = 'files';
Severity: Minor
Found in plugins/tpl/classes/tpl/yf_tpl_driver_yf.class.php - About 2 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _init()
    {
        // Needed to ensure backtracking still works on big templates (extended from 1 000 000 on 26kb stpl js() parsing)
        ini_set('pcre.backtrack_limit', '10000000');

Severity: Minor
Found in plugins/tpl/classes/yf_tpl.class.php - About 2 hrs 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 _user_security_checks has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _user_security_checks($user_id)
    {
        $user_id = (int) $user_id;
        if ( ! $this->USER_SECURITY_CHECKS || ! $user_id) {
            return false;
Severity: Minor
Found in plugins/auth/classes/auth/yf_auth_user.class.php - About 2 hrs 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 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $this->refresh_modules_list($silent = true);

        if (main()->is_post()) {
Severity: Minor
Found in plugins/admin/admin_modules/yf_admin_modules.class.php - About 2 hrs 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_shard_table_name has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function get_shard_table_name($table_name, $db)
    {
        $shard_table_name = '';
        // Try sharding by year/month/day (example: db('currency_pairs_log_2013_07_01') from db('currency_pairs_log'))
        if ( ! $shard_table_name && $this->SHARDING_BY_DAY) {
Severity: Minor
Found in plugins/db/classes/db/yf_db_installer.class.php - About 2 hrs 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 _sql_to_array has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _sql_to_array($return_raw = false, $sql_data = null)
    {
        if ( ! isset($sql_data)) {
            $sql_data = &$this->_sql;
        }
Severity: Minor
Found in plugins/db/classes/db/yf_db_query_builder_driver.class.php - About 2 hrs 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_time_diff_human has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_time_diff_human($seconds, $delimiter = ' ', $need_return = false, $only_text = false, $need_closing_tag = false)
    {
        $d = [];
        $tr = [
            'years' => ['лет', 'год', 'года'],
Severity: Minor
Found in plugins/common/classes/yf_common.class.php - About 2 hrs 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_if_need_to_cache has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_if_need_to_cache()
    {
        // Fast implementation of disabling output caching for the current page
        if (conf('no_output_cache')) {
            $this->NO_NEED_TO_CACHE = true;
Severity: Minor
Found in plugins/cache/classes/yf_output_cache.class.php - About 2 hrs 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 load_spiders_uas has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function load_spiders_uas()
    {
        $ext = '.txt';
        $ext_len = strlen($ext);
        $pattern = '{,plugins/*/}share/spiders/*' . $ext;
Severity: Minor
Found in plugins/common/classes/common/yf_spider_detection.class.php - About 2 hrs 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_type_blocks has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function render_type_blocks($params = [])
    {
        $total_records = $params['total_records'];
        $per_page = $params['per_page'];
        $requested_page = $params['requested_page'];
Severity: Minor
Found in plugins/common/classes/common/yf_divide_pages.class.php - About 2 hrs 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 _search_autocomplete has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _search_autocomplete($options = [])
    {
        main()->NO_GRAPHICS = true;
        // prepare options
        $_ = &$options;

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 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function show()
    {
        $this->refresh_modules_list($silent = true);

        if (main()->is_post()) {
Severity: Minor
Found in plugins/user/admin_modules/yf_user_modules.class.php - About 2 hrs 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_git_details has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_git_details($FS_PATH, $as_submodule = false)
    {
        $git_base_path = $FS_PATH . '.git';
        if ( ! file_exists($git_base_path)) {
            return [];
Severity: Minor
Found in classes/yf_debug.class.php - About 2 hrs 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_class_method has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function call_class_method($class_name = '', $custom_path = '', $method_name = '', $method_params = '', $tpl_name = '', $silent = false, $use_cache = false, $cache_ttl = -1, $cache_key_override = '')
    {
        if ( ! strlen($class_name) || ! strlen($method_name)) {
            return false;
        }
Severity: Minor
Found in classes/yf_main.class.php - About 2 hrs 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 _after_init_hook has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _after_init_hook()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        $this->events->fire('main.after_init_begin');
        $this->_check_site_maintenance();
Severity: Minor
Found in classes/yf_main.class.php - About 2 hrs 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_class has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function init_class($class_name, $custom_path = '', $params = '')
    {
        $class_name = $this->get_class_name($class_name);
        if (isset($this->modules[$class_name]) && is_object($this->modules[$class_name])) {
            return $this->modules[$class_name];
Severity: Minor
Found in classes/yf_main.class.php - About 2 hrs 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_site has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _find_site($sites_dir = '')
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        if ( ! $sites_dir) {
            $try_paths = [
Severity: Minor
Found in classes/yf_main.class.php - About 2 hrs 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_available_widgets_hooks has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function _get_available_widgets_hooks($for_section = 'admin')
    {
        if ( ! in_array($for_section, ['user', 'admin'])) {
            $for_section = 'admin';
        }
Severity: Minor
Found in plugins/dashboards/admin_modules/yf_manage_dashboards.class.php - About 2 hrs 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 test_load_fixtures has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    public function test_load_fixtures()
    {
        if ($this->_need_skip_test(__FUNCTION__)) {
            return;
        }
Severity: Minor
Found in .dev/tests/functional/model/class_model_sakila_test.Test.php - About 2 hrs 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

File user_stats.sql_php.php has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return [
    'fields' => [
        'user_id' => [
Severity: Minor
Found in plugins/sys/share/db/sql_php/user_stats.sql_php.php - About 2 hrs to fix
    Severity
    Category
    Status
    Source
    Language