Missing class import via use statement (line '26', column '14'). Open
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 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
The method preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
public function preProcess(App\Request $request, $display = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method postProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation. Open
public function postProcess(App\Request $request, $display = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Avoid using static access to class 'Vtiger_ListView_Model' in method 'process'. Open
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $filter);
- 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 'getBreadcrumbTitle'. Open
return \App\Language::translate($treeViewModel->getName(), $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 'Vtiger_TreeView_Model' in method 'preProcess'. Open
$treeViewModel = Vtiger_TreeView_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 'CustomView_Record_Model' in method 'postProcess'. Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($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\Json' in method 'preProcess'. Open
$viewer->assign('TREE_LIST', \App\Json::encode($treeList));
- 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_TreeView_Model' in method 'getBreadcrumbTitle'. Open
$treeViewModel = Vtiger_TreeView_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 'Vtiger_TreeView_Model' in method 'process'. Open
$treeViewModel = Vtiger_TreeView_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 unused parameters such as '$display'. Open
public function preProcess(App\Request $request, $display = true)
- 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_LIST', \App\Json::encode($treeList));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ENTRIES', $listEntries);
- Exclude checks
Call to method addCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$listViewModel->getQueryGenerator()->addCondition($field['fieldname'], implode('##', $branches), 'e');
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('HEADERS', $listHeaders);
- 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('VIEWID', $filter);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_TreeRecords_View extends Vtiger_Index_View
- Exclude checks
The class Vtiger_TreeRecords_View is not named in CamelCase. Open
class Vtiger_TreeRecords_View extends Vtiger_Index_View
{
/**
* Function to check permission.
*
- 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
parent::checkPermission($request);
- 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 postProcess(App\Request $request, $display = true)
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function preProcess(App\Request $request, $display = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::preProcess($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
* Function to check permission.
- 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
parent::postProcess($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
$treeViewModel = Vtiger_TreeView_Model::getInstance($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getBreadcrumbTitle(App\Request $request)
- 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
{
- 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
$treeList = $treeViewModel->getTreeList();
- 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
/**
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!Vtiger_TreeView_Model::getInstance($request->getModule())->isActive()) {
- 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
* @throws \App\Exceptions\NoPermitted
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($display) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-responsive-bs4/js/responsive.bootstrap4.js'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('TreeRecordsPreProcess.tpl', $moduleName);
- 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->assign('HEADERS', $listHeaders);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFooterScripts(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-bs4/css/dataTables.bootstrap4.css',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$filter = $request->has('filter') ? $request->getByType('filter', 'Alnum') : \App\CustomView::getInstance($moduleName)->getViewId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === \count($listEntries)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ENTRIES', $listEntries);
- 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
]));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function postProcessDisplay(App\Request $request)
- 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
'~libraries/datatables.net-bs4/js/dataTables.bootstrap4.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
$treeViewModel = Vtiger_TreeView_Model::getInstance($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
$this->postProcessDisplay($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->view('TreeRecordsPostProcess.tpl', $request->getModule());
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('TREE_LIST', \App\Json::encode($treeList));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $filter);
- 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
$listHeaders = $listViewModel->getListViewHeaders();
- 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
public function checkPermission(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Language::translate($treeViewModel->getName(), $moduleName);
- 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
return;
- 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
'~libraries/datatables.net-responsive-bs4/css/responsive.bootstrap4.css'
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
$filter = $request->has('filter') ? $request->getByType('filter', 'Alnum') : \App\CustomView::getInstance($moduleName)->getViewId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('VIEWID', $filter);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($request->isEmpty('branches', true)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$treeViewModel = Vtiger_TreeView_Model::getInstance($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getHeaderCss(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net-responsive/js/dataTables.responsive.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
$field = $treeViewModel->getTreeField();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$listEntries = $listViewModel->getAllEntries();
- 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(parent::getHeaderCss($request), $this->checkAndConvertCssStyles([
- 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
}
- 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
$listViewModel->getQueryGenerator()->addCondition($field['fieldname'], implode('##', $branches), 'e');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'~libraries/datatables.net/js/jquery.dataTables.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
$branches = $request->getArray('branches', 'Text');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('TreeRecords.tpl', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Class name "Vtiger_TreeRecords_View" is not in camel caps format Open
class Vtiger_TreeRecords_View extends Vtiger_Index_View
- Exclude checks