admin/upgrade.php
File upgrade.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
//
// ------------------------------------------------------------------------- //
// XF Guestbook for Xoops //
// ------------------------------------------------------------------------- //
Avoid unused local variables such as '$arr'. Open
Open
$arr = [];
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 35 and the first side effect is on line 27. Open
Open
<?php
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
Open
$sql = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook') . ' RENAME ' . $xoopsDB->prefix('xfguestbook_msg');
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
Open
echo '<td width="20%" class = "odd"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_ok.gif\' >';
- Exclude checks
Line exceeds 120 characters; contains 165 characters Open
Open
echo '<input type = "hidden" name = "' . $one_table['name'] . '_' . $one_field['name'] . '_checked" value = "' . $one_field['to_update'] . '" >';
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
Open
$sqlfile = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/sql/create_country.sql'; //create only
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
Open
echo '<td width="20%" class = "even"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_notok.gif\' alt=\'Pas OK\' >';
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
Open
echo '<input type = "hidden" name = "' . $one_table['name'] . '_checked" value = "' . $one_table['to_update'] . '" >';
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
Open
echo '<td width="20%" class = "odd"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_notok.gif\' >';
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
Open
$sqlfile = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/sql/update_config.sql'; //create + insert values
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
Open
$sql = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_msg') . ' CHANGE `xfguestbook_id` `msg_id` INT(11) NOT NULL AUTO_INCREMENT';
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
$sql = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_msg') . ' CHANGE `country` `country` CHAR(5) NOT NULL';
- Exclude checks
Line exceeds 120 characters; contains 164 characters Open
Open
echo '<td width="20%" class = "even"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_ok.gif\' alt=\'OK\' >';
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
Open
$sql = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_country') . ' CHANGE `country_code` `country_code` CHAR(5) NOT NULL';
- Exclude checks