YetiForceCompany/YetiForceCRM

View on GitHub
modules/Reservations/models/Module.php

Summary

Maintainability
A
0 mins
Test Coverage
B
81%

Avoid using static access to class 'Vtiger_Link_Model' in method 'getSideBarLinks'.
Open

        array_unshift($links['SIDEBARLINK'], Vtiger_Link_Model::getInstanceFromValues([
            'linktype' => 'SIDEBARLINK',
            'linklabel' => 'LBL_CALENDAR',
            'linkurl' => $this->getCalendarViewUrl(),
            'linkicon' => 'fas fa-calendar-alt'

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 Reservations_Module_Model extends Vtiger_Module_Model

The class Reservations_Module_Model is not named in CamelCase.
Open

class Reservations_Module_Model extends Vtiger_Module_Model
{
    public function getCalendarViewUrl()
    {
        return 'index.php?module=' . $this->get('name') . '&view=Calendar';

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

        $links = parent::getSideBarLinks($linkParams);

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

        return 'index.php?module=' . $this->get('name') . '&view=Calendar';

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

    }

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

        array_unshift($links['SIDEBARLINK'], Vtiger_Link_Model::getInstanceFromValues([

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

            'linktype' => 'SIDEBARLINK',

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

    }

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

     * @return string

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

    public function getLayoutTypeForQuickCreate(): string

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

        return 'standard';

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

    public function getSideBarLinks($linkParams)

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

        return $links;

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

    public function getDefaultViewName()

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

    }

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

     * Function to get the Default View Component Name.

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

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

     */

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

            'linkurl' => $this->getCalendarViewUrl(),

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

            'linklabel' => 'LBL_CALENDAR',

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

            'linkicon' => 'fas fa-calendar-alt'

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

        return 'Calendar';

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

    /**

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

     *

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

class Reservations_Module_Model extends Vtiger_Module_Model

There are no issues that match your filters.

Category
Status