mambax7/adslight

View on GitHub
class/Common/ModuleFeedback.php

Summary

Maintainability
B
4 hrs
Test Coverage

getFormFeedback accesses the super-global variable $GLOBALS.
Open

    public function getFormFeedback($action = false): \XoopsThemeForm
    {
        if (!$action) {
            $action = $_SERVER['REQUEST_URI'];
        }
Severity: Minor
Found in class/Common/ModuleFeedback.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

getFormFeedback accesses the super-global variable $_SERVER.
Open

    public function getFormFeedback($action = false): \XoopsThemeForm
    {
        if (!$action) {
            $action = $_SERVER['REQUEST_URI'];
        }
Severity: Minor
Found in class/Common/ModuleFeedback.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 getFormFeedback has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFormFeedback($action = false): \XoopsThemeForm
    {
        if (!$action) {
            $action = $_SERVER['REQUEST_URI'];
        }
Severity: Major
Found in class/Common/ModuleFeedback.php - About 4 hrs to fix

    The method getFormFeedback() has 128 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.php by phpmd

    Missing class import via use statement (line '83', column '26').
    Open

            $recipient = new \XoopsFormText(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '187', column '31').
    Open

            $form->addElement(new \XoopsFormButtonTray('', \_SUBMIT, 'submit', '', false));
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '96', column '26').
    Open

            $your_name = new \XoopsFormText(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '178', column '40').
    Open

            $editor                  = new \XoopsFormEditor(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '186', column '31').
    Open

            $form->addElement(new \XoopsFormHidden('op', 'send'));
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '109', column '26').
    Open

            $your_site = new \XoopsFormText(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 getFormFeedback has a boolean flag argument $action, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
    Severity: Minor
    Found in class/Common/ModuleFeedback.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

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

    Missing class import via use statement (line '73', column '21').
    Open

            $form = new \XoopsThemeForm(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '135', column '29').
    Open

            $fbtypeSelect = new \XoopsFormSelect(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 '122', column '26').
    Open

            $your_mail = new \XoopsFormText(
    Severity: Minor
    Found in class/Common/ModuleFeedback.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

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

    <?php declare(strict_types=1);

    The variable $your_name is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_name is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_name is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_mail is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_site is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_site is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_mail is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_mail is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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 $your_site is not named in camelCase.
    Open

        public function getFormFeedback($action = false): \XoopsThemeForm
        {
            if (!$action) {
                $action = $_SERVER['REQUEST_URI'];
            }
    Severity: Minor
    Found in class/Common/ModuleFeedback.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