Showing 3,246 of 4,217 total issues

Function _show_form has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_form()
    {
        // Already logged in users not needed to login again
        if (main()->USER_ID) {
            return js_redirect($this->DEF_REDIRECT_URL);
Severity: Minor
Found in plugins/user/modules/yf_login_form.class.php - About 55 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_header has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _show_header()
    {
        if (conf('no_page_header')) {
            return false;
        }
Severity: Minor
Found in classes/yf_graphics.class.php - About 55 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 filter_save has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function filter_save()
    {
        $A = $this->_get_notification($_POST['notification_id']);

        $filter_name = $_GET['id'] == 'manage_notifications' ? 'manage_notifications' : ($_GET['object'] . '__add_receivers__' . $A['receiver_type']);
Severity: Minor
Found in plugins/notifications/admin_modules/yf_manage_notifications.class.php - About 55 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 generate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function generate()
    {
        if (function_exists('hash_algos') && in_array($this->HASH_ALGO, hash_algos())) {
            $token = hash($this->HASH_ALGO, mt_rand(0, mt_getrandmax()) . '|' . $_SERVER['REMOTE_ADDR'] . '|' . microtime());
        } else {
Severity: Minor
Found in classes/yf_csrf_guard.class.php - About 55 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 set_source has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function set_source($img_file = '')
    {
        $this->_clean_data();
        if (empty($img_file) || ! file_exists($img_file) || ! is_readable($img_file)) {
            if ( ! $this->SILENT_MODE) {
Severity: Minor
Found in plugins/content/classes/yf_resize_images.class.php - About 55 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 _debug_stpls has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_stpls(&$params = [])
    {
        if ( ! $this->SHOW_STPLS) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 55 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 _debug_redis has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _debug_redis(&$params = [])
    {
        if ( ! $this->SHOW_REDIS_INFO) {
            return '';
        }
Severity: Minor
Found in classes/yf_debug.class.php - About 55 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 init_files has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function init_files()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        $include_files = [];
        $required_files = [];
Severity: Minor
Found in classes/yf_main.class.php - About 55 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 init_db has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function init_db()
    {
        $this->PROFILING && $this->_timing[] = [microtime(true), __CLASS__, __FUNCTION__, $this->trace_string(), func_get_args()];
        $this->events->fire('main.before_db');
        // Check if current object/action not required db connection
Severity: Minor
Found in classes/yf_main.class.php - About 55 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_online has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _is_online($user_ids, $user_type = null)
    {
        if (is_array($user_ids)) {
        } else {
            $user_ids = (int) $user_ids;
Severity: Minor
Found in plugins/user/classes/yf_online_users.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('db'));
Severity: Minor
Found in .dev/samples/classes/sample_db.class.php - About 55 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_user_nick has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _check_user_nick($CUR_VALUE = '', $force_value_to_check = null, $name_in_form = 'nick')
    {
        // TODO: rewrite me
        $TEXT_TO_CHECK = $_POST[$name_in_form];
        if ($force_value_to_check !== null) {
Severity: Minor
Found in classes/yf_validate.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('model'));
Severity: Minor
Found in .dev/samples/classes/sample_model.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = $this->_get_texts();
Severity: Minor
Found in .dev/samples/classes/sample_all.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('db')->query_builder());
Severity: Minor
Found in .dev/samples/classes/sample_db_query_builder.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('db')->migrator());
Severity: Minor
Found in .dev/samples/classes/sample_db_migrator.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = $this->_get_console_commands();
Severity: Minor
Found in .dev/samples/classes/sample_console_tool.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('table2'));
Severity: Minor
Found in .dev/samples/classes/sample_table.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = $this->_get_demos();
Severity: Minor
Found in .dev/samples/classes/sample_demo.class.php - About 55 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 _hook_side_column has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _hook_side_column()
    {
        $items = [];
        $url = url('/@object');
        $methods = get_class_methods(_class('validate'));
Severity: Minor
Found in .dev/samples/classes/sample_validate.class.php - About 55 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