mambax7/publisher

View on GitHub
class/Common/ModuleFeedback.php

Summary

Maintainability
A
1 hr
Test Coverage

getFormFeedback accesses the super-global variable $GLOBALS.
Open

    public function getFormFeedback($action = false)
    {
        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)
    {
        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 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

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

    Missing class import via use statement (line '115', 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 '73', column '21').
    Open

            $form = new \XoopsThemeForm(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true);
    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 '79', column '26').
    Open

            $your_name = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME'), 'your_name', 50, 255, $this->name);
    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 '82', column '26').
    Open

            $your_site = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site);
    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 '89', column '29').
    Open

            $fbtypeSelect = new \XoopsFormSelect(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type);
    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)
    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 '85', column '25').
    Open

            $yourMail = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email);
    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 '76', column '26').
    Open

            $recipient = new \XoopsFormText(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail'));
    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 '112', column '40').
    Open

            $editor                  = new \XoopsFormEditor(\constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs);
    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 '116', 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

    The variable $your_site is not named in camelCase.
    Open

        public function getFormFeedback($action = false)
        {
            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)
        {
            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)
        {
            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)
        {
            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)
        {
            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)
        {
            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