YetiForceCompany/YetiForceCRM

View on GitHub
modules/Leads/summary_blocks/TotalEmails.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class 'Vtiger_RelationListView_Model' in method 'process'.
Open

        $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $this->reference);

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 TotalEmails

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

    public $name = 'Total emails';

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 $reference = 'OSSMailView';

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

     * Function get number of emails.

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

     *

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

     * @param Vtiger_Record_Model $recordModel

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

     * @return int - Number of emails

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

        return (int) $relationListView->getRelatedEntriesCount();

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

    public function process(Vtiger_Record_Model $recordModel)

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

    public $sequence = 1;

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

        $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $this->reference);

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

    {

There are no issues that match your filters.

Category
Status