YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
55%

Avoid using static access to class '\App\Fields\Currency' in method 'delete'.
Open

        \App\Fields\Currency::clearCache();

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::createCommand
Open

        \App\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->execute();

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

class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model

The class Settings_Currency_Module_Model is not named in CamelCase.
Open

class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model
{
    const TABLE_NAME = 'vtiger_currency_info';

    public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',

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

    public function getCreateRecordUrl()

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 false;

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

    public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',

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

        return 'javascript:Settings_Currency_Js.triggerAdd(event)';

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

    const TABLE_NAME = 'vtiger_currency_info';

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

        \App\Fields\Currency::clearCache();

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

    public static function delete($recordId)

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

        'conversion_rate' => 'Conversion Rate', 'currency_status' => 'Status', ];

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

    public function isPagingSupported()

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\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->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

    public function getBaseTable()

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

    {

Line exceeds 120 characters; contains 128 characters
Open

    public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',

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

    public $name = 'Currency';

Line exceeds 120 characters; contains 124 characters
Open

        \App\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->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

        return self::TABLE_NAME;

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

    }

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

class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model

There are no issues that match your filters.

Category
Status