modules/Campaigns/views/RelatedList.php
Avoid using static access to class 'CustomView_Record_Model' in method 'process'. Open
Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));
- 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
Open
$viewer->assign('EXCLUDED_IDS', $request->getArray('excludedIds', 'Integer'));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Campaigns_RelatedList_View extends Vtiger_RelatedList_View
- Exclude checks
The class Campaigns_RelatedList_View is not named in CamelCase. Open
Open
class Campaigns_RelatedList_View extends Vtiger_RelatedList_View
{
public function process(App\Request $request)
{
$relatedModuleName = $request->getByType('relatedModule', 2);
- 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
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$relatedModuleName = $request->getByType('relatedModule', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('EXCLUDED_IDS', $request->getArray('excludedIds', 'Integer'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return parent::process($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (\in_array($relatedModuleName, ['Accounts', 'Leads', 'Vendors', 'Contacts', 'Partners', 'Competition'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
Open
$viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));
- Exclude checks
Class name "Campaigns_RelatedList_View" is not in camel caps format Open
Open
class Campaigns_RelatedList_View extends Vtiger_RelatedList_View
- Exclude checks