YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/RealizationProcesses/models/Module.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

        return $return;

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 '$return' which will lead to PHP notices.
Open

            $return[$moduleName]['status'] = $status;

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 '$return' which will lead to PHP notices.
Open

            $return[$moduleName]['id'] = $moduleId;

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 '$return' which will lead to PHP notices.
Open

            $return[$moduleName]['id'] = $moduleId;

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

Missing class import via use statement (line '19', column '22').
Open

        $dataReader = (new App\Db\Query())->from('vtiger_realization_process')

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

Avoid using static access to class '\App\Log' in method 'getStatusNotModify'.
Open

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

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 'updateStatusNotModify'.
Open

            'status_indicate_closing' => \App\Json::encode($status),

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\Log' in method 'updateStatusNotModify'.
Open

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

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\Log' in method 'getStatusNotModify'.
Open

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

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\Log' in method 'updateStatusNotModify'.
Open

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

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\Module' in method 'getStatusNotModify'.
Open

            $moduleName = App\Module::getModuleName($moduleId);

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 'getStatusNotModify'.
Open

            $status = \App\Json::decode(html_entity_decode($row['status_indicate_closing']));

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

Call to undeclared method \App\Db\Query::from
Open

        $dataReader = (new App\Db\Query())->from('vtiger_realization_process')

Returning type true but updateStatusNotModify() is declared to return array
Open

        return true;

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

        \App\Db::getInstance()->createCommand()->update('vtiger_realization_process', [

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

Variable $return was undeclared, but array fields are being added to it.
Open

            $return[$moduleName]['id'] = $moduleId;

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

Avoid excessively long class names like Settings_RealizationProcesses_Module_Model. Keep class name length under 40.
Open

class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
{
    /**
     * Gets status.
     *

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

Source https://phpmd.org/rules/naming.html#longclassname

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

class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model

The class Settings_RealizationProcesses_Module_Model is not named in CamelCase.
Open

class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model
{
    /**
     * Gets status.
     *

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

        $dataReader->close();

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

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

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

            $moduleId = $row['module_id'];

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

            $return[$moduleName]['status'] = $status;

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

            $return[$moduleName]['id'] = $moduleId;

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

        return $return;

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

     * @param mixed $moduleId

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

            $return[$moduleName]['id'] = $moduleId;

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

        $dataReader = (new App\Db\Query())->from('vtiger_realization_process')

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

            ->createCommand()->query();

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

        }

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

        ], ['module_id' => $moduleId])->execute();

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

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::updateStatusNotModify() method ...');

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

    public static function updateStatusNotModify($moduleId, $status)

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

                $status = [$status];

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

     * Gets status.

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

     */

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

            'status_indicate_closing' => \App\Json::encode($status),

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

     * Update status.

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

            $moduleName = App\Module::getModuleName($moduleId);

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

     * @return array - array of status

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

    {

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

        return true;

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

    }

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

        \App\Log::trace('Entering Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

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

            $status = \App\Json::decode(html_entity_decode($row['status_indicate_closing']));

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

    /**

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

     * @param mixed $status

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

    /**

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

            if (!\is_array($status)) {

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

        \App\Db::getInstance()->createCommand()->update('vtiger_realization_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

     * @return array - array of status

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

    public static function getStatusNotModify()

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

        while ($row = $dataReader->read()) {

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

        \App\Log::trace('Exiting Settings_RealizationProcesses_Module_Model::getStatusNotModify() method ...');

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

class Settings_RealizationProcesses_Module_Model extends Settings_Vtiger_Module_Model

There are no issues that match your filters.

Category
Status