YetiForceCompany/YetiForceCRM

View on GitHub
modules/HelpDesk/models/Record.php

Summary

Maintainability
A
0 mins
Test Coverage
F
8%

Missing class import via use statement (line '127', column '26').
Open

            $queryGenerator = new App\QueryGenerator($this->getModuleName());
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phpmd

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

Missing class import via use statement (line '111', column '26').
Open

            $queryGenerator = new App\QueryGenerator('OSSTimeControl');
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phpmd

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

Missing class import via use statement (line '21', column '15').
Open

        return (new \App\Db\Query())
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phpmd

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

Missing class import via use statement (line '34', column '17').
Open

        $query = (new \App\Db\Query())->from('vtiger_servicecontracts')
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phpmd

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 '\App\Module' in method 'checkIfHasTimeControl'.
Open

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL') && \App\Module::isModuleActive('OSSTimeControl')) {
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Config' in method 'checkValidateToClose'.
Open

         || \App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED'))
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\RecordStatus' in method 'checkIfRelatedTicketsClosed'.
Open

                \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_OPEN)
Severity: Minor
Found in modules/HelpDesk/models/Record.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 'getHierarchyDetails'.
Open

                $recordModel = Vtiger_Record_Model::getCleanInstance('HelpDesk');
Severity: Minor
Found in modules/HelpDesk/models/Record.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 'saveToDb'.
Open

            \Vtiger_Relation_Model::getInstance(\Vtiger_Module_Model::getInstance($forModule), $this->getModule())
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Config' in method 'checkIfRelatedTicketsClosed'.
Open

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED')) {
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\RecordStatus' in method 'checkIfRelatedTicketsClosed'.
Open

            $statusFieldName = \App\RecordStatus::getFieldName($this->getModuleName());
Severity: Minor
Found in modules/HelpDesk/models/Record.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 'getHierarchyDetails'.
Open

        $moduleModel = \Vtiger_Module_Model::getInstance($this->getModuleName());
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Config' in method 'checkIfHasTimeControl'.
Open

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL') && \App\Module::isModuleActive('OSSTimeControl')) {
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\RecordStatus' in method 'checkIfRelatedTicketsClosed'.
Open

                \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_NO_CONCERN),
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Config' in method 'checkValidateToClose'.
Open

        if ((\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL')
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Language' in method 'checkValidateToClose'.
Open

                    'message' => \App\Language::translate('LBL_ADD_TIME_CONTROL', $this->getModuleName()), ],
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Request' in method 'saveToDb'.
Open

        $forModule = \App\Request::_get('return_module');
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\PrivilegeQuery' in method 'getActiveServiceContracts'.
Open

        \App\PrivilegeQuery::getConditions($query, 'ServiceContracts');
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Language' in method 'checkValidateToClose'.
Open

                    'message' => \App\Language::translate('LBL_CLOSE_RELATED_TICKETS', $this->getModuleName()), ],
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\ModuleHierarchy' in method 'checkIfHasTimeControl'.
Open

            $queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\RecordStatus' in method 'checkValidateToClose'.
Open

          && \in_array($status, \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_CLOSED))) {
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Request' in method 'saveToDb'.
Open

        $forCrmId = \App\Request::_get('return_id');
Severity: Minor
Found in modules/HelpDesk/models/Record.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 '\App\Request' in method 'saveToDb'.
Open

        if (\App\Request::_get('return_action') && $forModule && $forCrmId && 'ServiceContracts' === $forModule) {
Severity: Minor
Found in modules/HelpDesk/models/Record.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

Define a constant instead of duplicating this literal "result" 4 times.
Open

                    'result' => $this->checkIfHasTimeControl(),
Severity: Critical
Found in modules/HelpDesk/models/Record.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

Call to method addNativeCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to method addCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $queryGenerator->addCondition($statusFieldName, array_merge(
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to undeclared method \Vtiger_Module_Model::getHierarchy
Open

        $hierarchy = $moduleModel->getHierarchy($this->getId());
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $queryGenerator = new App\QueryGenerator('OSSTimeControl');
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Reference to instance property permissions from undeclared class \App\QueryGenerator
Open

            $queryGenerator->permissions = false;
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phan

Call to undeclared method \App\Db\Query::select
Open

        return (new \App\Db\Query())
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $queryGenerator = new App\QueryGenerator($this->getModuleName());
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Reference to instance property permissions from undeclared class \App\QueryGenerator
Open

            $queryGenerator->permissions = false;
Severity: Minor
Found in modules/HelpDesk/models/Record.php by phan

Call to method addCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            $queryGenerator->addCondition('parentid', $this->getId(), 'eid');
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            return !$queryGenerator->createQuery()->exists();
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to undeclared method \App\Db\Query::from
Open

        $query = (new \App\Db\Query())->from('vtiger_servicecontracts')
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
Open

            return $queryGenerator->createQuery()->exists();
Severity: Critical
Found in modules/HelpDesk/models/Record.php by phan

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

class HelpDesk_Record_Model extends Vtiger_Record_Model

The class HelpDesk_Record_Model is not named in CamelCase.
Open

class HelpDesk_Record_Model extends Vtiger_Record_Model
{
    /**
     * Function to get Comments List of this Record.
     *
Severity: Minor
Found in modules/HelpDesk/models/Record.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

            ->select(['comments' => 'commentcontent'])

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

    }

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

        $hierarchy = $moduleModel->getHierarchy($this->getId());

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

            $queryGenerator = new App\QueryGenerator('OSSTimeControl');

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

    public function checkIfRelatedTicketsClosed(): bool

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

            ->where(['deleted' => 0, 'contract_status' => 'In Progress', 'sc_related_to' => $this->get('parent_id')])

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

                ->addRelation($forCrmId, $this->getId());

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

    {

Line exceeds 120 characters; contains 141 characters
Open

                $hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';

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

     *

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

                    'message' => \App\Language::translate('LBL_ADD_TIME_CONTROL', $this->getModuleName()), ],

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

     * @return bool

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

    {

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

            $queryGenerator->addCondition($statusFieldName, array_merge(

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

     * @return array

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

     * Function check if record can be closed.

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 $query->all();

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

            ->from('vtiger_modcomments')

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 getActiveServiceContracts()

Line exceeds 120 characters; contains 128 characters
Open

          && \in_array($status, \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_CLOSED))) {

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

            $queryGenerator = new App\QueryGenerator($this->getModuleName());

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

        $moduleModel = \Vtiger_Module_Model::getInstance($this->getModuleName());

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 checkIfHasTimeControl(): bool

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

        return true;

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 bool

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

        parent::saveToDb();

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

        $forModule = \App\Request::_get('return_module');

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

        $forCrmId = \App\Request::_get('return_id');

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

            }

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

                'hasTimeControl' => [

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

            $queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);

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

            return $queryGenerator->createQuery()->exists();

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

            ->innerJoin('vtiger_crmentity', 'vtiger_servicecontracts.servicecontractsid = vtiger_crmentity.crmid')

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

    public function saveToDb()

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

     * Function returns the details of Hierarchy.

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

     * @param string $status

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

                    'result' => $this->checkIfHasTimeControl(),

Line exceeds 120 characters; contains 138 characters
Open

            $queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);

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

            $queryGenerator->permissions = false;

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

            $queryGenerator->addCondition('parentid', $this->getId(), 'eid');

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

                \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_NO_CONCERN),

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

                preg_match('/[.\s]+/', $info[0], $dashes);

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

                $hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';

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

        if (\App\Request::_get('return_action') && $forModule && $forCrmId && 'ServiceContracts' === $forModule) {

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

                $recordModel->setId($id);

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 check if related records are close.

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

        return (new \App\Db\Query())

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

    {

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

     * Get active service contracts.

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

            \Vtiger_Relation_Model::getInstance(\Vtiger_Module_Model::getInstance($forModule), $this->getModule())

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

    /**

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

        $query = (new \App\Db\Query())->from('vtiger_servicecontracts')

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 getHierarchyDetails(): array

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('HelpDesk');

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

            $queryGenerator->permissions = false;

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

          && \in_array($status, \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_CLOSED))) {

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

        return ['hasTimeControl' => ['result' => true], 'relatedTicketsClosed' => ['result' => true]];

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

        foreach ($hierarchy['entries'] as $id => $info) {

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

     * Function to get Comments List of this Record.

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

                preg_match('/<a(.*)>(.*)<\\/a>/i', $info[0], $name);

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

     * @return string

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

                    'message' => \App\Language::translate('LBL_CLOSE_RELATED_TICKETS', $this->getModuleName()), ],

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

    {

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

        \App\PrivilegeQuery::getConditions($query, 'ServiceContracts');

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

            preg_match('/<a href="+/', $info[0], $matches);

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

        if ((\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL')

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 [

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

            ->where(['related_to' => $this->getId()])->column();

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

     * Function check if records has fill time control.

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

                    'result' => $this->checkIfRelatedTicketsClosed(),

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

            ->orderBy(['due_date' => SORT_ASC]);

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

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED')) {

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

        return $hierarchy;

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

         || \App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED'))

Line exceeds 120 characters; contains 144 characters
Open

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL') && \App\Module::isModuleActive('OSSTimeControl')) {

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

                'relatedTicketsClosed' => [

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

    {

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

        if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL') && \App\Module::isModuleActive('OSSTimeControl')) {

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

                ), 'e', false);

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

            $statusFieldName = \App\RecordStatus::getFieldName($this->getModuleName());

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

                \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_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

            ->select(['servicecontractsid', 'subject', 'due_date'])

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

     * Function to save record.

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

     * @return array

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

            if (!empty($matches)) {

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

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

    public function getCommentsList()

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 checkValidateToClose(string $status): array

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 true;

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 !$queryGenerator->createQuery()->exists();

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

class HelpDesk_Record_Model extends Vtiger_Record_Model

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                ), 'e', false);

There are no issues that match your filters.

Category
Status