mambax7/adslight

View on GitHub
admin/listing.php

Summary

Maintainability
A
3 hrs
Test Coverage

XXX found
Open

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

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

        if ($uploader->fetchMedia(Request::getArray('xoops_upload_file', '', 'POST')[0])) {
            //$extension = preg_replace( '/^.+\.([^.]+)$/sU' , '' , $_FILES['attachedfile']['name']);
            //$imgName = str_replace(' ', '', $_POST['photo']).'.'.$extension;

            $uploader->setPrefix('photo_');
Severity: Major
Found in admin/listing.php and 1 other location - About 3 hrs to fix
admin/categories.php on lines 92..106

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

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

Line exceeds 120 characters; contains 145 characters
Open

                $listingArray['typecondition'] = $conditionHandler->get($listingTempArray[$i]->getVar('typecondition'))->getVar('nom_condition');
Severity: Minor
Found in admin/listing.php by phpcodesniffer

Line exceeds 120 characters; contains 145 characters
Open

                //                $listingArray['country'] = strip_tags(\XoopsLists::getCountryList()[$listingTempArray[$i]->getVar('country')]);
Severity: Minor
Found in admin/listing.php by phpcodesniffer

Line exceeds 120 characters; contains 152 characters
Open

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

Line exceeds 120 characters; contains 155 characters
Open

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

Line exceeds 120 characters; contains 147 characters
Open

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

Line exceeds 120 characters; contains 138 characters
Open

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

Line exceeds 120 characters; contains 210 characters
Open

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

Line exceeds 120 characters; contains 177 characters
Open

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

Line exceeds 120 characters; contains 153 characters
Open

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

Line exceeds 120 characters; contains 129 characters
Open

                $listingArray['typeprice'] = $priceHandler->get($listingTempArray[$i]->getVar('typeprice'))->getVar('nom_price');
Severity: Minor
Found in admin/listing.php by phpcodesniffer

Line exceeds 120 characters; contains 202 characters
Open

                //                $listingArray['photo'] = "<img src='" . $uploadUrl . $listingTempArray[$i]->getVar('photo') . "' name='" . 'name' . "' id=" . 'id' . " alt='' style='max-width:100px'>";
Severity: Minor
Found in admin/listing.php by phpcodesniffer

Line exceeds 120 characters; contains 152 characters
Open

                $listingArray['photo'] = "<img src='" . $uploadUrl . $photo . "' name='" . 'name' . "' id=" . 'id' . " alt='' style='max-width:100px'>";
Severity: Minor
Found in admin/listing.php by phpcodesniffer

Line exceeds 120 characters; contains 1219 characters
Open

        //    $fields = explode('|', lid:int: 15::NOT NULL::primary:ID:0|cid:int: 15::NOT NULL:0::Category:1|title:varchar: 100::NOT NULL:::Title:2|status:int: 3::NOT NULL:0::Status:3|expire:char: 3::NOT NULL:::Expire:4|type:varchar: 15::NOT NULL:::Type:5|desctext:text: ::NOT NULL:::Description:6|tel:varchar: 15::NOT NULL:::Phone:7|price:decimal: 20,2::NOT NULL:0.00::Price:8|typeprice:varchar: 15::NOT NULL:::PriceType:9|typecondition:varchar: 15::NOT NULL:::Condition:10|date_created:int: 11:UNSIGNED:NOT NULL:0::Created:11|email:varchar: 100::NOT NULL:::Email:12|submitter:varchar: 60::NOT NULL:::Submitter:13|usid:varchar: 6::NOT NULL:::Zip:14|town:varchar: 200::NOT NULL:::Town:15|country:varchar: 200::NOT NULL:::country:16|contactby:varchar: 50::NOT NULL:::Contactby:17|premium:char: 3::NOT NULL:::premium:18|valid:varchar: 11::NOT NULL:::Valid:19|photo:varchar: 100::NOT NULL:::Photo:20|hits:int: 11::NOT NULL: 0::Hits:21|item_rating:double:6,4::NOT NULL:0.0000::ItemRating:22|item_votes:int: 11::NOT NULL: 0::ItemVotes:23|user_rating:double:6,4::NOT NULL:0.0000::user_rating:24|user_votes:int: 11::NOT NULL: 0::user_votes:25|comments:int: 11::NOT NULL: 0::comments:26|remind:int: 11::NOT NULL: 0::remind:27);
Severity: Minor
Found in admin/listing.php by phpcodesniffer

There are no issues that match your filters.

Category
Status