YetiForceCompany/YetiForceCRM

View on GitHub
modules/Products/views/Widget.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Products_SummaryWidget_Model' in method 'showProductsServices'.
Open

        $moduleModel = Products_SummaryWidget_Model::getCleanInstance();
Severity: Minor
Found in modules/Products/views/Widget.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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RECORDID', $request->getInteger('record'));
Severity: Critical
Found in modules/Products/views/Widget.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MODULE_NAME', $moduleName);
Severity: Critical
Found in modules/Products/views/Widget.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SOURCE_MODULE', $fromModule);
Severity: Critical
Found in modules/Products/views/Widget.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RELATED_MODULE', $mod);
Severity: Critical
Found in modules/Products/views/Widget.php by phan

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

class Products_Widget_View extends Vtiger_Index_View

The class Products_Widget_View is not named in CamelCase.
Open

class Products_Widget_View extends Vtiger_Index_View
{
    use \App\Controller\ExposeMethod;

    public function __construct()
Severity: Minor
Found in modules/Products/views/Widget.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

        $moduleModel = Products_SummaryWidget_Model::getCleanInstance();

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

    {

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

        $fromModule = $request->getByType('fromModule');

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

        $viewer->assign('SOURCE_MODULE', $fromModule);

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

    }

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

        parent::__construct();

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

    public function showProductsServices(App\Request $request)

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

        $moduleModel->getProductsServices($request, $viewer);

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

        $viewer->assign('RECORDID', $request->getInteger('record'));

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

        $viewer->assign('RELATED_MODULE', $mod);

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

    use \App\Controller\ExposeMethod;

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->assign('MODULE_NAME', $moduleName);

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

        $this->exposeMethod('showProductsServices');

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 __construct()

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

        $mod = current($request->getArray('mod', 'Alnum'));

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

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

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

    }

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

class Products_Widget_View extends Vtiger_Index_View

There are no issues that match your filters.

Category
Status