YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/CronTasks/views/List.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '18', column '22').
Open

        $pagingModel = new Vtiger_Paging_Model();

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

        $listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(false));

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('PAGING_MODEL', $pagingModel);
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Assigning array to property but \Settings_CronTasks_List_View->listViewHeaders is false
Open

            $this->listViewHeaders = $listViewModel->getListViewHeaders();

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MODULE_MODEL', $module);
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Assigning \Settings_Vtiger_Record_Model[] to property but \Settings_CronTasks_List_View->listViewEntries is false
Open

            $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('QUALIFIED_MODULE', $request->getModule(false));
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('LAST_CRON', $module->getLastCronIteration());
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Call to undeclared method \Settings_Vtiger_Module_Model::getLastCronIteration
Open

        $viewer->assign('LAST_CRON', $module->getLastCronIteration());
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
Severity: Critical
Found in modules/Settings/CronTasks/views/List.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Settings_CronTasks_List_View extends Settings_Vtiger_List_View

The class Settings_CronTasks_List_View is not named in CamelCase.
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));

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

        if (!$this->listViewEntries) {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$this->listViewHeaders) {

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->listViewEntries = $listViewModel->getListViewEntries($pagingModel);

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('PAGING_MODEL', $pagingModel);

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('QUALIFIED_MODULE', $request->getModule(false));

Spaces must be used to indent lines; tabs are not allowed
Open

        $listViewModel->set('orderby', 'sequence');

Spaces must be used to indent lines; tabs are not allowed
Open

        $module = $listViewModel->getModule();

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('LAST_CRON', $module->getLastCronIteration());

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->listViewHeaders = $listViewModel->getListViewHeaders();

Spaces must be used to indent lines; tabs are not allowed
Open

        $viewer->assign('MODULE_MODEL', $module);

Spaces must be used to indent lines; tabs are not allowed
Open

        $listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(false));

Spaces must be used to indent lines; tabs are not allowed
Open

        $pagingModel = new Vtiger_Paging_Model();

Class name "Settings_CronTasks_List_View" is not in camel caps format
Open

class Settings_CronTasks_List_View extends Settings_Vtiger_List_View

There are no issues that match your filters.

Category
Status