XoopsModules25x/xoopstube

View on GitHub
admin/newvideos.php

Summary

Maintainability
A
1 hr
Test Coverage

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

        echo '  <div style="padding:5px; background-color: #EEEEEE; border: 1px solid #D9D9D9;">
                <span style="font-weight: bold; color: #0A3760;">' . _AM_XOOPSTUBE_SUB_FILESWAITINGINFO . '<br><br></span>
                <span style="padding: 12px;">' . _AM_XOOPSTUBE_SUB_FILESWAITINGVALIDATION . '<b>' . $new_array_count . '</b><br><br><span>
                <div style="padding: 8px;"><li>&nbsp;&nbsp;' . $xtubeImageArray['approve'] . ' ' . _AM_XOOPSTUBE_SUB_APPROVEWAITINGFILE . '<br>
                <li>&nbsp;&nbsp;' . $xtubeImageArray['editimg'] . ' ' . _AM_XOOPSTUBE_SUB_EDITWAITINGFILE . '<br>
Severity: Major
Found in admin/newvideos.php and 1 other location - About 1 hr to fix
admin/brokenvideo.php on lines 122..133

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

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

The DEFAULT body must start on the line following the statement
Open

    default:
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

The CASE body must start on the line following the statement
Open

    case 'approve':
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

There must be one USE keyword per declaration
Open

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

Line exceeds 120 characters; contains 122 characters
Open

                <span style="font-weight: bold; color: #0A3760;">' . _AM_XOOPSTUBE_SUB_FILESWAITINGINFO . '<br><br></span>
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 135 characters
Open

                $datetime     = Utility::getTimestamp(formatTimestamp($new['date'], $GLOBALS['xoopsModuleConfig']['dateformatadmin']));
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 141 characters
Open

                echo '<td class="even" style="text-align: center;" nowrap><span style="font-size: small;">' . $returnsource . '</span></td>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 130 characters
Open

                echo '<td class="even" style="text-align: center;"><span style="font-size: small;">' . $datetime . '</span></td>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 129 characters
Open

        //        $page = ( $new_array_count > $GLOBALS['xoopsModuleConfig']['admin_perpage'] ) ? _AM_XOOPSTUBE_MINDEX_PAGE : '';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 127 characters
Open

        $sql   = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published = 0 ORDER BY lid DESC';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

        echo '<th style="text-align: center;"><span style="font-size: small;">' . _AM_XOOPSTUBE_VIDSOURCE2 . '</span></th>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 142 characters
Open

        $tags['VIDEO_URL']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid=' . $cid . '&amp;lid=' . $lid;
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 138 characters
Open

                echo '<td class="even" style="text-align: center;" nowrap><span style="font-size: small;">' . $submitter . '</span></td>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 136 characters
Open

        $sql = 'SELECT cid, title, publisher, notifypub FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . $lid;
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 138 characters
Open

                <span style="padding: 12px;">' . _AM_XOOPSTUBE_SUB_FILESWAITINGVALIDATION . '<b>' . $new_array_count . '</b><br><br><span>
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 143 characters
Open

                <div style="padding: 8px;"><li>&nbsp;&nbsp;' . $xtubeImageArray['approve'] . ' ' . _AM_XOOPSTUBE_SUB_APPROVEWAITINGFILE . '<br>
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 155 characters
Open

                $icon = $new['published'] ? $approved : '<a href="newvideos.php?op=approve&amp;lid=' . $lid . '">' . $xtubeImageArray['approve'] . ' </a>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 168 characters
Open

        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' SET published=' . $time . ", status=1, publisher='" . $publisher . "' WHERE lid=" . $lid;
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 131 characters
Open

            echo '<tr><td style="text-align: center;" class="head" colspan="6">' . _AM_XOOPSTUBE_SUB_NOFILESWAITING . '</td></tr>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

            $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 124 characters
Open

        echo '<th style="text-align: left;"><span style="font-size: small;">' . _AM_XOOPSTUBE_MINDEX_TITLE . '</span></th>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 125 characters
Open

                echo '<td class="head" style="text-align: center;"><span style="font-size: small;">' . $lid . '</span></td>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 136 characters
Open

        //            'UPDATE ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' SET published=' . $time . ', status=1, publisher='
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

Line exceeds 120 characters; contains 163 characters
Open

                echo '<td class="even" nowrap><a href="newvideos.php?op=edit&amp;lid=' . $lid . '"><span style="font-size: small;">' . $title . '</span></a></td>';
Severity: Minor
Found in admin/newvideos.php by phpcodesniffer

There are no issues that match your filters.

Category
Status