YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/MergeRecord.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using undefined variables such as '$recordModels' which will lead to PHP notices.
Open

        $viewer->assign('RECORDMODELS', $recordModels);
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using undefined variables such as '$recordModels' which will lead to PHP notices.
Open

                $recordModels[] = Vtiger_Record_Model::getInstanceById($recordId);
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

Source https://phpmd.org/rules/cleancode.html#undefinedvariable

Avoid using static access to class '\App\Privilege' in method 'process'.
Open

            if (\App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)) {
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.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 'process'.
Open

        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.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_Record_Model' in method 'process'.
Open

                $recordModels[] = Vtiger_Record_Model::getInstanceById($recordId);
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.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 '$request'.
Open

    public function checkPermission(App\Request $request)
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.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

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('FIELDS', $fieldModels);
Severity: Critical
Found in modules/Vtiger/views/MergeRecord.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RECORDS', $records);
Severity: Critical
Found in modules/Vtiger/views/MergeRecord.php by phan

Variable $recordModels was undeclared, but array fields are being added to it.
Open

                $recordModels[] = Vtiger_Record_Model::getInstanceById($recordId);
Severity: Info
Found in modules/Vtiger/views/MergeRecord.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('RECORDMODELS', $recordModels);
Severity: Critical
Found in modules/Vtiger/views/MergeRecord.php by phan

Call to undeclared method \Vtiger_Viewer::assign
Open

        $viewer->assign('MODULE', $moduleName);
Severity: Critical
Found in modules/Vtiger/views/MergeRecord.php by phan

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

class Vtiger_MergeRecord_View extends \App\Controller\View\Page

The class Vtiger_MergeRecord_View is not named in CamelCase.
Open

class Vtiger_MergeRecord_View extends \App\Controller\View\Page
{
    public function checkPermission(App\Request $request)
    {
    }
Severity: Minor
Found in modules/Vtiger/views/MergeRecord.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

     * Process.

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

        foreach ($records as $recordId) {

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 process(App\Request $request)

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

        $moduleName = $request->getModule();

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

        $fieldModels = $moduleModel->getFields();

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

     */

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

    public function checkPermission(App\Request $request)

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

            if (\App\Privilege::isPermitted($moduleName, 'DetailView', $recordId)) {

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

        $viewer->assign('MODULE', $moduleName);

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

        $viewer = $this->getViewer($request);

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

            }

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

        $viewer->assign('FIELDS', $fieldModels);

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

        $viewer->view('MergeRecords.tpl', $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

     * @param \App\Request $request

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

    /**

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

                $recordModels[] = Vtiger_Record_Model::getInstanceById($recordId);

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

        $records = $request->getExploded('records');

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

        $viewer->assign('RECORDS', $records);

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

        $viewer->assign('RECORDMODELS', $recordModels);

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

class Vtiger_MergeRecord_View extends \App\Controller\View\Page

There are no issues that match your filters.

Category
Status