YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/AutomaticAssignment/models/ListView.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '38', column '17').
Open

        $query = (new App\Db\Query())->from($module->getBaseTable());

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

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

        $query = (new App\Db\Query())->from($module->getBaseTable());

Call to undeclared method \Settings_Vtiger_Module_Model::getCreateRecordUrl
Open

                'linkurl' => $this->getModule()->getCreateRecordUrl(),

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

class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
{
    /**
     * Function to get Basic links.
     *

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_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model

The class Settings_AutomaticAssignment_ListView_Model is not named in CamelCase.
Open

class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
{
    /**
     * Function to get Basic links.
     *

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

        if ($moduleModel->hasCreatePermissions()) {

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

        return $basicLinks;

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

                'linktype' => 'LISTVIEWBASIC',

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

                'linkurl' => $this->getModule()->getCreateRecordUrl(),

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

            $basicLinks[] = [

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

        $module = $this->getModule();

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

                'linkicon' => 'fas fa-plus',

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

            ];

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

        $tabId = $this->get('sourceModule');

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

        if ($tabId) {

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

                'linkclass' => 'btn-light',

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

            $query->where(['tabid' => $tabId]);

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

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

        return $query;

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

        $query = (new App\Db\Query())->from($module->getBaseTable());

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 getBasicListQuery(): App\Db\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

                'showLabel' => '1'

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

    /** {@inheritdoc} */

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 of Basic links

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

    {

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

        $moduleModel = $this->getModule();

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

     * Function to get Basic links.

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

        $basicLinks = [];

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

    /**

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

                'linklabel' => 'LBL_ADD_RECORD',

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

    }

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

class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model

There are no issues that match your filters.

Category
Status