YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/ListPreview.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_ListView_Model' in method 'initializeListViewContents'.
Open

            $this->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);
Severity: Minor
Found in modules/Vtiger/views/ListPreview.php by phpmd

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

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

class Vtiger_ListPreview_View extends Vtiger_List_View

The class Vtiger_ListPreview_View is not named in CamelCase.
Open

class Vtiger_ListPreview_View extends Vtiger_List_View
{
    /** {@inheritdoc} */
    public function process(App\Request $request)
    {
Severity: Minor
Found in modules/Vtiger/views/ListPreview.php by phpmd

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

            $this->viewName = App\CustomView::getInstance($moduleName)->getViewId();

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

    /** {@inheritdoc} */

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

        if ($request->isAjax() && !isset($this->viewName)) {

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

        }

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

    /** {@inheritdoc} */

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

        $viewer = $this->getViewer($request);

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

        $moduleName = $request->getModule();

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

        $viewer->view('List/Preview.tpl', $moduleName);

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

    {

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

            'modules.Vtiger.resources.ListPreview',

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

    /** {@inheritdoc} */

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

            '~libraries/split.js/dist/split.js',

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

    {

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

        $viewer->view('Detail/Preview.tpl', $moduleName);

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

        $scripts = parent::getFooterScripts($request);

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

        return array_merge($scripts, $this->checkAndConvertJsScripts([

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

            "modules.$moduleName.resources.ListPreview",

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

        $moduleName = $request->getModule();

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

    }

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

        parent::initializeListViewContents($request, $viewer);

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

    }

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

        parent::process($request);

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

        if (!$this->listViewModel) {

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

    public function getFooterScripts(App\Request $request)

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

        $moduleName = $request->getModule();

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

        unset($scripts['modules.Vtiger.resources.ListPreview'], $scripts["modules.$moduleName.resources.ListPreview"]);

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

    public function process(App\Request $request)

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

            $this->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);

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

class Vtiger_ListPreview_View extends Vtiger_List_View

There are no issues that match your filters.

Category
Status