modules/Users/views/Detail.php
Avoid using static access to class 'Vtiger_Record_Model' in method 'process'. Open
Open
$recordModel = !empty($this->record) ? $this->record->getRecord() : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
- 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
Avoid using static access to class '\App\Json' in method 'process'. Open
Open
$viewer->assign('DAY_STARTS', \App\Json::encode($dayStartPicklistValues));
- 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
Class extends undeclared class \Vtiger_Detail_View
Open
Open
class Users_Detail_View extends Vtiger_Detail_View
- Exclude checks
Reference to undeclared property \Users_Detail_View->record
Open
Open
$recordModel = !empty($this->record) ? $this->record->getRecord() : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
- Exclude checks
Call to undeclared method \Users_Detail_View::getViewer
Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Call to undeclared method \Vtiger_Record_Model::getDayStartsPicklistValues
Open
Open
$dayStartPicklistValues = $recordModel->getDayStartsPicklistValues();
- Exclude checks
Reference to undeclared class \Vtiger_Detail_View
Open
Open
return parent::process($request);
- Exclude checks
Avoid excessively long variable names like $dayStartPicklistValues. Keep variable name length under 20. Open
Open
$dayStartPicklistValues = $recordModel->getDayStartsPicklistValues();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Users_Detail_View extends Vtiger_Detail_View
- Exclude checks
The class Users_Detail_View is not named in CamelCase. Open
Open
class Users_Detail_View extends Vtiger_Detail_View
{
/** {@inheritdoc} */
public function isAjaxEnabled($recordModel)
{
- Read upRead up
- Exclude checks
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
Open
$dayStartPicklistValues = $recordModel->getDayStartsPicklistValues();
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function isAjaxEnabled($recordModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
Open
$recordModel = !empty($this->record) ? $this->record->getRecord() : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('DAY_STARTS', \App\Json::encode($dayStartPicklistValues));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(App\Request $request)
- 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
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$recordModel = !empty($this->record) ? $this->record->getRecord() : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $request->getModule());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return parent::process($request);
- Exclude checks
Class name "Users_Detail_View" is not in camel caps format Open
Open
class Users_Detail_View extends Vtiger_Detail_View
- Exclude checks