XoopsModules25x/xoopspartners

View on GitHub

Showing 25 of 346 total issues

Method truncateHtml has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function truncateHtml($text, $length = 100, $ending = '...', $exact = false, $considerHtml = true)
Severity: Minor
Found in class/Common/SysUtility.php - About 35 mins to fix

    Function getEditor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getEditor($helper = null, $options = null)
        {
            /** @var Helper $helper */
            if (null === $options) {
                $options           = [];
    Severity: Minor
    Found in class/Common/SysUtility.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

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

    function b_xoopspartners_edit($options)
    {
        if (0 == $options[0]) { //put spaces between partners
            $chk0no  = ' checked';
            $chk0yes = '';
    Severity: Minor
    Found in blocks/partners.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 xoops_module_install_xoopspartners has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function xoops_module_install_xoopspartners(\XoopsModule $module)
    {
        require_once dirname(dirname(dirname(__DIR__))) . '/mainfile.php';
    
        $moduleDirName = basename(dirname(__DIR__));
    Severity: Minor
    Found in include/oninstall.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 xoops_module_uninstall_xoopspartners has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function xoops_module_uninstall_xoopspartners(\XoopsModule $module)
    {
        //    return true;
    
        $moduleDirName      = basename(dirname(__DIR__));
    Severity: Minor
    Found in include/onuninstall.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