YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
C
77%

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'
Severity: Minor
Found in modules/Occurrences/models/Module.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

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

class Occurrences_Module_Model extends Vtiger_Module_Model

The class Occurrences_Module_Model is not named in CamelCase.
Open

class Occurrences_Module_Model extends Vtiger_Module_Model
{
    /**
     * Calendar view url.
     *
Severity: Minor
Found in modules/Occurrences/models/Module.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

    public function getCalendarViewUrl()

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

    /** {@inheritdoc} */

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

    {

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

    }

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

            '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

     * Calendar view url.

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

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

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

    }

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

            '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

        return $links;

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

        ]));

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 getLayoutTypeForQuickCreate(): string

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 'standard';

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

class Occurrences_Module_Model extends Vtiger_Module_Model

There are no issues that match your filters.

Category
Status