modules/Accounts/summary_blocks/TotalTimeWorked.php
Missing class import via use statement (line '23', column '15'). Open
Open
$sum = (new \App\Db\Query())->from('vtiger_osstimecontrol')
- Read upRead up
- Exclude checks
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\Fields\RangeTime' in method 'process'. Open
Open
return \App\Fields\RangeTime::displayElapseTime($sum);
- Read upRead up
- Exclude checks
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
Call to undeclared method \App\Db\Query::from
Open
Open
$sum = (new \App\Db\Query())->from('vtiger_osstimecontrol')
- Exclude checks
Returning type string
but process()
is declared to return int
Open
Open
return \App\Fields\RangeTime::displayElapseTime($sum);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class TotalTimeWorked
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $name = 'Total time worked';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param Vtiger_Record_Model $recordModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$sum = (new \App\Db\Query())->from('vtiger_osstimecontrol')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $reference = 'OSSTimeControl';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(Vtiger_Record_Model $recordModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
->where(['vtiger_crmentity.deleted' => 0, 'vtiger_osstimecontrol.link' => $recordModel->getId(), 'osstimecontrol_status' => 'Accepted'])->sum('sum_time');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $sequence = 6;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Process function.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
->innerJoin('vtiger_crmentity', 'vtiger_osstimecontrol.osstimecontrolid = vtiger_crmentity.crmid')
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
Open
->where(['vtiger_crmentity.deleted' => 0, 'vtiger_osstimecontrol.link' => $recordModel->getId(), 'osstimecontrol_status' => 'Accepted'])->sum('sum_time');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return \App\Fields\RangeTime::displayElapseTime($sum);
- Exclude checks