modules/Settings/CronTasks/views/List.php
Missing class import via use statement (line '18', column '22'). Open
Open
$pagingModel = new Vtiger_Paging_Model();
- 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 'Settings_Vtiger_ListView_Model' in method 'initializeListViewContents'. Open
Open
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(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
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('PAGING_MODEL', $pagingModel);
- Exclude checks
Assigning array
to property but \Settings_CronTasks_List_View->listViewHeaders
is false
Open
Open
$this->listViewHeaders = $listViewModel->getListViewHeaders();
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('MODULE_MODEL', $module);
- Exclude checks
Assigning \Settings_Vtiger_Record_Model[]
to property but \Settings_CronTasks_List_View->listViewEntries
is false
Open
Open
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('LAST_CRON', $module->getLastCronIteration());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
- Exclude checks
Call to undeclared method \Settings_Vtiger_Module_Model::getLastCronIteration
Open
Open
$viewer->assign('LAST_CRON', $module->getLastCronIteration());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_CronTasks_List_View extends Settings_Vtiger_List_View
- Exclude checks
The class Settings_CronTasks_List_View is not named in CamelCase. Open
Open
class Settings_CronTasks_List_View extends Settings_Vtiger_List_View
{
public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
{
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(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
Open
if (!$this->listViewEntries) {
- 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
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$this->listViewHeaders) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
- 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
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('PAGING_MODEL', $pagingModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$listViewModel->set('orderby', 'sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$module = $listViewModel->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('LAST_CRON', $module->getLastCronIteration());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->listViewHeaders = $listViewModel->getListViewHeaders();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('MODULE_MODEL', $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$pagingModel = new Vtiger_Paging_Model();
- Exclude checks
Class name "Settings_CronTasks_List_View" is not in camel caps format Open
Open
class Settings_CronTasks_List_View extends Settings_Vtiger_List_View
- Exclude checks