XoopsModules25x/xoopsinfo

View on GitHub
modules/xoopsinfo/admin/main.php

Summary

Maintainability
B
7 hrs
Test Coverage

File main.php has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

/**
Severity: Minor
Found in modules/xoopsinfo/admin/main.php - About 3 hrs to fix

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    $title
               = !defined($config_theme->getVar('conf_desc')) || '' == constant($config_theme->getVar('conf_desc')) ? constant($config_theme->getVar('conf_title')) : constant($config_theme->getVar('conf_title'))
                                                                                                                                                                      . '<br><br><span style="font-weight:normal;">'
                                                                                                                                                                      . constant($config_theme->getVar('conf_desc')) . '</span>';
    Severity: Major
    Found in modules/xoopsinfo/admin/main.php and 3 other locations - About 1 hr to fix
    modules/xoopsinfo/admin/main.php on lines 166..168
    modules/xoopsinfo/admin/main.php on lines 228..230
    modules/xoopsinfo/admin/main.php on lines 251..253

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    $title          = !defined($config_tplset->getVar('conf_desc')) || '' == constant($config_tplset->getVar('conf_desc')) ? constant($config_tplset->getVar('conf_title')) : constant($config_tplset->getVar('conf_title'))
                                                                                                                                                                              . '<br><br><span style="font-weight:normal;">'
                                                                                                                                                                              . constant($config_tplset->getVar('conf_desc')) . '</span>';
    Severity: Major
    Found in modules/xoopsinfo/admin/main.php and 3 other locations - About 1 hr to fix
    modules/xoopsinfo/admin/main.php on lines 166..168
    modules/xoopsinfo/admin/main.php on lines 189..192
    modules/xoopsinfo/admin/main.php on lines 251..253

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    $title
        = !defined($config_debug->getVar('conf_desc')) || '' == constant($config_debug->getVar('conf_desc')) ? constant($config_debug->getVar('conf_title')) : constant($config_debug->getVar('conf_title')) . '<br><br><span style="font-weight:normal;">'
                                                                                                                                                               . constant($config_debug->getVar('conf_desc')) . '</span>';
    Severity: Major
    Found in modules/xoopsinfo/admin/main.php and 3 other locations - About 1 hr to fix
    modules/xoopsinfo/admin/main.php on lines 166..168
    modules/xoopsinfo/admin/main.php on lines 189..192
    modules/xoopsinfo/admin/main.php on lines 228..230

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

    $title          = !defined($config_startpage->getVar('conf_desc')) || '' == constant($config_startpage->getVar('conf_desc')) ? constant($config_startpage->getVar('conf_title')) : constant($config_startpage->getVar('conf_title'))
                                                                                                                                                                                       . '<br><br><span style="font-weight:normal;">'
                                                                                                                                                                                       . constant($config_startpage->getVar('conf_desc')) . '</span>';
    Severity: Major
    Found in modules/xoopsinfo/admin/main.php and 3 other locations - About 1 hr to fix
    modules/xoopsinfo/admin/main.php on lines 189..192
    modules/xoopsinfo/admin/main.php on lines 228..230
    modules/xoopsinfo/admin/main.php on lines 251..253

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 100.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Only one argument is allowed per line in a multi-line function call
    Open

    $theme_ele = 'theme_multi' !== $config_theme->getVar('conf_formtype') ? new XoopsFormSelect($title, $config_theme->getVar('conf_name'), $config_theme->getConfValueForOutput()) : new XoopsFormSelect($title, $config_theme->getVar('conf_name'),

    Only one argument is allowed per line in a multi-line function call
    Open

                                                                                                                                                                                                          $config_theme->getConfValueForOutput(), 5, true);

    Only one argument is allowed per line in a multi-line function call
    Open

                                                                                                                                                                                                          $config_theme->getConfValueForOutput(), 5, true);

    Line exceeds 120 characters; contains 145 characters
    Open

        $gdlib = '<img src="../images/icons/on.gif" align="absmiddle" alt="' . _AM_XI_DOWN_GDON . '"/><b> ' . $gdversion . '</b>' . _AM_XI_DOWN_GDON;

    Line exceeds 120 characters; contains 225 characters
    Open

                                                                                                                                                                                       . '<br><br><span style="font-weight:normal;">'

    Line exceeds 120 characters; contains 247 characters
    Open

                                                                                                                                                                                                          $config_theme->getConfValueForOutput(), 5, true);

    Line exceeds 120 characters; contains 130 characters
    Open

    $startpage_ele  = new XoopsFormSelect($title, $config_startpage->getVar('conf_name'), $config_startpage->getConfValueForOutput());

    Line exceeds 120 characters; contains 230 characters
    Open

                                                                                                                                                                              . constant($config_tplset->getVar('conf_desc')) . '</span>';

    Line exceeds 120 characters; contains 208 characters
    Open

                                                                                                                                                                      . '<br><br><span style="font-weight:normal;">'

    Line exceeds 120 characters; contains 216 characters
    Open

                                                                                                                                                                              . '<br><br><span style="font-weight:normal;">'

    Line exceeds 120 characters; contains 148 characters
    Open

        $optval = defined($options[$j]->getVar('confop_value')) ? constant($options[$j]->getVar('confop_value')) : $options[$j]->getVar('confop_value');

    Line exceeds 120 characters; contains 142 characters
    Open

        $allow_url_fopen = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_DOWN_OFF . '" />' . _AM_XI_DOWN_SAFEMODEPROBLEMS;

    Line exceeds 120 characters; contains 221 characters
    Open

                                                                                                                                                                      . constant($config_theme->getVar('conf_desc')) . '</span>';

    Line exceeds 120 characters; contains 145 characters
    Open

        $optkey = defined($options[$j]->getVar('confop_name')) ? constant($options[$j]->getVar('confop_name')) : $options[$j]->getVar('confop_name');

    Line exceeds 120 characters; contains 148 characters
    Open

        $safemode = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_DOWN_OFF . '" /><b> ' . _AM_XI_DOWN_SAFEMODEPROBLEMS . '</b>';

    Line exceeds 120 characters; contains 149 characters
    Open

        $gdlib = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_DOWN_GDOFF . '" /><b> ' . $gdversion . '</n>' . _AM_XI_DOWN_GDOFF;

    Line exceeds 120 characters; contains 156 characters
    Open

    $theme_fromfile_ele = new XoopsFormRadioYN($title, $config_theme_fromfile->getVar('conf_name'), $config_theme_fromfile->getConfValueForOutput(), _YES, _NO);

    Line exceeds 120 characters; contains 150 characters
    Open

        $sql = 'SELECT conf_id FROM ' . $xoopsDB->prefix('config') . ' WHERE conf_name = "global_disabled" AND conf_modid=' . $isProtector->getVar('mid');

    Line exceeds 120 characters; contains 142 characters
    Open

        $registerglobals = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_DOWN_OFF . '" />' . _AM_XI_DOWN_SAFEMODEPROBLEMS;

    Line exceeds 120 characters; contains 140 characters
    Open

        $use_trans_sid = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_DOWN_OFF . '" />' . _AM_XI_DOWN_SAFEMODEPROBLEMS;

    Line exceeds 120 characters; contains 147 characters
    Open

        $precheck = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_PROTECTOR_PRECHECK_MSG . '" />' . _AM_XI_PROTECTOR_CHECK_ERR;

    Line exceeds 120 characters; contains 149 characters
    Open

        $postcheck = '<img src="../images/icons/off.gif" align="absmiddle" alt="' . _AM_XI_PROTECTOR_POSTCHECK_MSG . '" />' . _AM_XI_PROTECTOR_CHECK_ERR;

    Line exceeds 120 characters; contains 242 characters
    Open

                                                                                                                                                                                       . constant($config_startpage->getVar('conf_desc')) . '</span>';

    Line exceeds 120 characters; contains 247 characters
    Open

        = !defined($config_debug->getVar('conf_desc')) || '' == constant($config_debug->getVar('conf_desc')) ? constant($config_debug->getVar('conf_title')) : constant($config_debug->getVar('conf_title')) . '<br><br><span style="font-weight:normal;">'

    Line exceeds 120 characters; contains 216 characters
    Open

    $title          = !defined($config_tplset->getVar('conf_desc')) || '' == constant($config_tplset->getVar('conf_desc')) ? constant($config_tplset->getVar('conf_title')) : constant($config_tplset->getVar('conf_title'))

    Line exceeds 120 characters; contains 130 characters
    Open

        $debug_ele = new XoopsFormSelect($title, $config_debug->getVar('conf_name'), $config_debug->getConfValueForOutput(), 5, true);

    Line exceeds 120 characters; contains 228 characters
    Open

    $title          = !defined($config_startpage->getVar('conf_desc')) || '' == constant($config_startpage->getVar('conf_desc')) ? constant($config_startpage->getVar('conf_title')) : constant($config_startpage->getVar('conf_title'))

    Line exceeds 120 characters; contains 241 characters
    Open

    $theme_ele = 'theme_multi' !== $config_theme->getVar('conf_formtype') ? new XoopsFormSelect($title, $config_theme->getVar('conf_name'), $config_theme->getConfValueForOutput()) : new XoopsFormSelect($title, $config_theme->getVar('conf_name'),

    Line exceeds 120 characters; contains 121 characters
    Open

        $debug_ele = new XoopsFormSelect($title, $config_debug->getVar('conf_name'), $config_debug->getConfValueForOutput());

    Line exceeds 120 characters; contains 207 characters
    Open

               = !defined($config_theme->getVar('conf_desc')) || '' == constant($config_theme->getVar('conf_desc')) ? constant($config_theme->getVar('conf_title')) : constant($config_theme->getVar('conf_title'))

    Line exceeds 120 characters; contains 124 characters
    Open

    $tplset_ele     = new XoopsFormSelect($title, $config_tplset->getVar('conf_name'), $config_tplset->getConfValueForOutput());

    Line exceeds 120 characters; contains 214 characters
    Open

                                                                                                                                                               . constant($config_debug->getVar('conf_desc')) . '</span>';

    Line exceeds 120 characters; contains 145 characters
    Open

        $protector_ele = new XoopsFormRadioYN($title, $config_protector->getVar('conf_name'), $config_protector->getConfValueForOutput(), _YES, _NO);

    Opening parenthesis of a multi-line function call must be the last content on the line
    Open

    $theme_ele = 'theme_multi' !== $config_theme->getVar('conf_formtype') ? new XoopsFormSelect($title, $config_theme->getVar('conf_name'), $config_theme->getConfValueForOutput()) : new XoopsFormSelect($title, $config_theme->getVar('conf_name'),

    Closing parenthesis of a multi-line function call must be on a line by itself
    Open

                                                                                                                                                                                                          $config_theme->getConfValueForOutput(), 5, true);

    Multi-line function call not indented correctly; expected 0 spaces but found 198
    Open

                                                                                                                                                                                                          $config_theme->getConfValueForOutput(), 5, true);

    There are no issues that match your filters.

    Category
    Status