modules/Settings/AutomaticAssignment/models/ListView.php
Missing class import via use statement (line '38', column '17'). Open
Open
$query = (new App\Db\Query())->from($module->getBaseTable());
- Read upRead up
- Exclude checks
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
Open
$query = (new App\Db\Query())->from($module->getBaseTable());
- Exclude checks
Call to undeclared method \Settings_Vtiger_Module_Model::getCreateRecordUrl
Open
Open
'linkurl' => $this->getModule()->getCreateRecordUrl(),
- Exclude checks
Avoid excessively long class names like Settings_AutomaticAssignment_ListView_Model. Keep class name length under 40. Open
Open
class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
{
/**
* Function to get Basic links.
*
- Read upRead up
- Exclude checks
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
Open
class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
- Exclude checks
The class Settings_AutomaticAssignment_ListView_Model is not named in CamelCase. Open
Open
class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
{
/**
* Function to get Basic links.
*
- Read upRead up
- Exclude checks
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
Open
if ($moduleModel->hasCreatePermissions()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $basicLinks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linktype' => 'LISTVIEWBASIC',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkurl' => $this->getModule()->getCreateRecordUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$basicLinks[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$module = $this->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkicon' => 'fas fa-plus',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$tabId = $this->get('sourceModule');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($tabId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkclass' => 'btn-light',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$query->where(['tabid' => $tabId]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getBasicLinks()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $query;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$query = (new App\Db\Query())->from($module->getBaseTable());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getBasicListQuery(): App\Db\Query
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'showLabel' => '1'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return array of Basic links
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleModel = $this->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get Basic links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$basicLinks = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linklabel' => 'LBL_ADD_RECORD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Class name "Settings_AutomaticAssignment_ListView_Model" is not in camel caps format Open
Open
class Settings_AutomaticAssignment_ListView_Model extends Settings_Vtiger_ListView_Model
- Exclude checks