Missing class import via use statement (line '41', column '14'). Open
throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 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 '\App\Privilege' in method 'checkPermission'. Open
if (!\App\Privilege::isPermitted($request->getModule()) || !\App\Privilege::isPermitted($request->getByType('src_module', \App\Purifier::ALNUM))) {
- 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_TreeInventoryModal_Model' in method 'process'. Open
$treeCategoryModel = Vtiger_TreeInventoryModal_Model::getInstance($moduleModel);
- 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_Module_Model' in method 'process'. Open
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
- 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\Privilege' in method 'checkPermission'. Open
if (!\App\Privilege::isPermitted($request->getModule()) || !\App\Privilege::isPermitted($request->getByType('src_module', \App\Purifier::ALNUM))) {
- 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\Json' in method 'process'. Open
$viewer->assign('TREE', \App\Json::encode($treeCategoryModel->getTreeData()));
- 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
Call to undeclared method \Vtiger_TreeInventoryModal_View::checkAndConvertJsScripts
Open
return array_merge($this->checkAndConvertJsScripts($scripts), parent::getModalScripts($request));
- Exclude checks
Reference to undeclared class \App\Controller\Modal
Open
parent::preProcessAjax($request);
- Exclude checks
Call to undeclared method \Vtiger_TreeView_Model::getTreeData
Open
$viewer->assign('TREE', \App\Json::encode($treeCategoryModel->getTreeData()));
- Exclude checks
Class extends undeclared class \App\Controller\Modal
Open
class Vtiger_TreeInventoryModal_View extends \App\Controller\Modal
- Exclude checks
Call to undeclared method \Vtiger_TreeInventoryModal_View::checkAndConvertCssStyles
Open
return array_merge($this->checkAndConvertCssStyles([
- Exclude checks
Reference to undeclared property \Vtiger_TreeInventoryModal_View->modalIcon
Open
$this->modalIcon = "yfm-{$request->getModule()}";
- Exclude checks
Reference to undeclared class \App\Controller\Modal
Open
]), parent::getModalCss($request));
- Exclude checks
Reference to undeclared class \App\Controller\Modal
Open
return array_merge($this->checkAndConvertJsScripts($scripts), parent::getModalScripts($request));
- Exclude checks
Call to undeclared method \Vtiger_TreeInventoryModal_View::getViewer
Open
$viewer = $this->getViewer($request);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_TreeInventoryModal_View extends \App\Controller\Modal
- Exclude checks
The class Vtiger_TreeInventoryModal_View is not named in CamelCase. Open
class Vtiger_TreeInventoryModal_View extends \App\Controller\Modal
{
/** {@inheritdoc} */
public $autoRegisterEvents = false;
- 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
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function preProcessAjax(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
$this->modalIcon = "yfm-{$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 function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule();
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
if (!\App\Privilege::isPermitted($request->getModule()) || !\App\Privilege::isPermitted($request->getByType('src_module', \App\Purifier::ALNUM))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 406);
- 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
$viewer->view('Modals/TreeModal.tpl', $moduleName);
- 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
parent::preProcessAjax($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
- 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
if (!\App\Privilege::isPermitted($request->getModule()) || !\App\Privilege::isPermitted($request->getByType('src_module', \App\Purifier::ALNUM))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jstree-bootstrap-theme/dist/themes/proton/style.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $autoRegisterEvents = false;
- 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
$treeCategoryModel = Vtiger_TreeInventoryModal_Model::getInstance($moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$scripts = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getModalScripts(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
protected function preProcessTplName(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
return 'Modals/TreeHeader.tpl';
- 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
{
- 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 getModalCss(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge($this->checkAndConvertCssStyles([
- 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
public function checkPermission(App\Request $request)
- 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
'~layouts/resources/libraries/jstree.checkbox.js'
- 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
public $successBtn = 'LBL_SELECT';
- 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
$viewer->assign('TREE', \App\Json::encode($treeCategoryModel->getTreeData()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]), parent::getModalCss($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
$viewer->assign('IS_MULTIPLE', true);
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~layouts/resources/libraries/jstree.category.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/jstree/dist/jstree.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge($this->checkAndConvertJsScripts($scripts), parent::getModalScripts($request));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Class name "Vtiger_TreeInventoryModal_View" is not in camel caps format Open
class Vtiger_TreeInventoryModal_View extends \App\Controller\Modal
- Exclude checks