modules/Project/models/ListView.php
Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewLinks'. Open
Open
$links['LISTVIEWQUICK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
- 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
Saw unextractable annotation for comment '* @param <array> $linkParams Parameters to be replaced in the link template'</array>
Open
Open
* @param <Array> $linkParams Parameters to be replaced in the link template
- Exclude checks
Saw unextractable annotation for comment '* @return <array> - an array of Vtiger_Link_Model instances'</array>
Open
Open
* @return <Array> - an array of Vtiger_Link_Model instances
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Project_ListView_Model extends Vtiger_ListView_Model
- Exclude checks
The class Project_ListView_Model is not named in CamelCase. Open
Open
class Project_ListView_Model extends Vtiger_ListView_Model
{
/**
* Function to get the list of listview links.
*
- 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
$links = parent::getListViewLinks($linkParams);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$quickLinks = [
- 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 getListViewLinks($linkParams)
- 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
'linklabel' => 'Tasks List',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Function to get the list of listview links.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linkicon' => '',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param <Array> $linkParams Parameters to be replaced in the link template
- 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
'linkurl' => $this->getModule()->getDefaultUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
foreach ($quickLinks as $quickLink) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'linktype' => 'LISTVIEWQUICK',
- 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 <Array> - an array of Vtiger_Link_Model instances
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $links;
- 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
$links['LISTVIEWQUICK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
- Exclude checks
Class name "Project_ListView_Model" is not in camel caps format Open
Open
class Project_ListView_Model extends Vtiger_ListView_Model
- Exclude checks