YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/Picklist/handlers/PickListHandler.php

Summary

Maintainability
F
6 days
Test Coverage
F
0%

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'];
Severity: Minor
Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 2 days to fix

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'];
Severity: Minor
Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 1 day to fix

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'];
Severity: Major
Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 5 hrs to fix

    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'];
    Severity: Major
    Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 4 hrs to fix

      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.
           *

      File PickListHandler.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      class Settings_Picklist_PickListHandler_Handler
      {
          /**
      Severity: Minor
      Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 3 hrs to fix

        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'];

        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'];

        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'];

        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'];

        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'];

        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'];

        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)

        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)

        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)

        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'])

        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([

        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'])

        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')

        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])

        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')

        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([

        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'])

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

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

        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) {

        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']);

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

        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) {

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

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

        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';
                }

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

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

        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']);

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

        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']);

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

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

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

        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')

        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) {

        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([

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

        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]])

        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([

        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'];

        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])

        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'])

        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) {

        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')

        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']);

        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])

        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')

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

                $dataReader = (new \App\Db\Query())->select(['id', 'value'])

        Call to undeclared method \App\Db::createCommand
        Open

                $dbCommand = App\Db::getInstance()->createCommand();

        Call to undeclared method \App\Db::createCommand
        Open

                $dbCommand = App\Db::getInstance()->createCommand();

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

                $dataReader = (new App\Db\Query())->select(['id'])

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

                $dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([

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

                $dataReader = (new \App\Db\Query())->select(['id', 'value'])->from('u_#__cv_condition')

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

                    $dataReader = (new \App\Db\Query())->select(['workflow_id', 'test'])->from('com_vtiger_workflows')->where([

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

                $dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])

        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) {
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 2 hrs to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 264..278

        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

        Further Reading

        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) {
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 2 hrs to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 228..242

        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

        Further Reading

        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);
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 2 hrs to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 133..145

        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

        Further Reading

        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);
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 2 hrs to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 98..110

        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

        Further Reading

        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]],
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 1 hr to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 216..223

        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

        Further Reading

        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]],
        Severity: Major
        Found in modules/Settings/Picklist/handlers/PickListHandler.php and 1 other location - About 1 hr to fix
        modules/Settings/Picklist/handlers/PickListHandler.php on lines 85..92

        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

        Further Reading

        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.
             *

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

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

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

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

        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

        The class Settings_Picklist_PickListHandler_Handler is not named in CamelCase.
        Open

        class Settings_Picklist_PickListHandler_Handler
        {
            /**
             * PicklistAfterRename handler function.
             *

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

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

                    ->where(['tabid' => $tabId])->andWhere(['and', ['like', 'conditions', $pickListFieldName], ['like', 'conditions', $oldValue]])

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

             *

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

            public function operationsAfterPicklistRename($entityData)

        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')

        Line exceeds 120 characters; contains 138 characters
        Open

                    ->where(['tabid' => $tabId])->andWhere(['and', ['like', 'conditions', $pickListFieldName], ['like', 'conditions', $oldValue]])

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

                        $dbCommand->update('s_#__picklist_dependency_data', ['conditions' => $conditions], [

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

             */

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

             * @param App\EventHandler $eventHandler

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

             */

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

                while ($row = $dataReader->read()) {

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

                            $values[$key] = $newValue;

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

                    if ($change) {

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

                        $conditions['rules'] = $rules;

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

             * PicklistAfterDelete handler function.

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

                        }

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

            /**

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

                $this->operationsAfterPicklistRename($eventHandler->getParams());

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

                $this->operationsAfterPicklistDelete($eventHandler->getParams());

        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')

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

                    ->createCommand()->query();

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

                        $values = explode('##', $data['value']);

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

            {

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

                    }

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

             * @param App\EventHandler $eventHandler

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

            /**

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

             *

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

                $tabId = $moduleModel->getId();

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

                    $rules = $conditions['rules'];

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

            public function picklistAfterRename(App\EventHandler $eventHandler)

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

            {

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

                $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

                    $conditions = \App\Json::decode($row['conditions']);

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

                        $conditions = \App\Json::encode($conditions);

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

                $pickListFieldName = $entityData['fieldname'];

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

                $moduleName = $entityData['module'];

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

            }

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

                            $change = true;

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

             */

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

                            $data['value'] = implode('##', $values);

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

             * PicklistAfterRename handler function.

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

            {

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

                    $change = false;

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

                    foreach ($rules as &$data) {

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

             *

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

            /**

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

             * Function to perform operation after picklist rename.

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

                $dbCommand = App\Db::getInstance()->createCommand();

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

                $oldValue = $entityData['oldvalue'];

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

                $newValue = $entityData['newvalue'];

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

                            if ($condition['fieldname'] == $pickListFieldName) {

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

                        $condtion = \App\Json::encode($decodedArrayConditions);

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

                            ->execute();

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

                    $this->updateUserData($pickListFieldName, $oldValue, $newValue);

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

                //update advancefilter values

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

                        foreach ($decodedArrayConditions as $key => $condition) {

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

                $dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])

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

                    require_once 'modules/com_vtiger_workflow/tasks/' . $className . '.php';

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

                        } elseif ('VTCreateTodoTask' == $className) {

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

                                $explodedValueArray[$arrayKey] = $newValue;

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

                            }

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

                            $unserializeTask->{$pickListFieldName} = $value;

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

                    ->createCommand()->query();

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

                while ($row = $dataReader->read()) {

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

                        ])->execute();

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

                    ->where(['field_name' => $pickListFieldName, 'module_name' => $moduleName])

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

                        $explodedValueArray[$arrayKey] = $newValue;

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

                //update Workflows values

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

                    }

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

                $dataReader->close();

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

                    ->from('com_vtiger_workflowtasks')

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

                                    $arrayKey = array_search($oldValue, $explodedValueArray);

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

                                }

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

                    } else {

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

                            if ('activitystatus' == $pickListFieldName) {

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

                    ->where(['field_name' => $pickListFieldName, 'module_name' => $moduleName])

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

                }

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

                    require_once 'modules/com_vtiger_workflow/VTTaskManager.php';

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

                            $unserializeTask->field_value_mapping = $updatedTask;

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

                            'source_id' => $row['source_id']

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

                            $serializeTask = serialize($unserializeTask);

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

                    ->createCommand()->query();

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

                        if ('VTCreateEventTask' == $className) {

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

                    ['<>', 'test', ''],

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

                        }

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

                                $explodedValueArray = explode(',', $value);

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

                        }

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

                    }

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

                        }

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

                $replaceValue = $entityData['replacevalue'];

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

                $moduleName = $entityData['module'];

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

                        $dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])

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

                $dataReader = (new \App\Db\Query())->select(['id', 'value'])->from('u_#__cv_condition')

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

                                    $condition['value'] = $value;

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

            /**

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

                    $explodedValueArray = explode(',', $value);

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

                        }

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

                $dataReader->close();

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

                //update workflow task

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

                while ($row = $dataReader->read()) {

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

                    $taskComponents = explode(':', $task);

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

                    if (isset($unserializeTask->field_value_mapping)) {

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

                            } elseif ('taskpriority' == $pickListFieldName) {

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

                            if (false !== $arrayKey) {

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

            }

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

                    $condition = App\Purifier::decodeHtml($row['test']);

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

                    $decodedArrayConditions = \App\Json::decode($condition);

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

                                $value = $condition['value'];

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

                            }

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

                                    }

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

                                $pickListFieldName = 'eventType';

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

                            $explodedValueArray = explode(',', $value);

        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([

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

                    ['<>', 'test', 'null'],

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

                    $unserializeTask = unserialize($task);

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

                                    if (false !== $arrayKey) {

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

                            }

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

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

                                $pickListFieldName = 'status';

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

                            if ('activitystatus' == $pickListFieldName) {

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

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

                }

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

             *

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

                $dbCommand = App\Db::getInstance()->createCommand();

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

                    ['not', ['test' => null]],

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

                }

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

                    $task = $row['task'];

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

                                if ($condition['fieldname'] == $pickListFieldName) {

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

                            } elseif ('activitytype' == $pickListFieldName) {

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

                    $value = $row['value'];

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

                    $dbCommand->update('u_#__cv_condition', ['value' => $value], ['id' => $row['id']])->execute();

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

                ])->createCommand()->query();

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

                                $value = implode(',', $explodedValueArray);

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

                    $className = str_replace('"', '', $classNameWithDoubleQuotes);

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

                        if (!empty($fieldMapping)) {

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

                                    $value = $condition['value'];

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

                            }

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

                                $pickListFieldName = 'priority';

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

                            $value = $unserializeTask->{$pickListFieldName};

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

                            $value = implode(',', $explodedValueArray);

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

                            $serializeTask = serialize($unserializeTask);

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

             * @param array $entityData

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

             */

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

                $pickListFieldName = $entityData['fieldname'];

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

                        $arrayKey = array_search($value, $explodedValueArray);

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

                            $explodedValueArray[$arrayKey] = $replaceValue;

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

                $dataReader->close();

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

                                if (false !== $arrayKey) {

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

                                    $explodedValueArray[$arrayKey] = $newValue;

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

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

                    }

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

                $dataReader = (new \App\Db\Query())->select(['id', 'value'])

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

                while ($row = $dataReader->read()) {

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

                    $value = $row['value'];

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

                    }

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

                    ['like', 'test', $oldValue],

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

                                        $explodedValueArray[$arrayKey] = $newValue;

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

                $dataReader->close();

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

                }

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

             * Function to perform operation after picklist delete.

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

                //update advancefilter values

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

                    }

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

                            'id' => $row['id'],

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

                    if (!empty($decodedArrayConditions)) {

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

                                $arrayKey = array_search($oldValue, $explodedValueArray);

        Line exceeds 120 characters; contains 121 characters
        Open

                        $dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])

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

                    ->where(['like', 'task', $oldValue])

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

                            $arrayKey = array_search($oldValue, $explodedValueArray);

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

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

                    foreach ($valueToDelete as $value) {

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

                        if (false !== $arrayKey) {

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

                    'and',

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

                                }

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

                            $decodedArrayConditions[$key] = $condition;

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

                        $fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);

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

                            foreach ($fieldMapping as $key => $condition) {

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

                                    $explodedValueArray = explode(',', $value);

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

                                    $value = implode(',', $explodedValueArray);

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

                        }

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

                            }

        Line exceeds 120 characters; contains 127 characters
        Open

                if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {

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

                $valueToDelete = $entityData['valuetodelete'];

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

            public function picklistAfterDelete(App\EventHandler $eventHandler)

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

            }

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

             * @param array $entityData

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

                        if ($data['fieldname'] === "{$pickListFieldName}:{$moduleName}" && \in_array($oldValue, $values)) {

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

                    if (false !== $arrayKey) {

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

                    $value = implode(',', $explodedValueArray);

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

                    ->createCommand()->query();

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

                            $updatedTask = \App\Json::encode($fieldMapping);

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

                        if (isset($unserializeTask->{$pickListFieldName})) {

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

                if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {

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

                    ->from('u_#__cv_condition')

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

                    $explodedValueArray = explode(',', $value);

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

                    $arrayKey = array_search($oldValue, $explodedValueArray);

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

                }

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

                    ['module_name' => $moduleName],

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

                while ($row = $dataReader->read()) {

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

                                $condition['value'] = $value;

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

                    $classNameWithDoubleQuotes = $taskComponents[2];

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

                                $fieldMapping[$key] = $condition;

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

                                $pickListFieldName = 'status';

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

            public function operationsAfterPicklistDelete($entityData)

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

            {

        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([

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

                        'and',

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

                        $condition = App\Purifier::decodeHtml($row['test']);

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

                                    $explodedValueArray = explode(',', $value);

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

                        $className = str_replace('"', '', $classNameWithDoubleQuotes);

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

                                            $arrayKey = array_search($value, $explodedValueArray);

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

                            }

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

             * @param string          $pickListFieldName

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

                    $dbCommand->update('u_#__cv_condition', ['value' => $value], ['id' => $row['id']])->execute();

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

                        ['not', ['test' => null]],

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

                    while ($row = $dataReader->read()) {

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

                                        }

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

                        require_once 'modules/com_vtiger_workflow/VTTaskManager.php';

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

                            if ('VTCreateEventTask' == $className) {

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

                                    $pickListFieldName = 'priority';

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

                                }

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

                                $unserializeTask->{$pickListFieldName} = $value;

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

                    $defaultFieldName = 'defaultactivitytype';

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

                        $decodedArrayConditions = \App\Json::decode($condition);

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

                            }

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

                    }

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

                    $dataReader = (new \App\Db\Query())->select(['task', 'workflow_id', 'task_id'])->from('com_vtiger_workflowtasks')->where(['like', 'task', $value])

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

                        if (isset($unserializeTask->field_value_mapping)) {

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

                                    $pickListFieldName = 'status';

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

                                $explodedValueArray = explode(',', $value);

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

                    $this->updateUserData($pickListFieldName, $valueToDelete, $replaceValue);

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

             * @param string|string[] $oldValue

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

                    ->from('vtiger_users')

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

                    ->where([$defaultFieldName => $oldValue])

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

                        ['like', 'test', $value],

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

                                            $explodedValueArray[$arrayKey] = $replaceValue;

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

                }

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

                            $fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);

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

                                            if (false !== $arrayKey) {

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

                                    }

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

                                $serializeTask = serialize($unserializeTask);

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

                                if ('activitystatus' == $pickListFieldName) {

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

                            }

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

                    }

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

                }

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

            /**

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

            public function updateUserData($pickListFieldName, $oldValue, $newValue)

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

            {

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

                    $record = Vtiger_Record_Model::getInstanceById($userId, 'Users');

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

                                if ($condition['fieldname'] == $pickListFieldName) {

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

                                    $condition['value'] = $value;

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

                foreach ($valueToDelete as $value) {

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

                    while ($row = $dataReader->read()) {

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

                        $task = $row['task'];

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

                    $dataReader->close();

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

                        ['module_name' => $moduleName],

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

                                        $value = implode(',', $explodedValueArray);

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

                                $updatedTask = \App\Json::encode($fieldMapping);

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

                                    $arrayKey = array_search($value, $explodedValueArray);

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

                }

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

                    $value = implode(',', $explodedValueArray);

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

                            $condtion = \App\Json::encode($decodedArrayConditions);

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

                        }

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

                        ->createCommand()->query();

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

                        require_once 'modules/com_vtiger_workflow/tasks/' . $className . '.php';

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

                            if (!empty($fieldMapping)) {

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

                                    if ($condition['fieldname'] == $pickListFieldName) {

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

                                } elseif ('taskpriority' == $pickListFieldName) {

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

                            if (isset($unserializeTask->{$pickListFieldName})) {

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

                if ('activitytype' === $pickListFieldName) {

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

                while ($userId = $dataReader->readColumn(0)) {

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

                }

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

                $dataReader->close();

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

            }

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

                }

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

                    //update Workflows values

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

                    ])->createCommand()->query();

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

                                $decodedArrayConditions[$key] = $condition;

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

                        $classNameWithDoubleQuotes = $taskComponents[2];

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

                    $record->save();

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

                foreach ($valueToDelete as $value) {

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

                        if (!empty($decodedArrayConditions)) {

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

                                    foreach ($valueToDelete as $value) {

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

                                    $value = implode(',', $explodedValueArray);

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

                                        $condition['value'] = $value;

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

                                    $fieldMapping[$key] = $condition;

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

                        } else {

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

                                $value = $unserializeTask->{$pickListFieldName};

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

                                foreach ($valueToDelete as $value) {

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

                        }

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

                if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {

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

             *

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

                $dataReader = (new App\Db\Query())->select(['id'])

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

                    $record->set($defaultFieldName, $newValue);

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

                $dataReader->close();

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

                                        $arrayKey = array_search($value, $explodedValueArray);

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

                                foreach ($fieldMapping as $key => $condition) {

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

                                            }

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

                                    $pickListFieldName = 'eventType';

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

                                }

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

                                }

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

                        ['<>', 'test', ''],

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

                                }

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

                    $dataReader->close();

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

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

                                    $pickListFieldName = 'status';

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

                                $value = implode(',', $explodedValueArray);

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

                            }

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

                } else {

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

                    ->createCommand()->query();

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

                        ['<>', 'test', 'null'],

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

                        $unserializeTask = unserialize($task);

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

                                }

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

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

                                } elseif ('activitytype' == $pickListFieldName) {

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

                                    }

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

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

                }

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

             *

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

             * @return void

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

                    $defaultFieldName = 'defaulteventstatus';

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

                                    $value = $condition['value'];

        Line exceeds 120 characters; contains 137 characters
        Open

                            $dbCommand->update('com_vtiger_workflows', ['test' => $condtion], ['workflow_id' => $row['workflow_id']])->execute();

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

                        $taskComponents = explode(':', $task);

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

            }

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

             * Update users data.

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

                                    }

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

                                        $value = $condition['value'];

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

                                        $explodedValueArray = explode(',', $value);

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

                                $serializeTask = serialize($unserializeTask);

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

                                        if (false !== $arrayKey) {

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

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

                    //update workflow task

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

                                        foreach ($valueToDelete as $value) {

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

                                                $explodedValueArray[$arrayKey] = $replaceValue;

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

                                        }

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

                            } elseif ('VTCreateTodoTask' == $className) {

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

                                        $explodedValueArray[$arrayKey] = $replaceValue;

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

             * @param string          $newValue

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

                            foreach ($decodedArrayConditions as $key => $condition) {

        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])

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

                                $unserializeTask->field_value_mapping = $updatedTask;

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

                                if ('activitystatus' == $pickListFieldName) {

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

                                    if (false !== $arrayKey) {

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

        Line exceeds 120 characters; contains 127 characters
        Open

                if ('Calendar' === $moduleName && ('activitytype' === $pickListFieldName || 'activitystatus' === $pickListFieldName)) {

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

             */

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

        class Settings_Picklist_PickListHandler_Handler

        There are no issues that match your filters.

        Category
        Status