XoopsModules25x/xfguestbook

View on GitHub
admin/index.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using undefined variables such as '$app' which will lead to PHP notices.
Open

    $app['displaySampleButton'] = 0;
Severity: Minor
Found in admin/index.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$app' which will lead to PHP notices.
Open

    $app['displaySampleButton'] = 1;
Severity: Minor
Found in admin/index.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$app' which will lead to PHP notices.
Open

    Yaml::save($app, $yamlFile);
Severity: Minor
Found in admin/index.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$app' which will lead to PHP notices.
Open

    Yaml::save($app, $yamlFile);
Severity: Minor
Found in admin/index.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using static access to class '\Xmf\Yaml' in method 'showButtons'.
Open

    Yaml::save($app, $yamlFile);
Severity: Minor
Found in admin/index.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 '\Xmf\Yaml' in method 'loadAdminConfig'.
Open

    $config = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
Severity: Minor
Found in admin/index.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 '\Xmf\Yaml' in method 'hideButtons'.
Open

    Yaml::save($app, $yamlFile);
Severity: Minor
Found in admin/index.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

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

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

Expected 1 blank line at end of file; 2 found
Open

require __DIR__ . '/admin_footer.php';
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 168 characters
Open

    $adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGMODERATE, "<span  style='color: #cb000b; font-weight: bold;'>" . $totalModerateMsgs . '</span>'), '', 'red');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 154 characters
Open

        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 155 characters
Open

        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 167 characters
Open

        //    $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 139 characters
Open

        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 170 characters
Open

    $adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGMODERATE, "<span  style='color: #008012; font-weight: bold;'>" . $totalModerateMsgs . '</span>'), '', 'green');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 167 characters
Open

    $adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGWAITING, "<span style='color: #008012; font-weight: bold;'>" . $totalWaitingMsgs . '</span>'), '', 'green');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 166 characters
Open

    $adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGWAITING, "<span  style='color: #cb000b; font-weight: bold;'>" . $totalWaitingMsgs . '</span>'), '', 'red');
Severity: Minor
Found in admin/index.php by phpcodesniffer

Line exceeds 120 characters; contains 136 characters
Open

        $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
Severity: Minor
Found in admin/index.php by phpcodesniffer

There are no issues that match your filters.

Category
Status