YetiForceCompany/YetiForceCRM

View on GitHub
modules/Campaigns/views/RelatedList.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

            $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));

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('EXCLUDED_IDS', $request->getArray('excludedIds', 'Integer'));
Severity: Critical
Found in modules/Campaigns/views/RelatedList.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

            $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));
Severity: Critical
Found in modules/Campaigns/views/RelatedList.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

            $viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));
Severity: Critical
Found in modules/Campaigns/views/RelatedList.php by phan

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

class Campaigns_RelatedList_View extends Vtiger_RelatedList_View

The class Campaigns_RelatedList_View is not named in CamelCase.
Open

class Campaigns_RelatedList_View extends Vtiger_RelatedList_View
{
    public function process(App\Request $request)
    {
        $relatedModuleName = $request->getByType('relatedModule', 2);

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

    }

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

        $relatedModuleName = $request->getByType('relatedModule', 2);

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

            $viewer->assign('EXCLUDED_IDS', $request->getArray('excludedIds', 'Integer'));

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

        return parent::process($request);

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

        if (\in_array($relatedModuleName, ['Accounts', 'Leads', 'Vendors', 'Contacts', 'Partners', 'Competition'])) {

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

            $viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));

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

        }

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

    {

Line exceeds 120 characters; contains 142 characters
Open

            $viewer->assign('SELECTED_IDS', 'all' === $request->getRaw('selectedIds') ? 'all' : $request->getArray('selectedIds', 'Integer'));

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

            $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($relatedModuleName));

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

class Campaigns_RelatedList_View extends Vtiger_RelatedList_View

There are no issues that match your filters.

Category
Status