YetiForceCompany/YetiForceCRM

View on GitHub
modules/Calendar/views/Calendar.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/Calendar/views/Calendar.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 'Calendar_CalendarFilters_Model' in method 'postProcess'.
Open

        $viewer->assign('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());
Severity: Minor
Found in modules/Calendar/views/Calendar.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 'Calendar_Module_Model' in method 'process'.
Open

            'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),
Severity: Minor
Found in modules/Calendar/views/Calendar.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 'Calendar_Module_Model' in method 'process'.
Open

            'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),
Severity: Minor
Found in modules/Calendar/views/Calendar.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 '\App\Json' in method 'process'.
Open

        $viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([
            'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),
            'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),
        ]));
Severity: Minor
Found in modules/Calendar/views/Calendar.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('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());
Severity: Critical
Found in modules/Calendar/views/Calendar.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([
Severity: Critical
Found in modules/Calendar/views/Calendar.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('SHOW_TYPE', true);
Severity: Critical
Found in modules/Calendar/views/Calendar.php by phan

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

class Calendar_Calendar_View extends Vtiger_Calendar_View

The class Calendar_Calendar_View is not named in CamelCase.
Open

class Calendar_Calendar_View extends Vtiger_Calendar_View
{
    /** {@inheritdoc} */
    protected $filters = ['Events', 'Filter'];

Severity: Minor
Found in modules/Calendar/views/Calendar.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 for alignment; tabs are not allowed
Open

        ]));

Spaces must be used for alignment; tabs are not allowed
Open

    public function postProcess(App\Request $request, $display = true)

Spaces must be used for alignment; tabs are not allowed
Open

        parent::postProcess($request);

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

        $viewer->assign('CALENDAR_FILTERS', Calendar_CalendarFilters_Model::getCleanInstance());

Spaces must be used for alignment; tabs are not allowed
Open

        $viewer->assign('SHOW_TYPE', true);

Spaces must be used for alignment; tabs are not allowed
Open

    protected $filters = ['Events', 'Filter'];

Spaces must be used for alignment; tabs are not allowed
Open

        parent::process($request);

Spaces must be used for alignment; tabs are not allowed
Open

 * @author    Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

        $viewer->assign('ACTIVITY_STATE_LABELS', \App\Json::encode([

Spaces must be used for alignment; tabs are not allowed
Open

            'current' => Calendar_Module_Model::getComponentActivityStateLabel('current'),

Spaces must be used for alignment; tabs are not allowed
Open

            'history' => Calendar_Module_Model::getComponentActivityStateLabel('history'),

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    public function process(App\Request $request)

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

class Calendar_Calendar_View extends Vtiger_Calendar_View

There are no issues that match your filters.

Category
Status