Method process
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleName = $request->getModule();
$viewId = $entityState = false;
$selectedIds = $request->getArray('selected_ids', 2);
Missing class import via use statement (line '25', 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
Avoid using static access to class '\App\Condition' in method 'process'. Open
$viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
- 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_Privileges_Model' in method 'checkPermission'. Open
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
- 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 'Import_Module_Model' in method 'process'. Open
$viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($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\Condition' in method 'process'. Open
$viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
- 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\Export\Records' in method 'process'. Open
$viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($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\Condition' in method 'process'. Open
\App\Condition::validAdvancedConditions($advancedConditions);
- 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_Viewer::assign
Open
$viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('PAGE', $page);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SEARCH_KEY', $request->getByType('search_key', 'Alnum'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE', 'Export');
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('EXCLUDED_IDS', $excludedIds);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ENTITY_STATE', $entityState);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('VIEWID', $viewId);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($moduleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('OPERATOR', $request->getByType('operator'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SELECTED_IDS', $selectedIds);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('MODULE_NAME', $moduleName);
- Exclude checks
Argument 1 (moduleName)
is string
but \Import_Module_Model::getListTplForXmlType()
takes \type
defined at /code/modules/Import/models/Module.php:140
Open
$viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_Export_View extends Vtiger_Index_View
- Exclude checks
The class Vtiger_Export_View is not named in CamelCase. Open
class Vtiger_Export_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
*/
- 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
$viewId = $entityState = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($advancedConditions) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
- 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
$selectedIds = $request->getArray('selected_ids', 2);
- 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
$advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : [];
- 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
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('EXCLUDED_IDS', $excludedIds);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('VIEWID', $viewId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('OPERATOR', $request->getByType('operator'));
- 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
public function checkPermission(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$page = $request->getInteger('page');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('XML_TPL_LIST', Import_Module_Model::getListTplForXmlType($moduleName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Condition::validAdvancedConditions($advancedConditions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewId = $request->getByType('viewname', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->view('Export.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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE', 'Export');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
- 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('PAGE', $page);
- Exclude checks
Line exceeds 120 characters; contains 211 characters Open
$viewer->assign('ALPHABET_VALUE', \App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $request->getByType('search_key', 'Alnum'), $request->getByType('operator')));
- 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 (!$userPrivilegesModel->hasModuleActionPermission($request->getModule(), 'Export')) {
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('EXPORT_TYPE', \App\Export\Records::getSupportedFileFormats($moduleName));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SEARCH_KEY', $request->getByType('search_key', 'Alnum'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('viewname')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$request->isEmpty('entityState')) {
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
- 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
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ENTITY_STATE', $entityState);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SEARCH_PARAMS', \App\Condition::validSearchParams($moduleName, $request->getArray('search_params'), false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('SELECTED_IDS', $selectedIds);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);
- 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
$excludedIds = $request->getArray('excluded_ids', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$entityState = $request->getByType('entityState');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('MODULE_NAME', $moduleName);
- Exclude checks
Class name "Vtiger_Export_View" is not in camel caps format Open
class Vtiger_Export_View extends Vtiger_Index_View
- Exclude checks