YetiForceCompany/YetiForceCRM

View on GitHub
modules/OSSMail/views/Compose.php

Summary

Maintainability
A
0 mins
Test Coverage

The method postProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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

The method preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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

Avoid using static access to class 'Users_Record_Model' in method 'process'.
Open

        $currentUser = Users_Record_Model::getCurrentUserModel();
Severity: Minor
Found in modules/OSSMail/views/Compose.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 'OSSMail_Module_Model' in method 'process'.
Open

        $params = OSSMail_Module_Model::getComposeParam($request);
Severity: Minor
Found in modules/OSSMail/views/Compose.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 '\App\Json' in method 'process'.
Open

        $dbCommand->insert('u_#__mail_compose_data', ['key' => $key, 'userid' => $currentUser->getId(), 'data' => \App\Json::encode($params)])->execute();
Severity: Minor
Found in modules/OSSMail/views/Compose.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 parameters such as '$request'.
Open

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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 parameters such as '$display'.
Open

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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 parameters such as '$request'.
Open

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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 parameters such as '$display'.
Open

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/OSSMail/views/Compose.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

Call to undeclared method \App\Db::createCommand
Open

        $dbCommand = \App\Db::getInstance()->createCommand();
Severity: Critical
Found in modules/OSSMail/views/Compose.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class OSSMail_Compose_View extends OSSMail_Index_View

The class OSSMail_Compose_View is not named in CamelCase.
Open

class OSSMail_Compose_View extends OSSMail_Index_View
{
    /**
     * Pre process.
     *
Severity: Minor
Found in modules/OSSMail/views/Compose.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

     * Pre process.

Spaces must be used to indent lines; tabs are not allowed
Open

    public function preProcess(App\Request $request, $display = true)

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->mainUrl .= '&_task=mail&_action=compose&_extwin=1';

Spaces must be used to indent lines; tabs are not allowed
Open

    public function postProcess(App\Request $request, $display = true)

Spaces must be used to indent lines; tabs are not allowed
Open

    public function process(App\Request $request)

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand->delete('u_#__mail_compose_data', ['userid' => $currentUser->getId()])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

        $params = OSSMail_Module_Model::getComposeParam($request);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        $key = md5(\count($params) . microtime());

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->mainUrl .= '&_composeKey=' . $key;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Line exceeds 120 characters; contains 154 characters
Open

        $dbCommand->insert('u_#__mail_compose_data', ['key' => $key, 'userid' => $currentUser->getId(), 'data' => \App\Json::encode($params)])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->initAutologin();

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand = \App\Db::getInstance()->createCommand();

Spaces must be used to indent lines; tabs are not allowed
Open

        header('location: ' . $this->mainUrl);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param mixed        $display

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Post process.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool         $display

Spaces must be used to indent lines; tabs are not allowed
Open

     * Process.

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $currentUser = Users_Record_Model::getCurrentUserModel();

Spaces must be used to indent lines; tabs are not allowed
Open

        $dbCommand->insert('u_#__mail_compose_data', ['key' => $key, 'userid' => $currentUser->getId(), 'data' => \App\Json::encode($params)])->execute();

Class name "OSSMail_Compose_View" is not in camel caps format
Open

class OSSMail_Compose_View extends OSSMail_Index_View

There are no issues that match your filters.

Category
Status