YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/models/EditView.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

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

        return Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['EDIT_VIEW_HEADER', 'EDIT_VIEW_RECORD_COLLECTOR'], $linkParams);
Severity: Minor
Found in modules/Vtiger/models/EditView.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

Avoid using static access to class 'Vtiger_Loader' in method 'getInstance'.
Open

        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'EditView', $moduleName);
Severity: Minor
Found in modules/Vtiger/models/EditView.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

Avoid using static access to class 'Vtiger_Module_Model' in method 'getInstance'.
Open

        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Vtiger/models/EditView.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

Avoid unused parameters such as '$recordId'.
Open

    public static function getInstance($moduleName, $recordId)
Severity: Minor
Found in modules/Vtiger/models/EditView.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Saw unextractable annotation for comment '* @return <array> - Associate array of Link Type to List of Vtiger_Link_Model instances'</array>
Open

     * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
Severity: Info
Found in modules/Vtiger/models/EditView.php by phan

Saw unextractable annotation for comment '* @param <array> $linkParams'</array>
Open

     * @param <Array> $linkParams
Severity: Info
Found in modules/Vtiger/models/EditView.php by phan

Saw unextractable annotation for comment '* @return <vtiger_detailview_model>'</vtiger_detailview_model>
Open

     * @return <Vtiger_DetailView_Model>
Severity: Info
Found in modules/Vtiger/models/EditView.php by phan

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

class Vtiger_EditView_Model extends \App\Base

The class Vtiger_EditView_Model is not named in CamelCase.
Open

class Vtiger_EditView_Model extends \App\Base
{
    /**
     * Function to get the instance.
     *
Severity: Minor
Found in modules/Vtiger/models/EditView.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

     *

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 <Vtiger_DetailView_Model>

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

    /**

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

     * @param string $recordId   - record id

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

     * @param string $moduleName - module name

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

     * Function to get the instance.

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 $instance->set('module', $moduleModel);

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

    public function getModule()

Line exceeds 120 characters; contains 141 characters
Open

        return Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['EDIT_VIEW_HEADER', 'EDIT_VIEW_RECORD_COLLECTOR'], $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

    public function getEditViewLinks($linkParams)

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

        return Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['EDIT_VIEW_HEADER', 'EDIT_VIEW_RECORD_COLLECTOR'], $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

     * @return Vtiger_Module_Model instance

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

     */

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

     * Function to get the list of listview links for the module.

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

    public static function getInstance($moduleName, $recordId)

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

        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

    {

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

        $instance = new $modelClassName();

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

        return $this->get('module');

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

        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'EditView', $moduleName);

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

     * Function to get the Module Model.

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

     * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances

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

     * @param <Array> $linkParams

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

class Vtiger_EditView_Model extends \App\Base

There are no issues that match your filters.

Category
Status