YetiForceCompany/YetiForceCRM

View on GitHub
modules/Project/models/ListView.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewLinks'.
Open

            $links['LISTVIEWQUICK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);
Severity: Minor
Found in modules/Project/models/ListView.php by phpmd

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

     * @param <Array> $linkParams Parameters to be replaced in the link template
Severity: Info
Found in modules/Project/models/ListView.php by phan

Saw unextractable annotation for comment '* @return <array> - an array of Vtiger_Link_Model instances'</array>
Open

     * @return <Array> - an array of Vtiger_Link_Model instances
Severity: Info
Found in modules/Project/models/ListView.php by phan

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

class Project_ListView_Model extends Vtiger_ListView_Model

The class Project_ListView_Model is not named in CamelCase.
Open

class Project_ListView_Model extends Vtiger_ListView_Model
{
    /**
     * Function to get the list of listview links.
     *
Severity: Minor
Found in modules/Project/models/ListView.php by phpmd

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

        $links = parent::getListViewLinks($linkParams);

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

        $quickLinks = [

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

    /**

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

    public function getListViewLinks($linkParams)

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

     */

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

                'linklabel' => 'Tasks List',

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

     * Function to get the list of listview links.

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

                'linkicon' => '',

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

     * @param <Array> $linkParams Parameters to be replaced in the link template

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

     *

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

                'linkurl' => $this->getModule()->getDefaultUrl(),

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

        foreach ($quickLinks as $quickLink) {

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

                'linktype' => 'LISTVIEWQUICK',

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

     *

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

     * @return <Array> - an array of Vtiger_Link_Model instances

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

        return $links;

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

            $links['LISTVIEWQUICK'][] = Vtiger_Link_Model::getInstanceFromValues($quickLink);

Class name "Project_ListView_Model" is not in camel caps format
Open

class Project_ListView_Model extends Vtiger_ListView_Model

There are no issues that match your filters.

Category
Status