mambax7/adslight

View on GitHub
admin/type.php

Summary

Maintainability
F
1 wk
Test Coverage

XXX found
Open

            //                     <th class='center width5'>".AM_ADSLIGHT_FORM_ACTION."XXX</th>
Severity: Minor
Found in admin/type.php by fixme

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

switch ($op) {
    case 'new':
        $adminObject->addItemButton(AM_ADSLIGHT_TYPE_LIST, 'type.php', 'list');
        $adminObject->displayButton('left');

Severity: Major
Found in admin/type.php and 2 other locations - About 1 wk to fix
admin/condition.php on lines 45..220
admin/price.php on lines 45..220

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

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\Adslight\{
Severity: Minor
Found in admin/type.php by phpcodesniffer

There must be one blank line after the last USE statement; 0 found;
Open

use XoopsModules\Adslight\{
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 156 characters
Open

            //                    <a href='type.php?op=delete&id_type=".$i."'><img src=".$pathIcon16."/delete.png alt='"._DELETE."' title='"._DELETE."'></a>
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 135 characters
Open

                XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/templates/admin/adslight_admin_type.tpl'
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 153 characters
Open

               <a href='type.php?op=delete&id_type=" . $i . "'><img src=" . $pathIcon16 . "/delete.png alt='" . _DELETE . "' title='" . _DELETE . "'></a>
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 175 characters
Open

                $typeArray['edit_delete'] = "<a href='type.php?op=edit&id_type=" . $i . "'><img src=" . $pathIcon16 . "/edit.png alt='" . _EDIT . "' title='" . _EDIT . "'></a>
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

               <a href='type.php?op=clone&id_type=" . $i . "'><img src=" . $pathIcon16 . "/editcopy.png alt='" . _CLONE . "' title='" . _CLONE . "'></a>";
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 218 characters
Open

            xoops_confirm(['ok' => 1, 'id_type' => Request::getString('id_type', ''), 'op' => 'delete'], Request::getUrl('REQUEST_URI', '', 'SERVER'), sprintf(AM_ADSLIGHT_FORMSUREDEL, $typeObject->getVar('nom_type')));
Severity: Minor
Found in admin/type.php by phpcodesniffer

Line exceeds 120 characters; contains 148 characters
Open

            //                    <a href='type.php?op=edit&id_type=".$i."'><img src=".$pathIcon16."/edit.png alt='"._EDIT."' title='"._EDIT."'></a>
Severity: Minor
Found in admin/type.php by phpcodesniffer

There are no issues that match your filters.

Category
Status