Missing class import via use statement (line '127', column '26'). Open
$queryGenerator = new App\QueryGenerator($this->getModuleName());
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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())
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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'))
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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())
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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),
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
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()), ],
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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()), ],
- Read upRead up
- Exclude checks
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()]);
- Read upRead up
- Exclude checks
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))) {
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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(),
- Read upRead up
- Exclude checks
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()]);
- Exclude checks
Call to method addCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->addCondition($statusFieldName, array_merge(
- Exclude checks
Call to undeclared method \Vtiger_Module_Model::getHierarchy
Open
$hierarchy = $moduleModel->getHierarchy($this->getId());
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new App\QueryGenerator('OSSTimeControl');
- Exclude checks
Reference to instance property permissions
from undeclared class \App\QueryGenerator
Open
$queryGenerator->permissions = false;
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
return (new \App\Db\Query())
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new App\QueryGenerator($this->getModuleName());
- Exclude checks
Reference to instance property permissions
from undeclared class \App\QueryGenerator
Open
$queryGenerator->permissions = false;
- Exclude checks
Call to method addCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->addCondition('parentid', $this->getId(), 'eid');
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
return !$queryGenerator->createQuery()->exists();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$query = (new \App\Db\Query())->from('vtiger_servicecontracts')
- Exclude checks
Call to method createQuery
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
return $queryGenerator->createQuery()->exists();
- Exclude checks
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
- Exclude checks
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.
*
- Read upRead up
- Exclude checks
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'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$hierarchy = $moduleModel->getHierarchy($this->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new App\QueryGenerator('OSSTimeControl');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkIfRelatedTicketsClosed(): bool
- Exclude checks
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')])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->addRelation($forCrmId, $this->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 141 characters Open
$hierarchy['entries'][$id][0] = ($dashes[0] ?? '') . '<a href=' . $recordModel->getDetailViewUrl() . '>' . $name[2] . '</a>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'message' => \App\Language::translate('LBL_ADD_TIME_CONTROL', $this->getModuleName()), ],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->addCondition($statusFieldName, array_merge(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function check if record can be closed.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $query->all();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_modcomments')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getActiveServiceContracts()
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
&& \in_array($status, \App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_CLOSED))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new App\QueryGenerator($this->getModuleName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = \Vtiger_Module_Model::getInstance($this->getModuleName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkIfHasTimeControl(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::saveToDb();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$forModule = \App\Request::_get('return_module');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$forCrmId = \App\Request::_get('return_id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'hasTimeControl' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $queryGenerator->createQuery()->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->innerJoin('vtiger_crmentity', 'vtiger_servicecontracts.servicecontractsid = vtiger_crmentity.crmid')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function saveToDb()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function returns the details of Hierarchy.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $status
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'result' => $this->checkIfHasTimeControl(),
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
$queryGenerator->addNativeCondition([\App\ModuleHierarchy::getMappingRelatedField($this->getModuleName()) => $this->getId()]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->permissions = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->addCondition('parentid', $this->getId(), 'eid');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_NO_CONCERN),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
preg_match('/[.\s]+/', $info[0], $dashes);
- Exclude checks
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>';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Request::_get('return_action') && $forModule && $forCrmId && 'ServiceContracts' === $forModule) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->setId($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*Function check if related records are close.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get active service contracts.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Vtiger_Relation_Model::getInstance(\Vtiger_Module_Model::getInstance($forModule), $this->getModule())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->from('vtiger_servicecontracts')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getHierarchyDetails(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Vtiger_Record_Model::getCleanInstance('HelpDesk');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->permissions = false;
- Exclude checks
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))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return ['hasTimeControl' => ['result' => true], 'relatedTicketsClosed' => ['result' => true]];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($hierarchy['entries'] as $id => $info) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get Comments List of this Record.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
preg_match('/<a(.*)>(.*)<\\/a>/i', $info[0], $name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'message' => \App\Language::translate('LBL_CLOSE_RELATED_TICKETS', $this->getModuleName()), ],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\PrivilegeQuery::getConditions($query, 'ServiceContracts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
preg_match('/<a href="+/', $info[0], $matches);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ((\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['related_to' => $this->getId()])->column();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function check if records has fill time control.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'result' => $this->checkIfRelatedTicketsClosed(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->orderBy(['due_date' => SORT_ASC]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $hierarchy;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
|| \App\Config::module($this->getModuleName(), 'CHECK_IF_RELATED_TICKETS_ARE_CLOSED'))
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
if (\App\Config::module($this->getModuleName(), 'CHECK_IF_RECORDS_HAS_TIME_CONTROL') && \App\Module::isModuleActive('OSSTimeControl')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedTicketsClosed' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
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')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
), 'e', false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$statusFieldName = \App\RecordStatus::getFieldName($this->getModuleName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\RecordStatus::getStates($this->getModuleName(), \App\RecordStatus::RECORD_STATE_OPEN)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->select(['servicecontractsid', 'subject', 'due_date'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to save record.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($matches)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCommentsList()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkValidateToClose(string $status): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return !$queryGenerator->createQuery()->exists();
- Exclude checks
Class name "HelpDesk_Record_Model" is not in camel caps format Open
class HelpDesk_Record_Model extends Vtiger_Record_Model
- Exclude checks
Multi-line function call not indented correctly; expected 12 spaces but found 16 Open
), 'e', false);
- Exclude checks