YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_Module_Model' in method 'getSupportedModules'.
Open

        return Vtiger_Module_Model::getAll([0], [], true);

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

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

class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model

The class Settings_TreesManager_Module_Model is not named in CamelCase.
Open

class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model
{
    public $baseTable = 'vtiger_trees_templates';
    public $baseIndex = 'id';
    public $nameFields = ['name'];

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

    /**

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

    }

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 getListViewUrl()

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 "javascript:Settings_TreesManager_List_Js.triggerCreate('index.php?module=TreesManager&parent=Settings&view=Edit')";

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

     * @return string Url

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

     * Function to get List view url.

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

     * @return Vtiger_Module_Model[]

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

     * Function to get Create view url.

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 $name = 'TreesManager';

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

     * Get supported modules.

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

     */

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

    public function getSupportedModules(): array

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

        return Vtiger_Module_Model::getAll([0], [], 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

    /**

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

    public $baseTable = 'vtiger_trees_templates';

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

    public $baseIndex = 'id';

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

        return 'index.php?module=' . $this->getName() . '&parent=' . $this->getParentName() . '&view=List';

Line exceeds 120 characters; contains 131 characters
Open

        return "javascript:Settings_TreesManager_List_Js.triggerCreate('index.php?module=TreesManager&parent=Settings&view=Edit')";

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

    public $nameFields = ['name'];

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

    public $listFields = ['name' => 'LBL_NAME', 'tabid' => 'LBL_MODULE'];

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

     * @return string Url

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

    public static function getCreateRecordUrl()

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

class Settings_TreesManager_Module_Model extends Settings_Vtiger_Module_Model

There are no issues that match your filters.

Category
Status