YetiForceCompany/YetiForceCRM

View on GitHub
modules/Calendar/views/ActivityState.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Mail' in method 'getLinks'.
Open

        if ($this->record->isEditable() && \App\Mail::checkInternalMailClient()) {

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 'Vtiger_Link_Model' in method 'getLinks'.
Open

            $links[] = Vtiger_Link_Model::getInstanceFromValues([
                'linklabel' => 'LBL_SEND_CALENDAR',
                'linkdata' => ['url' => "index.php?module={$this->record->getModuleName()}&view=SendInvitationModal&record={$this->record->getId()}"],
                'linkicon' => 'yfi-send-invitation',
                'linkclass' => 'js-show-modal mt-1 mr-1',

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

Reference to undeclared property \Calendar_ActivityState_View->record
Open

        if ($this->record->isEditable() && \App\Mail::checkInternalMailClient()) {

Reference to undeclared property \Calendar_ActivityState_View->record
Open

                'linkdata' => ['url' => "index.php?module={$this->record->getModuleName()}&view=SendInvitationModal&record={$this->record->getId()}"],

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

class Calendar_ActivityState_View extends Calendar_ActivityStateModal_View

The class Calendar_ActivityState_View is not named in CamelCase.
Open

class Calendar_ActivityState_View extends Calendar_ActivityStateModal_View
{
    /** {@inheritdoc} */
    protected function getTpl()
    {

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

        return 'Calendar/ActivityState.tpl';

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 = [];

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

            $links[] = Vtiger_Link_Model::getInstanceFromValues([

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

                'linklabel' => 'LBL_SEND_CALENDAR',

Line exceeds 120 characters; contains 150 characters
Open

                'linkdata' => ['url' => "index.php?module={$this->record->getModuleName()}&view=SendInvitationModal&record={$this->record->getId()}"],

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

                'linkicon' => 'yfi-send-invitation',

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

    protected function getTpl()

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

    {

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

                'linkdata' => ['url' => "index.php?module={$this->record->getModuleName()}&view=SendInvitationModal&record={$this->record->getId()}"],

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

    /** {@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

                'linkclass' => 'js-show-modal mt-1 mr-1',

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

    public function getLinks(): array

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

        if ($this->record->isEditable() && \App\Mail::checkInternalMailClient()) {

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

class Calendar_ActivityState_View extends Calendar_ActivityStateModal_View

There are no issues that match your filters.

Category
Status