YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Missing class import via use statement (line '25', column '23').
Open

        $timeControl = (new App\Db\Query())->from('vtiger_osstimecontrol')

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class '\App\Log' in method 'process'.
Open

        \App\Log::trace('Entering TotalTimeWorked::process() method ...');

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 '\App\Fields\RangeTime' in method 'process'.
Open

        return \App\Fields\RangeTime::displayElapseTime($timeControl);

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

Class \TotalTimeWorked defined at /code/modules/Leads/summary_blocks/TotalTimeWorked.php:9 was previously defined as Class \TotalTimeWorked at /code/modules/Accounts/summary_blocks/TotalTimeWorked.php:8
Open

class TotalTimeWorked

Call to method trace from undeclared class \App\Log
Open

        \App\Log::trace('Entering TotalTimeWorked::process() method ...');

Call to undeclared method \App\Db\Query::from
Open

        $timeControl = (new App\Db\Query())->from('vtiger_osstimecontrol')

Returning type string but process() is declared to return int
Open

        return \App\Fields\RangeTime::displayElapseTime($timeControl);

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

class TotalTimeWorked

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

     * @return int

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

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

            ->sum('vtiger_osstimecontrol.sum_time');

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 $sequence = 5;

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

            ->where(['vtiger_crmentity.deleted' => 0, 'vtiger_osstimecontrol.link' => $recordModel->getId()])

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

        \App\Log::trace('Entering TotalTimeWorked::process() method ...');

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

            ->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_osstimecontrol.osstimecontrolid')

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

    public $name = 'Total time worked';

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

     * Process.

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

        $timeControl = (new App\Db\Query())->from('vtiger_osstimecontrol')

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

        return \App\Fields\RangeTime::displayElapseTime($timeControl);

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

     * @param Vtiger_Record_Model $recordModel

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

    }

There are no issues that match your filters.

Category
Status