YetiForceCompany/YetiForceCRM

View on GitHub
modules/Rss/views/List.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

The method postProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

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

            $recordInstance = Rss_Record_Model::getInstanceById($request->getInteger('id'), $module);
Severity: Minor
Found in modules/Rss/views/List.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

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

            $recordInstance = Rss_Record_Model::getCleanInstance($module);
Severity: Minor
Found in modules/Rss/views/List.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

The method initializeListViewContents uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $recordInstance = Rss_Record_Model::getCleanInstance($module);
            $recordInstance->getDefaultRss();
            $recordInstance = Rss_Record_Model::getInstanceById($recordInstance->getId(), $module);
        }
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

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

            $recordInstance = Rss_Record_Model::getInstanceById($recordInstance->getId(), $module);
Severity: Minor
Found in modules/Rss/views/List.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

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

        $moduleModel = Vtiger_Module_Model::getInstance($module);
Severity: Minor
Found in modules/Rss/views/List.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

Avoid using static access to class 'Vtiger_Module_Model' in method 'process'.
Open

        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Rss/views/List.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

Avoid unused parameters such as '$request'.
Open

    public function preProcessTplName(App\Request $request)
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$display'.
Open

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$display'.
Open

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('HEADER_LINKS', ['LIST_VIEW_HEADER' => []]);
Severity: Critical
Found in modules/Rss/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

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

Saw unextractable annotation for comment '* @return <array> - List of Vtiger_JsScript_Model instances'</array>
Open

     * @return <Array> - List of Vtiger_JsScript_Model instances
Severity: Info
Found in modules/Rss/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RECORD', $recordInstance);
Severity: Critical
Found in modules/Rss/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('QUICK_LINKS', $moduleModel->getSideBarLinks($linkParams));
Severity: Critical
Found in modules/Rss/views/List.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SOURCE_MODULE', $moduleName);
Severity: Critical
Found in modules/Rss/views/List.php by phan

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

class Rss_List_View extends Vtiger_Index_View
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

The class Rss_List_View is not named in CamelCase.
Open

class Rss_List_View extends Vtiger_Index_View
{
    public function preProcess(App\Request $request, $display = true)
    {
        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Rss/views/List.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

        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            'modules.CustomView.resources.CustomView',
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function process(App\Request $request)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->view('ListViewPostProcess.tpl', $moduleName);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            'modules.Vtiger.resources.List',
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            "modules.{$moduleName}.resources.ListSearch"
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        ]));
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('MODULE', $module);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $linkParams = ['MODULE' => $module, 'ACTION' => $request->getByType('view', 1)];
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    /**
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     * Function to get the list of Script models to be included.
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('MODULE_MODEL', $moduleModel);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function postProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        } else {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            "modules.$moduleName.resources.CustomView",
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     *
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function getFooterScripts(App\Request $request)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        parent::preProcess($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $this->initializeListViewContents($request, $viewer);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('SOURCE_MODULE', $moduleName);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $module = $request->getModule();
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $moduleModel = Vtiger_Module_Model::getInstance($module);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     *
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        return 'ListViewPreProcess.tpl';
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        parent::postProcess($request);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     */
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        if (!$request->isEmpty('id')) {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->view('ListViewContents.tpl', $moduleName);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    // Function to initialize the required data in smarty to display the List View Contents
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('RECORD', $recordInstance);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     * @param \App\Request $request
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    {
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            'modules.Vtiger.resources.ListSearch',
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function preProcessTplName(App\Request $request)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            $recordInstance = Rss_Record_Model::getInstanceById($request->getInteger('id'), $module);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            $recordInstance = Rss_Record_Model::getCleanInstance($module);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            $recordInstance = Rss_Record_Model::getInstanceById($recordInstance->getId(), $module);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    }
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

     * @return <Array> - List of Vtiger_JsScript_Model instances
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

    public function preProcess(App\Request $request, $display = true)
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('HEADER_LINKS', ['LIST_VIEW_HEADER' => []]);
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            $recordInstance->getDefaultRss();
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

        $viewer->assign('QUICK_LINKS', $moduleModel->getSideBarLinks($linkParams));
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

            "modules.$moduleName.resources.List",
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

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

class Rss_List_View extends Vtiger_Index_View
Severity: Minor
Found in modules/Rss/views/List.php by phpcodesniffer

There are no issues that match your filters.

Category
Status