YetiForceCompany/YetiForceCRM

View on GitHub
modules/com_vtiger_workflow/tasks/VTEntityMethodTask.php

Summary

Maintainability
A
0 mins
Test Coverage
F
12%

Missing class import via use statement (line '36', column '8').
Open

        (new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class 'Vtiger_Record_Model' in method 'doTask'.
Open

            $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);

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

Reference to undeclared property \VTEntityMethodTask->methodName
Open

        (new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);

Reference to undeclared property \VTEntityMethodTask->workflowId
Open

            $moduleName = Settings_Workflows_Record_Model::getInstance($this->workflowId)->get('module_name');

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

class VTEntityMethodTask extends VTTask

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 13 and the first side effect is on line 11.
Open

<?php

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

     * Execute task.

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

    public function doTask($recordModel = null)

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 Vtiger_Record_Model $recordModel

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

     */

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

            $recordModel = Vtiger_Record_Model::getCleanInstance($moduleName);

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

        (new VTEntityMethodManager())->executeMethod($recordModel, $this->methodName);

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 $executeImmediately = true;

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

    public function getFieldNames()

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

        if (!$recordModel) {

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

            $moduleName = Settings_Workflows_Record_Model::getInstance($this->workflowId)->get('module_name');

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

    /** {@inheritdoc} */

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

        return ['methodName'];

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 $recordEventState = self::RECORD_EVENT_DOUBLE_MODE;

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

    {

There are no issues that match your filters.

Category
Status