Missing class import via use statement (line '19', 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
Missing class import via use statement (line '22', 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 '\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
Avoid using static access to class 'Vtiger_TreeCategoryModal_Model' in method 'process'. Open
$treeCategoryModel = Vtiger_TreeCategoryModal_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 '\App\Privilege' in method 'checkPermission'. Open
if (!\App\Privilege::isPermitted($request->getByType('src_module', 2), 'DetailView', $recordId)) {
- 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 'Users_Record_Model' in method 'process'. Open
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
- 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 unused parameters such as '$request'. Open
public function getSize(App\Request $request)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('TREE', \App\Json::encode($treeCategoryModel->getTreeData()));
- Exclude checks
Reference to undeclared property \Vtiger_TreeCategoryModal_View->relationType
Open
$this->relationType = $treeCategoryModel->getRelationType();
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE', $moduleName);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SRC_MODULE', $srcModule);
- Exclude checks
Call to undeclared method \Vtiger_TreeView_Model::getRelationType
Open
$this->relationType = $treeCategoryModel->getRelationType();
- Exclude checks
Call to undeclared method \Vtiger_TreeView_Model::getTreeData
Open
$viewer->assign('TREE', \App\Json::encode($treeCategoryModel->getTreeData()));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RELATION_TYPE', $this->relationType);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('TEMPLATE', $treeCategoryModel->getTemplate());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SRC_RECORD', $srcRecord);
- Exclude checks
Reference to undeclared property \Vtiger_TreeCategoryModal_View->relationType
Open
$viewer->assign('RELATION_TYPE', $this->relationType);
- Exclude checks
Reference to undeclared property \Vtiger_TreeCategoryModal_View->relationType
Open
if (1 == $this->relationType) {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_TreeCategoryModal_View extends Vtiger_BasicModal_View
- Exclude checks
The class Vtiger_TreeCategoryModal_View is not named in CamelCase. Open
class Vtiger_TreeCategoryModal_View extends Vtiger_BasicModal_View
{
public function checkPermission(App\Request $request)
{
$recordId = $request->getInteger('src_record');
- 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
return 'modal-lg';
- 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
}
- 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->view('TreeCategoryModal.tpl', $moduleName);
- 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
* @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
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$scripts[] = '~layouts/resources/libraries/jstree.edit.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
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
'~layouts/resources/libraries/jstree.category.js',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$srcModule = $request->getByType('src_module', 2);
- 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
public function getModalCss(App\Request $request)
- 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 function checkPermission(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\Privilege::isPermitted($request->getByType('src_module', 2), 'DetailView', $recordId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get size modal window.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSize(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
];
- 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
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$treeCategoryModel->set('srcModule', $srcModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SRC_MODULE', $srcModule);
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->postProcess($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 == $this->relationType) {
- 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 array_merge($this->checkAndConvertCssStyles([
- 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
$this->preProcess($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->relationType = $treeCategoryModel->getRelationType();
- 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
$treeCategoryModel->set('srcRecord', $srcRecord);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE', $moduleName);
- 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
$scripts[] = 'modules.Vtiger.resources.TreeCategoryModal';
- 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
if (!$recordId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SRC_RECORD', $srcRecord);
- 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
}
- 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
$recordId = $request->getInteger('src_record');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$srcRecord = $request->getInteger('src_record');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RELATION_TYPE', $this->relationType);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$treeCategoryModel = Vtiger_TreeCategoryModal_Model::getInstance($moduleModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('TEMPLATE', $treeCategoryModel->getTemplate());
- 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
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
- Exclude checks
Class name "Vtiger_TreeCategoryModal_View" is not in camel caps format Open
class Vtiger_TreeCategoryModal_View extends Vtiger_BasicModal_View
- Exclude checks