modules/Project/models/RelationListView.php
The method getCreateViewUrl has a boolean flag argument $fullView, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function getCreateViewUrl(bool $fullView = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Project_RelationListView_Model extends Vtiger_RelationListView_Model
- Exclude checks
The class Project_RelationListView_Model is not named in CamelCase. Open
Open
class Project_RelationListView_Model extends Vtiger_RelationListView_Model
{
/** {@inheritdoc} */
public function getCreateViewUrl(bool $fullView = false)
{
- 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
}
- 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
$relationModuleModel = $this->getRelationModel()->getRelationModuleModel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$createViewUrl .= '&parent_id=' . $this->getParentRecordModel()->get('linktoaccountscontacts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ('HelpDesk' == $relationModuleModel->getName() && $relationModuleModel->getFieldByName('parent_id')->isViewable()) {
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
Open
if ('HelpDesk' == $relationModuleModel->getName() && $relationModuleModel->getFieldByName('parent_id')->isViewable()) {
- 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 $createViewUrl;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$createViewUrl = parent::getCreateViewUrl($fullView);
- 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 getCreateViewUrl(bool $fullView = false)
- Exclude checks
Class name "Project_RelationListView_Model" is not in camel caps format Open
Open
class Project_RelationListView_Model extends Vtiger_RelationListView_Model
- Exclude checks