plugins/admin_home/admin_modules/yf_admin_home.class.php

Summary

Maintainability
C
7 hrs
Test Coverage

Method show_old has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function show_old()
    {
        // Path to project.conf.php
        $proj_conf_path = INCLUDE_PATH . 'project_conf.php';

Severity: Major
Found in plugins/admin_home/admin_modules/yf_admin_home.class.php - About 2 hrs to fix

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

        public function _show_suggesting_messages()
        {
            $admin_modules = module('admin_modules')->_get_modules();
            $user_modules_methods = module('admin_modules')->_get_methods(['private' => '1']);
    
    
    Severity: Minor
    Found in plugins/admin_home/admin_modules/yf_admin_home.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_old has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function show_old()
        {
            // Path to project.conf.php
            $proj_conf_path = INCLUDE_PATH . 'project_conf.php';
    
    
    Severity: Minor
    Found in plugins/admin_home/admin_modules/yf_admin_home.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 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public function show()
        {
            if (main()->ADMIN_GROUP != 1) {
                $admin_user = db()->get('SELECT * FROM ' . db('admin') . ' WHERE id=' . (int) main()->ADMIN_ID);
                if ($admin_user['go_after_login']) {
    Severity: Minor
    Found in plugins/admin_home/admin_modules/yf_admin_home.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 _home_block_from_menu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function _home_block_from_menu()
        {
            $STPL_MENU_MAIN = 'admin_home/menu';
            $STPL_MENU_ITEM = $STPL_MENU_MAIN . '_item';
    
    
    Severity: Minor
    Found in plugins/admin_home/admin_modules/yf_admin_home.class.php - About 35 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

    There are no issues that match your filters.

    Category
    Status