XoopsModules25x/xfguestbook

View on GitHub
admin/upgrade.php

Summary

Maintainability
A
3 hrs
Test Coverage

File upgrade.php has 300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
//
// ------------------------------------------------------------------------- //
// XF Guestbook for Xoops                                                          //
// ------------------------------------------------------------------------- //
Severity: Minor
Found in admin/upgrade.php - About 3 hrs to fix

    Avoid unused local variables such as '$arr'.
    Open

        $arr    = [];
    Severity: Minor
    Found in admin/upgrade.php by phpmd

    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

    <?php
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 163 characters
    Open

                            echo '<td width="20%" class = "odd"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_notok.gif\' >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 122 characters
    Open

                $sql    = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook') . ' RENAME ' . $xoopsDB->prefix('xfguestbook_msg');
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 138 characters
    Open

                $sql    = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_country') . ' CHANGE `country_code` `country_code` CHAR(5) NOT NULL';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 124 characters
    Open

                $sql    = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_msg') . ' CHANGE `country` `country` CHAR(5) NOT NULL';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 165 characters
    Open

                        echo '<input type = "hidden" name = "' . $one_table['name'] . '_' . $one_field['name'] . '_checked" value = "' . $one_field['to_update'] . '" >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 121 characters
    Open

                $sqlfile = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/sql/create_country.sql'; //create only
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 164 characters
    Open

                    echo '<td width="20%" class = "even"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_ok.gif\' alt=\'OK\' >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 171 characters
    Open

                    echo '<td width="20%" class = "even"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_notok.gif\' alt=\'Pas OK\' >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 160 characters
    Open

                            echo '<td width="20%" class = "odd"><img src=\'' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/assets/images/ic15_ok.gif\' >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 131 characters
    Open

                $sqlfile = XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/sql/update_config.sql'; //create + insert values
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 130 characters
    Open

                echo '<input type = "hidden" name = "' . $one_table['name'] . '_checked" value = "' . $one_table['to_update'] . '" >';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    Line exceeds 120 characters; contains 145 characters
    Open

                $sql    = 'ALTER TABLE ' . $xoopsDB->prefix('xfguestbook_msg') . ' CHANGE `xfguestbook_id` `msg_id` INT(11) NOT NULL AUTO_INCREMENT';
    Severity: Minor
    Found in admin/upgrade.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status