Missing class import via use statement (line '26', column '14'). Open
throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
- 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
Avoid using static access to class '\Vtiger_RelationListView_Model' in method 'process'. Open
$relationView = \Vtiger_RelationListView_Model::getInstance($parentRecord, $moduleName, $relationId, $cvId);
- Read upRead up
- Exclude checks
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\Language' in method 'getPageTitle'. Open
return \App\Language::translate('LBL_CHANGE_RELATION_DATA', $request->getModule());
- Read upRead up
- Exclude checks
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 '\Vtiger_Record_Model' in method 'process'. Open
$parentRecord = \Vtiger_Record_Model::getInstanceById($parentRecordId);
- Read upRead up
- Exclude checks
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 'Vtiger_Record_Model' in method 'checkPermission'. Open
$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'));
- Read upRead up
- Exclude checks
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
Class extends undeclared class \App\Controller\Modal
Open
class Vtiger_ChangeRelationData_View extends \App\Controller\Modal
- Exclude checks
Call to undeclared method \App\Relation\RelationAbstraction::getFields
Open
foreach ($relationModel->getFields(true) as $fieldModel) {
- Exclude checks
Call to undeclared method \Vtiger_ChangeRelationData_View::getViewer
Open
$viewer = $this->getViewer($request);
- Exclude checks
Call to undeclared method \App\Relation\RelationAbstraction::getRelationData
Open
$data = $relationModel->getRelationData($parentRecordId, $recordId);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_ChangeRelationData_View extends \App\Controller\Modal
- Exclude checks
The class Vtiger_ChangeRelationData_View is not named in CamelCase. Open
class Vtiger_ChangeRelationData_View extends \App\Controller\Modal
{
/** {@inheritdoc} */
public $modalSize = '';
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRecordId = $request->getInteger('fromRecord');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$recordModel->isEditable() || !Vtiger_Record_Model::getInstanceById($request->getInteger('fromRecord'))->isEditable()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('Modals/ChangeRelationData.tpl', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordId = $request->getInteger('record');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModels = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModels[$fieldModel->getName()] = $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Language::translate('LBL_CHANGE_RELATION_DATA', $request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $modalSize = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkPermission(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Process.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('FIELDS', $fieldModels);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationId = $request->getInteger('relationId');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->set('fieldvalue', $data[$fieldModel->getName()] ?? '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RELATION_ID', $relationId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('record'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRecord = \Vtiger_Record_Model::getInstanceById($parentRecordId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPageTitle(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
if (!$recordModel->isEditable() || !Vtiger_Record_Model::getInstanceById($request->getInteger('fromRecord'))->isEditable()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationModel = $relationView->getRelationModel()->getTypeRelationModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RECORD', $recordId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cvId = $request->isEmpty('cvId', true) ? 0 : $request->getByType('cvId', 'Alnum');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('FROM_RECORD', $parentRecord->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relationView = \Vtiger_RelationListView_Model::getInstance($parentRecord, $moduleName, $relationId, $cvId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($relationModel->getFields(true) as $fieldModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = $relationModel->getRelationData($parentRecordId, $recordId);
- Exclude checks
Class name "Vtiger_ChangeRelationData_View" is not in camel caps format Open
class Vtiger_ChangeRelationData_View extends \App\Controller\Modal
- Exclude checks