Function operationsAfterPicklistDelete
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function operationsAfterPicklistRename
has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method operationsAfterPicklistRename
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
Method operationsAfterPicklistDelete
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
The class Settings_Picklist_PickListHandler_Handler has an overall complexity of 66 which is very high. The configured complexity threshold is 50. Open
class Settings_Picklist_PickListHandler_Handler
{
/**
* PicklistAfterRename handler function.
*
- Exclude checks
File PickListHandler.php
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Settings_Picklist_PickListHandler_Handler
{
/**
The method operationsAfterPicklistRename() has an NPath complexity of 17496. The configured NPath complexity threshold is 200. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method operationsAfterPicklistRename() has 154 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
- Exclude checks
The method operationsAfterPicklistDelete() has an NPath complexity of 4608. The configured NPath complexity threshold is 200. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method operationsAfterPicklistDelete() has 130 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
- Exclude checks
The method operationsAfterPicklistRename() has a Cyclomatic Complexity of 30. The configured cyclomatic complexity threshold is 10. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method operationsAfterPicklistDelete() has a Cyclomatic Complexity of 31. The configured cyclomatic complexity threshold is 10. Open
public function operationsAfterPicklistDelete($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$valueToDelete = $entityData['valuetodelete'];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Refactor this function to reduce its Cognitive Complexity from 106 to the 15 allowed. Open
public function operationsAfterPicklistDelete($entityData)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 73 to the 15 allowed. Open
public function operationsAfterPicklistRename($entityData)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
This function "operationsAfterPicklistRename" has 153 lines, which is greater than the 150 lines authorized. Split it into smaller functions. Open
public function operationsAfterPicklistRename($entityData)
- Read upRead up
- Exclude checks
A function that grows too large tends to aggregate too many responsibilities.
Such functions inevitably become harder to understand and therefore harder to maintain.
Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.
Those smaller functions will not only be easier to understand, but also probably easier to test.
Missing class import via use statement (line '337', column '22'). Open
$dataReader = (new App\Db\Query())->select(['id'])
- 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 '216', column '23'). Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- 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 '118', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])
- 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 '198', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['id', 'value'])->from('u_#__cv_condition')
- 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 '251', column '23'). Open
$dataReader = (new \App\Db\Query())->select(['task', 'workflow_id', 'task_id'])->from('com_vtiger_workflowtasks')->where(['like', 'task', $value])
- 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 '40', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
- 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 '85', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- 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 '69', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['id', 'value'])
- 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\Json' in method 'operationsAfterPicklistRename'. Open
$updatedTask = \App\Json::encode($fieldMapping);
- 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\Json' in method 'operationsAfterPicklistDelete'. Open
$fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
- 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
The method operationsAfterPicklistDelete uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ('VTCreateEventTask' == $className) {
if ('activitystatus' == $pickListFieldName) {
$pickListFieldName = 'status';
} elseif ('activitytype' == $pickListFieldName) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class 'App\Purifier' in method 'operationsAfterPicklistRename'. Open
$condition = App\Purifier::decodeHtml($row['test']);
- 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 'updateUserData'. Open
$record = Vtiger_Record_Model::getInstanceById($userId, 'Users');
- 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
The method operationsAfterPicklistRename uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if ('VTCreateEventTask' == $className) {
if ('activitystatus' == $pickListFieldName) {
$pickListFieldName = 'status';
} elseif ('activitytype' == $pickListFieldName) {
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'operationsAfterPicklistRename'. Open
$fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
- 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\Json' in method 'operationsAfterPicklistDelete'. Open
$updatedTask = \App\Json::encode($fieldMapping);
- 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
The method updateUserData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$defaultFieldName = 'defaulteventstatus';
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'operationsAfterPicklistRename'. Open
$condtion = \App\Json::encode($decodedArrayConditions);
- 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\Json' in method 'operationsAfterPicklistDelete'. Open
$decodedArrayConditions = \App\Json::decode($condition);
- 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\Purifier' in method 'operationsAfterPicklistDelete'. Open
$condition = App\Purifier::decodeHtml($row['test']);
- 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 'operationsAfterPicklistRename'. Open
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
- 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\Json' in method 'operationsAfterPicklistRename'. Open
$conditions = \App\Json::decode($row['conditions']);
- 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\Json' in method 'operationsAfterPicklistRename'. Open
$conditions = \App\Json::encode($conditions);
- 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\Json' in method 'operationsAfterPicklistDelete'. Open
$condtion = \App\Json::encode($decodedArrayConditions);
- 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\Json' in method 'operationsAfterPicklistRename'. Open
$decodedArrayConditions = \App\Json::decode($condition);
- 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 "u_#__cv_condition" 4 times. Open
->from('u_#__cv_condition')
- 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.
Define a constant instead of duplicating this literal "activitytype" 5 times. Open
} elseif ('activitytype' == $pickListFieldName) {
- 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.
Define a constant instead of duplicating this literal "com_vtiger_workflows" 4 times. Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- 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.
Define a constant instead of duplicating this literal "status" 4 times. Open
$pickListFieldName = 'status';
- 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.
Define a constant instead of duplicating this literal "conditions" 4 times. Open
->where(['tabid' => $tabId])->andWhere(['and', ['like', 'conditions', $pickListFieldName], ['like', 'conditions', $oldValue]])
- 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.
Define a constant instead of duplicating this literal "workflow_id" 16 times. Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- 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.
Define a constant instead of duplicating this literal "fieldname" 7 times. Open
$pickListFieldName = $entityData['fieldname'];
- 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.
Define a constant instead of duplicating this literal "module_name" 4 times. Open
->where(['field_name' => $pickListFieldName, 'module_name' => $moduleName])
- 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.
Define a constant instead of duplicating this literal "task_id" 10 times. Open
$dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])
- 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.
Define a constant instead of duplicating this literal "activitystatus" 6 times. Open
if ('activitystatus' == $pickListFieldName) {
- 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.
Define a constant instead of duplicating this literal "com_vtiger_workflowtasks" 6 times. Open
->from('com_vtiger_workflowtasks')
- 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.
Define a constant instead of duplicating this literal "value" 16 times. Open
$values = explode('##', $data['value']);
- 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 undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['task', 'workflow_id', 'task_id'])->from('com_vtiger_workflowtasks')->where(['like', 'task', $value])
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['id', 'value'])
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = App\Db::getInstance()->createCommand();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = App\Db::getInstance()->createCommand();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new App\Db\Query())->select(['id'])
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['id', 'value'])->from('u_#__cv_condition')
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($decodedArrayConditions as $key => $condition) {
if ($condition['fieldname'] == $pickListFieldName) {
$value = $condition['value'];
$explodedValueArray = explode(',', $value);
foreach ($valueToDelete as $value) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 134.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($fieldMapping as $key => $condition) {
if ($condition['fieldname'] == $pickListFieldName) {
$value = $condition['value'];
$explodedValueArray = explode(',', $value);
foreach ($valueToDelete as $value) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 134.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($decodedArrayConditions as $key => $condition) {
if ($condition['fieldname'] == $pickListFieldName) {
$value = $condition['value'];
$explodedValueArray = explode(',', $value);
$arrayKey = array_search($oldValue, $explodedValueArray);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
foreach ($fieldMapping as $key => $condition) {
if ($condition['fieldname'] == $pickListFieldName) {
$value = $condition['value'];
$explodedValueArray = explode(',', $value);
$arrayKey = array_search($oldValue, $explodedValueArray);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
'and',
['module_name' => $moduleName],
['<>', 'test', ''],
['not', ['test' => null]],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
'and',
['module_name' => $moduleName],
['<>', 'test', ''],
['not', ['test' => null]],
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 113.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Avoid excessively long class names like Settings_Picklist_PickListHandler_Handler. Keep class name length under 40. Open
class Settings_Picklist_PickListHandler_Handler
{
/**
* PicklistAfterRename handler function.
*
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Avoid excessively long variable names like $classNameWithDoubleQuotes. Keep variable name length under 20. Open
$classNameWithDoubleQuotes = $taskComponents[2];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $decodedArrayConditions. Keep variable name length under 20. Open
$decodedArrayConditions = \App\Json::decode($condition);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $decodedArrayConditions. Keep variable name length under 20. Open
$decodedArrayConditions = \App\Json::decode($condition);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $classNameWithDoubleQuotes. Keep variable name length under 20. Open
$classNameWithDoubleQuotes = $taskComponents[2];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Picklist_PickListHandler_Handler
- Exclude checks
The class Settings_Picklist_PickListHandler_Handler is not named in CamelCase. Open
class Settings_Picklist_PickListHandler_Handler
{
/**
* PicklistAfterRename handler function.
*
- 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
$key = array_search($oldValue, $values);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['tabid' => $tabId])->andWhere(['and', ['like', 'conditions', $pickListFieldName], ['like', 'conditions', $oldValue]])
- 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 operationsAfterPicklistRename($entityData)
- Exclude checks
Line exceeds 120 characters; contains 232 characters Open
$dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
->where(['tabid' => $tabId])->andWhere(['and', ['like', 'conditions', $pickListFieldName], ['like', 'conditions', $oldValue]])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('s_#__picklist_dependency_data', ['conditions' => $conditions], [
- 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
* @param App\EventHandler $eventHandler
- 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
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$values[$key] = $newValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($change) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$conditions['rules'] = $rules;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* PicklistAfterDelete handler function.
- 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
$this->operationsAfterPicklistRename($eventHandler->getParams());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->operationsAfterPicklistDelete($eventHandler->getParams());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$values = explode('##', $data['value']);
- 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
* @param App\EventHandler $eventHandler
- 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
$tabId = $moduleModel->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rules = $conditions['rules'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function picklistAfterRename(App\EventHandler $eventHandler)
- 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
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$conditions = \App\Json::decode($row['conditions']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$conditions = \App\Json::encode($conditions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = $entityData['fieldname'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $entityData['module'];
- 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
$change = 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
$data['value'] = implode('##', $values);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* PicklistAfterRename handler function.
- 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
$change = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($rules as &$data) {
- 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
* Function to perform operation after picklist rename.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$oldValue = $entityData['oldvalue'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newValue = $entityData['newvalue'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($condition['fieldname'] == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condtion = \App\Json::encode($decodedArrayConditions);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->updateUserData($pickListFieldName, $oldValue, $newValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//update advancefilter values
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($decodedArrayConditions as $key => $condition) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require_once 'modules/com_vtiger_workflow/tasks/' . $className . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('VTCreateTodoTask' == $className) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $newValue;
- 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
$unserializeTask->{$pickListFieldName} = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['field_name' => $pickListFieldName, 'module_name' => $moduleName])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $newValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//update Workflows values
- 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
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('com_vtiger_workflowtasks')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($oldValue, $explodedValueArray);
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('activitystatus' == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['field_name' => $pickListFieldName, 'module_name' => $moduleName])
- 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
require_once 'modules/com_vtiger_workflow/VTTaskManager.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unserializeTask->field_value_mapping = $updatedTask;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_id' => $row['source_id']
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$serializeTask = serialize($unserializeTask);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('VTCreateEventTask' == $className) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['<>', 'test', ''],
- 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
$explodedValueArray = explode(',', $value);
- 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
$replaceValue = $entityData['replacevalue'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $entityData['module'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['id', 'value'])->from('u_#__cv_condition')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condition['value'] = $value;
- 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
$explodedValueArray = explode(',', $value);
- 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
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//update workflow task
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskComponents = explode(':', $task);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($unserializeTask->field_value_mapping)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('taskpriority' == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- 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
$condition = App\Purifier::decodeHtml($row['test']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decodedArrayConditions = \App\Json::decode($condition);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $condition['value'];
- 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
$pickListFieldName = 'eventType';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['<>', 'test', 'null'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unserializeTask = unserialize($task);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = 'status';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('activitystatus' == $pickListFieldName) {
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- 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
$dbCommand = App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['not', ['test' => null]],
- 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
$task = $row['task'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($condition['fieldname'] == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('activitytype' == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $row['value'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('u_#__cv_condition', ['value' => $value], ['id' => $row['id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$className = str_replace('"', '', $classNameWithDoubleQuotes);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($fieldMapping)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $condition['value'];
- 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
$pickListFieldName = 'priority';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $unserializeTask->{$pickListFieldName};
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$serializeTask = serialize($unserializeTask);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $entityData
- 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
$pickListFieldName = $entityData['fieldname'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($value, $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $replaceValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $newValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- 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
$dataReader = (new \App\Db\Query())->select(['id', 'value'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $row['value'];
- 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
['like', 'test', $oldValue],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $newValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- 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 to perform operation after picklist delete.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//update advancefilter values
- 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
'id' => $row['id'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($decodedArrayConditions)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($oldValue, $explodedValueArray);
- Exclude checks
Line exceeds 120 characters; contains 121 characters Open
$dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['like', 'task', $oldValue])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($oldValue, $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'and',
- 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
$decodedArrayConditions[$key] = $condition;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldMapping as $key => $condition) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- 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
Line exceeds 120 characters; contains 127 characters Open
if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$valueToDelete = $entityData['valuetodelete'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function picklistAfterDelete(App\EventHandler $eventHandler)
- 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
* @param array $entityData
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($data['fieldname'] === "{$pickListFieldName}:{$moduleName}" && \in_array($oldValue, $values)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$updatedTask = \App\Json::encode($fieldMapping);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($unserializeTask->{$pickListFieldName})) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('u_#__cv_condition')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($oldValue, $explodedValueArray);
- 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
['module_name' => $moduleName],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condition['value'] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$classNameWithDoubleQuotes = $taskComponents[2];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldMapping[$key] = $condition;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = 'status';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function operationsAfterPicklistDelete($entityData)
- 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
$dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'and',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condition = App\Purifier::decodeHtml($row['test']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$className = str_replace('"', '', $classNameWithDoubleQuotes);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($value, $explodedValueArray);
- 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
* @param string $pickListFieldName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('u_#__cv_condition', ['value' => $value], ['id' => $row['id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['not', ['test' => null]],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- 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
require_once 'modules/com_vtiger_workflow/VTTaskManager.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('VTCreateEventTask' == $className) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = 'priority';
- 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
$unserializeTask->{$pickListFieldName} = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultFieldName = 'defaultactivitytype';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decodedArrayConditions = \App\Json::decode($condition);
- 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
$dataReader = (new \App\Db\Query())->select(['task', 'workflow_id', 'task_id'])->from('com_vtiger_workflowtasks')->where(['like', 'task', $value])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($unserializeTask->field_value_mapping)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = 'status';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->updateUserData($pickListFieldName, $valueToDelete, $replaceValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|string[] $oldValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_users')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where([$defaultFieldName => $oldValue])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['like', 'test', $value],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $replaceValue;
- 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
$fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- 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
$serializeTask = serialize($unserializeTask);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('activitystatus' == $pickListFieldName) {
- 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
public function updateUserData($pickListFieldName, $oldValue, $newValue)
- 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
$record = Vtiger_Record_Model::getInstanceById($userId, 'Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($condition['fieldname'] == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condition['value'] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$task = $row['task'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['module_name' => $moduleName],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$updatedTask = \App\Json::encode($fieldMapping);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($value, $explodedValueArray);
- 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
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condtion = \App\Json::encode($decodedArrayConditions);
- 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
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require_once 'modules/com_vtiger_workflow/tasks/' . $className . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($fieldMapping)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($condition['fieldname'] == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('taskpriority' == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($unserializeTask->{$pickListFieldName})) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('activitytype' === $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($userId = $dataReader->readColumn(0)) {
- 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
$dataReader->close();
- 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
//update Workflows values
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decodedArrayConditions[$key] = $condition;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$classNameWithDoubleQuotes = $taskComponents[2];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($decodedArrayConditions)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$condition['value'] = $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldMapping[$key] = $condition;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $unserializeTask->{$pickListFieldName};
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- 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 ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {
- 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
$dataReader = (new App\Db\Query())->select(['id'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$record->set($defaultFieldName, $newValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$arrayKey = array_search($value, $explodedValueArray);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldMapping as $key => $condition) {
- 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
$pickListFieldName = 'eventType';
- 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
['<>', 'test', ''],
- 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
$dataReader->close();
- Exclude checks
Line exceeds 120 characters; contains 180 characters Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListFieldName = 'status';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = implode(',', $explodedValueArray);
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['<>', 'test', 'null'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unserializeTask = unserialize($task);
- 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
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('activitytype' == $pickListFieldName) {
- 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
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- 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 void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultFieldName = 'defaulteventstatus';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = $condition['value'];
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$taskComponents = explode(':', $task);
- 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
* Update users data.
- 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
$value = $condition['value'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray = explode(',', $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$serializeTask = serialize($unserializeTask);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//update workflow task
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($valueToDelete as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $replaceValue;
- 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
} elseif ('VTCreateTodoTask' == $className) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$explodedValueArray[$arrayKey] = $replaceValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $newValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($decodedArrayConditions as $key => $condition) {
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
$dataReader = (new \App\Db\Query())->select(['task', 'workflow_id', 'task_id'])->from('com_vtiger_workflowtasks')->where(['like', 'task', $value])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$unserializeTask->field_value_mapping = $updatedTask;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('activitystatus' == $pickListFieldName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== $arrayKey) {
- Exclude checks
Line exceeds 120 characters; contains 180 characters Open
$dbCommand->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Class name "Settings_Picklist_PickListHandler_Handler" is not in camel caps format Open
class Settings_Picklist_PickListHandler_Handler
- Exclude checks