XoopsModules25x/xfguestbook

View on GitHub
admin/ip_manager.php

Summary

Maintainability
A
2 hrs
Test Coverage

badIpDel accesses the super-global variable $_POST.
Open

function badIpDel($ip_id)
{
    global $xoopsDB;
    $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
    if ($ip_count > 0) {
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpShow accesses the super-global variable $GLOBALS.
Open

function badIpShow()
{
    global $action, $start, $xoopsModule, $xoopsModuleConfig;
    $myts      = \MyTextSanitizer::getInstance();
    $limit     = 15;
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpDel accesses the super-global variable $_POST.
Open

function badIpDel($ip_id)
{
    global $xoopsDB;
    $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
    if ($ip_count > 0) {
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpDel accesses the super-global variable $_SERVER.
Open

function badIpDel($ip_id)
{
    global $xoopsDB;
    $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
    if ($ip_count > 0) {
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpShow accesses the super-global variable $_SERVER.
Open

function badIpShow()
{
    global $action, $start, $xoopsModule, $xoopsModuleConfig;
    $myts      = \MyTextSanitizer::getInstance();
    $limit     = 15;
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpDel accesses the super-global variable $_POST.
Open

function badIpDel($ip_id)
{
    global $xoopsDB;
    $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
    if ($ip_count > 0) {
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

badIpDel accesses the super-global variable $_POST.
Open

function badIpDel($ip_id)
{
    global $xoopsDB;
    $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
    if ($ip_count > 0) {
Severity: Minor
Found in admin/ip_manager.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Method badIpShow has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function badIpShow()
{
    global $action, $start, $xoopsModule, $xoopsModuleConfig;
    $myts      = \MyTextSanitizer::getInstance();
    $limit     = 15;
Severity: Minor
Found in admin/ip_manager.php - About 1 hr to fix

    Function badIpDel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php - About 45 mins to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Missing class import via use statement (line '92', column '33').
    Open

        $buttonTray->addElement(new \XoopsFormHidden('op', 'badIpSave'));
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '81', column '25').
    Open

            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_ADD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '85', column '28').
    Open

        $sform->addElement(new \XoopsFormText(AM_XFGUESTBOOK_VALUE, 'ip_value', 50, 50, $ip_value), true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '87', column '23').
    Open

        $buttonTray = new \XoopsFormElementTray('', '');
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '77', column '25').
    Open

            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '90', column '37').
    Open

            $buttonTray->addElement(new \XoopsFormHidden('ip_id', $ip_id));
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    Missing class import via use statement (line '88', column '33').
    Open

        $buttonTray->addElement(new \XoopsFormButton('', 'save', _SUBMIT, 'submit'));
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    MissingImport

    Since: 2.7.0

    Importing all external classes in a file through use statements makes them clearly visible.

    Example

    function make() {
        return new \stdClass();
    }

    Source http://phpmd.org/rules/cleancode.html#MissingImport

    The method badIpForm uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_ADD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
            $ip_value = '';
        }
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class '\XoopsModules\Xfguestbook\Utility' in method 'badIpForm'.
    Open

            $badips   = Xfguestbook\Utility::get_badips(true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\MyTextSanitizer' in method 'badIpSave'.
    Open

        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid using static access to class '\MyTextSanitizer' in method 'badIpShow'.
    Open

        $myts      = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

    Avoid assigning values to variables in if clauses and the like (line '60', column '18').
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

    Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

    The method badIpSave uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $country_id = $xoopsDB->genId('ip_id_seq');
                $sql        = sprintf("INSERT INTO `%s` (ip_id, ip_value) VALUES (%s, '%s')", $xoopsDB->prefix('xfguestbook_badips'), $ip_id, $ip_value);
                $xoopsDB->query($sql);
                $messagesent = AM_XFGUESTBOOK_BADIP_ADDED;
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method badIpShow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
            echo "<tr ><td align='center' colspan ='3' class = 'head'><b>" . AM_XFGUESTBOOK_NOBADIP . '</b></td></tr>';
        }
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method badIpDel uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
            $messagesent = AM_XFGUESTBOOK_NOBADIP;
        }
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    The method badIpSave uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

        } else {
            $sql = sprintf("SELECT COUNT(*) FROM  %s WHERE ip_value = '%s'", $xoopsDB->prefix('xfguestbook_badips'), $ip_value);
            [$count] = $xoopsDB->fetchRow($xoopsDB->query($sql));
            if ($count > 0) {
                $messagesent = '<span style="color: #FF0000; ">' . AM_XFGUESTBOOK_BADIP_EXIST . '</span>';
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

    Source https://phpmd.org/rules/cleancode.html#elseexpression

    Avoid using static access to class '\XoopsModules\Xfguestbook\Utility' in method 'badIpShow'.
    Open

        $badips    = Xfguestbook\Utility::get_badips(true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

    Source https://phpmd.org/rules/cleancode.html#staticaccess

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

        global $action, $start, $xoopsModule, $xoopsModuleConfig;
    Severity: Minor
    Found in admin/ip_manager.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

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

        $myts      = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.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

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

        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.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

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

        global $action, $start, $xoopsModule, $xoopsModuleConfig;
    Severity: Minor
    Found in admin/ip_manager.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

    Avoid unused parameters such as '$ip_id'.
    Open

    function badIpDel($ip_id)
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    UnusedFormalParameter

    Since: 0.2

    Avoid passing parameters to methods or constructors and then not using those parameters.

    Example

    class Foo
    {
        private function bar($howdy)
        {
            // $howdy is not used
        }
    }

    Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

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

                if (!$result = $xoopsDB->query($sql)) {
    Severity: Minor
    Found in admin/ip_manager.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

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

                $country_id = $xoopsDB->genId('ip_id_seq');
    Severity: Minor
    Found in admin/ip_manager.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

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

        global $action, $start, $xoopsModule, $xoopsModuleConfig;
    Severity: Minor
    Found in admin/ip_manager.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

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

        global $action, $start, $xoopsModule, $xoopsModuleConfig;
    Severity: Minor
    Found in admin/ip_manager.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

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

        $limit     = 15;
    Severity: Minor
    Found in admin/ip_manager.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

    The parameter $ip_value is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $ip_id is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $ip_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    The parameter $ip_id is not named in camelCase.
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseParameterName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name parameters.

    Example

    class ClassName {
        public function doSomething($user_name) {
        }
    }

    Source

    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 52 and the first side effect is on line 30.
    Open

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

    Line exceeds 120 characters; contains 128 characters
    Open

            echo "<form name='badiplist' id='list' action='" . $_SERVER['SCRIPT_NAME'] . '\' method=\'POST\' style=\'margin: 0;\'>';
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 146 characters
    Open

                echo "<td align='center' class='even'><input type='checkbox' name='ip_id[]' id='ip_id[]' value='" . $badips[$i]['ip_id'] . '\'></td>';
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 152 characters
    Open

                echo "<td align='center' class='even'><a href='ip_manager.php?op=badIpEdit&amp;ip_id=" . $badips[$i]['ip_id'] . '\'>' . _EDIT . '</a></td>';
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 124 characters
    Open

            $sql = sprintf("SELECT COUNT(*) FROM  %s WHERE ip_value = '%s'", $xoopsDB->prefix('xfguestbook_badips'), $ip_value);
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

                $sql = sprintf('DELETE FROM `%s` WHERE ip_id = %u', $xoopsDB->prefix('xfguestbook_badips'), $_POST['ip_id'][$i]);
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

            echo "<td colspan='3'>" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' value='" . _GO . '\'>';
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 171 characters
    Open

        <table width='100%' cellspacing='1' cellpadding='2' border='0' style='border-left: 1px solid #c0c0c0; border-top: 1px solid #c0c0c0; border-right: 1px solid #c0c0c0;'>
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 149 characters
    Open

                $sql        = sprintf("INSERT INTO `%s` (ip_id, ip_value) VALUES (%s, '%s')", $xoopsDB->prefix('xfguestbook_badips'), $ip_id, $ip_value);
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    Line exceeds 120 characters; contains 159 characters
    Open

                <td><span style='font-weight: bold; font-size: 12px; font-variant: small-caps;'>" . AM_XFGUESTBOOK_DISP_BADIPS . ' : ' . $nb_badips . "</span></td>
    Severity: Minor
    Found in admin/ip_manager.php by phpcodesniffer

    The variable $ip_count is not named in camelCase.
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $nb_badips is not named in camelCase.
    Open

    function badIpShow()
    {
        global $action, $start, $xoopsModule, $xoopsModuleConfig;
        $myts      = \MyTextSanitizer::getInstance();
        $limit     = 15;
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_count is not named in camelCase.
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $nb_badips is not named in camelCase.
    Open

    function badIpShow()
    {
        global $action, $start, $xoopsModule, $xoopsModuleConfig;
        $myts      = \MyTextSanitizer::getInstance();
        $limit     = 15;
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_count is not named in camelCase.
    Open

    function badIpDel($ip_id)
    {
        global $xoopsDB;
        $ip_count = (!empty($_POST['ip_id']) && is_array($_POST['ip_id'])) ? count($_POST['ip_id']) : 0;
        if ($ip_count > 0) {
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $country_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $nb_badips is not named in camelCase.
    Open

    function badIpShow()
    {
        global $action, $start, $xoopsModule, $xoopsModuleConfig;
        $myts      = \MyTextSanitizer::getInstance();
        $limit     = 15;
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_id is not named in camelCase.
    Open

    function badIpSave($ip_id, $ip_value)
    {
        global $xoopsDB;
    
        $myts = \MyTextSanitizer::getInstance();
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $ip_value is not named in camelCase.
    Open

    function badIpForm($ip_id = null)
    {
        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
        if ($ip_id) {
            $sform    = new \XoopsThemeForm(AM_XFGUESTBOOK_MOD_BADIP, 'op', xoops_getenv('SCRIPT_NAME'), 'post', true);
    Severity: Minor
    Found in admin/ip_manager.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status