XoopsModules25x/xoopstube

View on GitHub
admin/indexpage.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

        if (class_exists('XoopsFormEditor')) {
            $options['name']   = 'indexheader';
            $options['value']  = $indexheader;
            $options['rows']   = 5;
            $options['cols']   = '100%';
Severity: Major
Found in admin/indexpage.php and 3 other locations - About 4 hrs to fix
admin/category.php on lines 135..147
admin/main.php on lines 177..189
submit.php on lines 308..320

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 179.

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

There must be one USE keyword per declaration
Open

use XoopsModules\Xoopstube\{
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 177 characters
Open

        $indexImageSelect->setExtra("onchange='showImgSelected(\"image\", \"indeximage\", \"" . $GLOBALS['xoopsModuleConfig']['mainimagedir'] . '", "", "' . XOOPS_URL . "\")'");
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 146 characters
Open

        $sform->addElement(new \XoopsFormRadioYN(_AM_XOOPSTUBE_IPAGE_SHOWLATEST, 'lastvideosyn', $lastvideosyn, ' ' . _YES . '', ' ' . _NO . ''));
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 131 characters
Open

        $lastvideostotalform->setDescription('<span style="font-size: small;">' . _AM_XOOPSTUBE_IPAGE_LATESTTOTAL_DSC . '</span>');
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        $sform->addElement(new \XoopsFormText(_AM_XOOPSTUBE_IPAGE_CTITLE, 'indexheading', 60, 60, $indexheading), false);
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 248 characters
Open

        $sql = 'SELECT indeximage, indexheading, indexheader, indexfooter, nohtml, nosmiley, noxcodes, noimages, nobreak, indexheaderalign, indexfooteralign, lastvideosyn, lastvideostotal FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_indexpage');
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 125 characters
Open

         <legend style="display: inline; font-weight: bold; color: #0A3760;">' . _AM_XOOPSTUBE_IPAGE_INFORMATION . '</legend>
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 212 characters
Open

            $indeximage_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/' . $GLOBALS['xoopsModuleConfig']['mainimagedir'] . '/' . $indeximage . '" name="image" id="image" alt="">'));
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 144 characters
Open

        $graph_array      = Lists:: getListTypeAsArray(XOOPS_ROOT_PATH . '/' . $GLOBALS['xoopsModuleConfig']['mainimagedir'], $type = 'images');
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 126 characters
Open

        $lastvideostotalform = new \XoopsFormText(_AM_XOOPSTUBE_IPAGE_LATESTTOTAL, 'lastvideostotal', 2, 2, $lastvideostotal);
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 394 characters
Open

                            . " SET indexheading='$indexheading', indexheader='$indexheader', indexfooter='$indexfooter', indeximage='$indeximage', indexheaderalign='$indexheaderalign', indexfooteralign='$indexfooteralign', nohtml='$nohtml', nosmiley='$nosmiley', noxcodes='$noxcodes', noimages='$noimages', nobreak='$nobreak', lastvideosyn='$lastvideosyn', lastvideostotal='$lastvideostotal'";
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 229 characters
Open

        [$indeximage, $indexheading, $indexheader, $indexfooter, $nohtml, $nosmiley, $noxcodes, $noimages, $nobreak, $indexheaderalign, $indexfooteralign, $lastvideosyn, $lastvideostotal] = $GLOBALS['xoopsDB']->fetchrow($result);
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 156 characters
Open

            $indeximage_tray->addElement(new \XoopsFormLabel('', '<br><br><img src="' . XOOPS_URL . '/uploads/blank.gif" name="image" id="image" alt="">'));
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 121 characters
Open

        $headeralign_select = new \XoopsFormSelect(_AM_XOOPSTUBE_IPAGE_CHEADINGA, 'indexheaderalign', $indexheaderalign);
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 151 characters
Open

         <img src="' . XOOPS_URL . '/modules/' . $moduleDirName . '/assets/images/icon/indexpage.png" alt="" style="float: left; padding-right: 10px;">
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

Line exceeds 120 characters; contains 161 characters
Open

            $editor            = new \XoopsFormEditor('', $GLOBALS['xoopsModuleConfig']['form_optionsuser'], $options, $nohtml = false, $onfailure = 'textarea');
Severity: Minor
Found in admin/indexpage.php by phpcodesniffer

There are no issues that match your filters.

Category
Status