YetiForceCompany/YetiForceCRM

View on GitHub
modules/Calendar/models/QuickCreateView.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

        $links['QUICKCREATE_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues([
            'linktype' => 'QUICKCREATE_VIEW_HEADER',
            'linkhint' => 'LBL_MARK_AS_HELD',
            'linkicon' => 'far fa-square fa-lg mr-1 c-btn-checkbox--unchecked',
            'linksecondicon' => 'far fa-check-square fa-lg mr-1 c-btn-checkbox--checked',

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 Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model

The class Calendar_QuickCreateView_Model is not named in CamelCase.
Open

class Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model
{
    /** {@inheritdoc} */
    public function getLinks(array $linkParams)
    {

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

    /** {@inheritdoc} */

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

    public function getLinks(array $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

        $links = parent::getLinks($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

            'linkicon' => 'far fa-square fa-lg mr-1 c-btn-checkbox--unchecked',

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

            'linkclass' => 'c-btn-checkbox c-btn-outline-done js-btn--mark-as-completed btn-group-toggle'

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

            'linktype' => 'QUICKCREATE_VIEW_HEADER',

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

            'showLabel' => 1,

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

        $links['QUICKCREATE_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues([

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

            'linksecondicon' => 'far fa-check-square fa-lg mr-1 c-btn-checkbox--checked',

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

            'linkhint' => 'LBL_MARK_AS_HELD',

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

            'linkdata' => ['js' => 'click', 'toggle' => 'buttons'],

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

class Calendar_QuickCreateView_Model extends Vtiger_QuickCreateView_Model

There are no issues that match your filters.

Category
Status