YetiForceCompany/YetiForceCRM

View on GitHub
app/RecordStatus.php

Summary

Maintainability
C
1 day
Test Coverage
F
26%

The class RecordStatus has an overall complexity of 55 which is very high. The configured complexity threshold is 50.
Open

class RecordStatus
{
    /**
     * Variable using in picklist record state.
     *
Severity: Minor
Found in app/RecordStatus.php by phpmd

File RecordStatus.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Record status service file.
 *
 * @package App
Severity: Minor
Found in app/RecordStatus.php - About 2 hrs to fix

    Method activate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function activate(string $moduleName, string $fieldName): bool
        {
            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
            if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                return false;
    Severity: Minor
    Found in app/RecordStatus.php - About 1 hr to fix

      Method deactivate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function deactivate(string $moduleName, string $fieldName): bool
          {
              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
              if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                  return false;
      Severity: Minor
      Found in app/RecordStatus.php - About 1 hr to fix

        Function activate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function activate(string $moduleName, string $fieldName): bool
            {
                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                    return false;
        Severity: Minor
        Found in app/RecordStatus.php - About 1 hr 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 deactivate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function deactivate(string $moduleName, string $fieldName): bool
            {
                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                    return false;
        Severity: Minor
        Found in app/RecordStatus.php - About 55 mins 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 addFieldsAndBlock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function addFieldsAndBlock(string $moduleName)
            {
                $moduleModel = \Settings_LayoutEditor_Module_Model::getInstance('Settings:LayoutEditor')->setSourceModule($moduleName);
                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
                if (!$blockId) {
        Severity: Minor
        Found in app/RecordStatus.php - About 35 mins 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 getStates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getStates(string $moduleName, int $state = null)
            {
                $fieldName = static::getFieldName($moduleName);
                $primaryKey = Fields\Picklist::getPickListId($fieldName);
                $values = [];
        Severity: Minor
        Found in app/RecordStatus.php - About 25 mins 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

        The class RecordStatus has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
        Open

        class RecordStatus
        {
            /**
             * Variable using in picklist record state.
             *
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        CouplingBetweenObjects

        Since: 1.1.0

        A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

        Example

        class Foo {
            /**
             * @var \foo\bar\X
             */
            private $x = null;
        
            /**
             * @var \foo\bar\Y
             */
            private $y = null;
        
            /**
             * @var \foo\bar\Z
             */
            private $z = null;
        
            public function setFoo(\Foo $foo) {}
            public function setBar(\Bar $bar) {}
            public function setBaz(\Baz $baz) {}
        
            /**
             * @return \SplObjectStorage
             * @throws \OutOfRangeException
             * @throws \InvalidArgumentException
             * @throws \ErrorException
             */
            public function process(\Iterator $it) {}
        
            // ...
        }

        Source https://phpmd.org/rules/design.html#couplingbetweenobjects

        Missing class import via use statement (line '195', column '19').
        Open

                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        MissingImport

        Since: 2.7.0

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

        Example

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

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

        The method getLockStatus has a boolean flag argument $byName, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public static function getLockStatus(string $moduleName, bool $byName = true): array
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        BooleanArgumentFlag

        Since: 1.4.0

        A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

        Example

        class Foo {
            public function bar($flag = true) {
            }
        }

        Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

        Missing class import via use statement (line '197', column '25').
        Open

                    $blockInstance = new \Settings_LayoutEditor_Block_Model();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        MissingImport

        Since: 2.7.0

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

        Example

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

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

        Avoid using static access to class 'App\Json' in method 'deactivate'.
        Open

                $fieldModel->set('fieldparams', Json::encode($params));
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid assigning values to variables in if clauses and the like (line '139', column '9').
        Open

            public static function activate(string $moduleName, string $fieldName): bool
            {
                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                    return false;
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($foo = 'bar') { // possible typo
                    // ...
                }
                if ($baz = 0) { // always false
                    // ...
                }
            }
        }

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

        Avoid using static access to class 'App\Db' in method 'deactivate'.
        Open

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'getTimeCountingValues'.
        Open

                foreach (Fields\Picklist::getValues($fieldName) as $row) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Json' in method 'activate'.
        Open

                $fieldModel->set('fieldparams', Json::encode($params));
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'addHistory'.
        Open

                    Cache::save("RecordStatus::StateDates::{$recordModel->getId()}", $after, date('Y-m-d H:i:s'));
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'deactivate'.
        Open

                $tableName = Fields\Picklist::getPickListTableName($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\EventHandler' in method 'activate'.
        Open

                foreach (EventHandler::getAll() as $handler) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\EventHandler' in method 'activate'.
        Open

                        EventHandler::update([
                            'is_active' => 1,
                            'include_modules' => \implode(',', $modules),
                        ], $handler['eventhandler_id']);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        The method getFieldName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $result = array_column($query->all(), 'fieldname', 'tabid');
                }
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        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\Fields\Picklist' in method 'getStates'.
        Open

                $primaryKey = Fields\Picklist::getPickListId($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid assigning values to variables in if clauses and the like (line '230', column '9').
        Open

            public static function deactivate(string $moduleName, string $fieldName): bool
            {
                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
                    return false;
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($foo = 'bar') { // possible typo
                    // ...
                }
                if ($baz = 0) { // always false
                    // ...
                }
            }
        }

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

        Avoid using static access to class '\App\Utils\ServiceContracts' in method 'update'.
        Open

                    \App\Utils\ServiceContracts::updateExpectedTimes($recordModel, ['idle']);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getFieldName'.
        Open

                    return Cache::get('RecordStatus::getFieldName', $moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Db' in method 'activate'.
        Open

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getStateDate'.
        Open

                Cache::save($cacheName, $state, $date);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class '\Vtiger_Module_Model' in method 'deactivate'.
        Open

                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\EventHandler' in method 'deactivate'.
        Open

                        EventHandler::update([
                            'is_active' => $modules ? 1 : 0,
                            'include_modules' => \implode(',', $modules),
                        ], $handler['eventhandler_id']);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Utils\ServiceContracts' in method 'update'.
        Open

                    $recordModel->set($key . '_range_time', $recordModel->get($key . '_range_time') + Utils\ServiceContracts::getDiff($date, $recordModel));
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'getTimeCountingIds'.
        Open

                foreach (Fields\Picklist::getValues($fieldName) as $row) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getLockStatus'.
        Open

                if (Cache::has($cacheName, $byName)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getLockStatus'.
        Open

                    return Cache::get($cacheName, $byName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Module' in method 'getFieldName'.
        Open

                    $result = $query->andWhere(['vtiger_field.tabid' => Module::getModuleId($moduleName)])->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getFieldName'.
        Open

                Cache::save('RecordStatus::getFieldName', $moduleName, $result);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Module' in method 'getLockStatus'.
        Open

                $tabId = Module::getModuleId($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid assigning values to variables in if clauses and the like (line '301', column '7').
        Open

            public static function update(\Vtiger_Record_Model $recordModel, string $fieldName)
            {
                $timeCountingValues = self::getTimeCountingValues($fieldName);
                $previous = $recordModel->getPreviousValue($fieldName);
                $current = $recordModel->get($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($foo = 'bar') { // possible typo
                    // ...
                }
                if ($baz = 0) { // always false
                    // ...
                }
            }
        }

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

        Avoid using static access to class 'App\Cache' in method 'getStateDate'.
        Open

                if (Cache::has($cacheName, $state)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'getTimeCountingIds'.
        Open

                $primaryKey = Fields\Picklist::getPickListId($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getLockStatus'.
        Open

                Cache::save($cacheName, $byName, $values);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'getStates'.
        Open

                foreach (Fields\Picklist::getValues($fieldName) as $value) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class '\Vtiger_Module_Model' in method 'activate'.
        Open

                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Fields\Picklist' in method 'activate'.
        Open

                $tableName = Fields\Picklist::getPickListTableName($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\Cache' in method 'getStateDate'.
        Open

                    return Cache::get($cacheName, $state);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid using static access to class 'App\EventHandler' in method 'deactivate'.
        Open

                foreach (EventHandler::getAll() as $handler) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

        Avoid assigning values to variables in if clauses and the like (line '301', column '77').
        Open

            public static function update(\Vtiger_Record_Model $recordModel, string $fieldName)
            {
                $timeCountingValues = self::getTimeCountingValues($fieldName);
                $previous = $recordModel->getPreviousValue($fieldName);
                $current = $recordModel->get($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

        Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

        Example

        class Foo
        {
            public function bar($flag)
            {
                if ($foo = 'bar') { // possible typo
                    // ...
                }
                if ($baz = 0) { // always false
                    // ...
                }
            }
        }

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

        Avoid using static access to class 'App\Cache' in method 'getFieldName'.
        Open

                if (Cache::has('RecordStatus::getFieldName', $moduleName)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        StaticAccess

        Since: 1.4.0

        Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

        Example

        class Foo
        {
            public function bar()
            {
                Bar::baz();
            }
        }

        Source https://phpmd.org/rules/cleancode.html#staticaccess

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

                $tableStatusHistory = $moduleModel->get('basetable') . '_state_history';
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "include_modules" 6 times.
        Open

                        $modules = $handler['include_modules'] ? \explode(',', $handler['include_modules']) : [];
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "crmid" 6 times.
        Open

                        'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 11),
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "after" 3 times.
        Open

                        'after' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "Y-m-d H:i:s" 3 times.
        Open

                            'date' => date('Y-m-d H:i:s'),
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "fieldparams" 3 times.
        Open

                $fieldModel->set('fieldparams', Json::encode($params));
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "time_counting" 8 times.
        Open

                if (!isset($tableSchema->columns['time_counting'])) {
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "RecordStatus::getFieldName" 3 times.
        Open

                if (Cache::has('RecordStatus::getFieldName', $moduleName)) {
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "record_state" 8 times.
        Open

                    if (isset($value['record_state']) && $state === $value['record_state']) {
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

        Define a constant instead of duplicating this literal "tabid" 3 times.
        Open

                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

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

                $tableStatusHistory = $moduleModel->get('basetable') . '_state_history';
        Severity: Critical
        Found in app/RecordStatus.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

        ACTION_1 = 'action1';
        
        function run() {
          prepare(ACTION_1);
          execute(ACTION_1);
          release(ACTION_1);
        }
        

        Exceptions

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

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

                $schema = $db->getSchema();
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_TINYINT from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                        'after' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_TIMESTAMP from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                        'date' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TIMESTAMP)->null(),
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_TINYINT from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                        'before' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_UPK from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                        'id' => \yii\db\Schema::TYPE_UPK,
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $tableSchema = $db->getTableSchema($tableName);
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $dbCommand = $db->createCommand();
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                    \App\Db::getInstance()
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is bool but \App\Cache::save() takes string defined at /code/app/Cache.php:89
        Open

                Cache::save($cacheName, $byName, $values);
        Severity: Minor
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_INTEGER from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                        'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 11),
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $values = (new Db\Query())->select($field)
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Saw an @param annotation for value, but it was not found in the param list of function getStateDate(\Vtiger_Record_Model $recordModel, int $state) : string
        Open

             * @param int                  $value
        Severity: Info
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is bool but \App\Cache::get() takes string defined at /code/app/Cache.php:61
        Open

                    return Cache::get($cacheName, $byName);
        Severity: Minor
        Found in app/RecordStatus.php by phan

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

                $query = (new Db\Query())
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is int but \App\Cache::has() takes string defined at /code/app/Cache.php:74
        Open

                if (Cache::has($cacheName, $state)) {
        Severity: Minor
        Found in app/RecordStatus.php by phan

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

                if (!$db->getTableSchema($tableStatusHistory)) {
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $dbCommand = $db->createCommand();
        Severity: Critical
        Found in app/RecordStatus.php by phan

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

                $tableSchema = $db->getTableSchema($tableName);
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is int but \App\Cache::save() takes string defined at /code/app/Cache.php:89
        Open

                Cache::save($cacheName, $state, $date);
        Severity: Minor
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is bool but \App\Cache::has() takes string defined at /code/app/Cache.php:74
        Open

                if (Cache::has($cacheName, $byName)) {
        Severity: Minor
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_TINYINT from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                    $dbCommand->addColumn($tableName, 'record_state', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Reference to constant TYPE_TINYINT from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
        Open

                    $dbCommand->addColumn($tableName, 'time_counting', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Argument 2 (key) is int but \App\Cache::get() takes string defined at /code/app/Cache.php:61
        Open

                    return Cache::get($cacheName, $state);
        Severity: Minor
        Found in app/RecordStatus.php by phan

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

                $date = (new Db\Query())->select(['date'])
        Severity: Critical
        Found in app/RecordStatus.php by phan

        Avoid excessively long variable names like $previousCountingValue. Keep variable name length under 20.
        Open

                $previousCountingValue = $timeCountingValues[$previous] ?? null;
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        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 variables with short names like $db. Configured minimum length is 3.
        Open

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        ShortVariable

        Since: 0.2

        Detects when a field, local, or parameter has a very short name.

        Example

        class Something {
            private $q = 15; // VIOLATION - Field
            public static function main( array $as ) { // VIOLATION - Formal
                $r = 20 + $this->q; // VIOLATION - Local
                for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                    $r += $this->q;
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#shortvariable

        Avoid variables with short names like $db. Configured minimum length is 3.
        Open

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpmd

        ShortVariable

        Since: 0.2

        Detects when a field, local, or parameter has a very short name.

        Example

        class Something {
            private $q = 15; // VIOLATION - Field
            public static function main( array $as ) { // VIOLATION - Formal
                $r = 20 + $this->q; // VIOLATION - Local
                for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                    $r += $this->q;
                }
            }
        }

        Source https://phpmd.org/rules/naming.html#shortvariable

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const TIME_COUNTING_REACTION = 1;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'idle_range_time' => 'FL_IDLE_RANGE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string   $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        'crmid' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 11),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const RECORD_STATE_OPEN = 1;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const TIME_COUNTING_RESOLVE = 2;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var string[]
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    self::RECORD_STATE_OPEN => 'LBL_RECORD_STATE_OPEN',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        'date' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TIMESTAMP)->null(),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ]);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable using in picklist record state.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $values = [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    if (isset($value['record_state']) && $state === $value['record_state']) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        'id' => \yii\db\Schema::TYPE_UPK,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                self::TIME_COUNTING_RESOLVE => 'solution',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'solution_range_time' => 'FL_SOLUTION_RANGE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                ];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $values[$value[$primaryKey]] = $value['picklistValue'];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tableStatusHistory = $moduleModel->get('basetable') . '_state_history';
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!$db->getTableSchema($tableStatusHistory)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'idle_datatime' => 'FL_IDLE_DATE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $values[$value[$primaryKey]] = $value['record_state'];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $fieldName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!isset($tableSchema->columns['record_state'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 170 characters
        Open

                    $dbCommand->addColumn($tableName, 'record_state', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const RECORD_STATE_CLOSED = 2;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'response_expected' => 'FL_RESPONSE_EXPECTED',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $schema = $db->getSchema();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $db->createTable($tableStatusHistory, [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Fields key by state time.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'closing_range_time' => 'FL_CLOSING_RANGE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            ];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get all record states.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * State time fields.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'solution_datatime' => 'FL_SOLUTION_DATE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Activate of the record status mechanism.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return bool
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function activate(string $moduleName, string $fieldName): bool
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $params['isProcessStatusField'] = true;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                'DateTime' => [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $params = $fieldModel->getFieldParams();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        'after' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                self::TIME_COUNTING_REACTION => 'response',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            ];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                'RangeTime' => [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    self::RECORD_STATE_NO_CONCERN => 'LBL_RECORD_STATE_NO_CONCERN',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param int|null $state
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 124 characters
        Open

                        'before' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable used to count times in specified categories.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'response_datatime' => 'FL_RESPONSE_DATE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getLabels(): array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get record state statuses by module name.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $dbCommand = $db->createCommand();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        'before' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tableName = Fields\Picklist::getPickListTableName($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @var int
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable used to count times in specified categories.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const TIME_COUNTING_IDLE = 3;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            private static $stateTimeFields = [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    self::RECORD_STATE_CLOSED => 'LBL_RECORD_STATE_CLOSED',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return false;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->createIndex($tableStatusHistory . '_crmid_idx', $tableStatusHistory, 'crmid')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            const RECORD_STATE_NO_CONCERN = 0;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable using in picklist record state.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            private static $fieldsByStateTime = [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                self::TIME_COUNTING_IDLE => 'idle',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                ],
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldName = static::getFieldName($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $primaryKey = Fields\Picklist::getPickListId($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    } elseif (null === $state && isset($value['record_state'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->addForeignKey('fk_1_' . $tableStatusHistory, $tableStatusHistory, 'crmid', 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 162 characters
        Open

                    $dbCommand->addForeignKey('fk_1_' . $tableStatusHistory, $tableStatusHistory, 'crmid', 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'response_range_time' => 'FL_RESPONSE_RANGE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'closing_datatime' => 'FL_CLOSING_DATE_TIME',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'idle_expected' => 'FL_IDLE_DATE_EXPECTED',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return string[] [id=>label]
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return array if state is specified values are labels, if not values are record_states, key is always primary key
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getStates(string $moduleName, int $state = null)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $values;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldModel->save();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tableSchema = $db->getTableSchema($tableName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->addColumn($tableName, 'record_state', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable using in picklist record state.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Variable used to count times in specified categories.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    'solution_expected' => 'FL_SOLUTION_EXPECTED',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (Fields\Picklist::getValues($fieldName) as $value) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldModel->set('fieldparams', Json::encode($params));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 123 characters
        Open

                        'after' => $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $modules = $handler['include_modules'] ? \explode(',', $handler['include_modules']) : [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        ], $handler['eventhandler_id']);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $blockInstance->set('label', 'BL_RECORD_STATUS_TIMES');
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'fieldLabel' => $label,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (EventHandler::getAll() as $handler) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $modules = $handler['include_modules'] ? \explode(',', $handler['include_modules']) : [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $timeCountingValues = self::getTimeCountingValues($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $previous = $recordModel->getPreviousValue($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (self::TIME_COUNTING_IDLE === $currentCountingValue) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    \App\Utils\ServiceContracts::updateExpectedTimes($recordModel, ['idle']);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 171 characters
        Open

                    $dbCommand->addColumn($tableName, 'time_counting', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (static::$stateTimeFields as $type => $fields) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Deactivate of the record status mechanism.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->dropColumn($tableName, 'record_state')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'include_modules' => \implode(',', $modules),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Add date history status to table.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    \App\Db::getInstance()
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return void
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $fieldName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function addHistory(\Vtiger_Record_Model $recordModel, string $fieldName)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if ($before !== $after) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $recordModel->set($key . '_range_time', $recordModel->get($key . '_range_time') + Utils\ServiceContracts::getDiff($date, $recordModel));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $recordModel->set($key . '_datatime', date('Y-m-d H:i:s'));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        if (!\in_array($moduleName, $modules)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return (bool) $fieldModel;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $dbCommand = $db->createCommand();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if ($previous && $currentCountingValue !== $previousCountingValue && null !== $previousCountingValue
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 148 characters
        Open

                    $recordModel->set($key . '_range_time', $recordModel->get($key . '_range_time') + Utils\ServiceContracts::getDiff($date, $recordModel));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 180 characters
        Open

                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        ], $handler['eventhandler_id']);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $before = $timeCountingValues[$recordModel->getPreviousValue($fieldName)] ?? 0;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        ->insert($recordModel->getModule()->get('basetable') . '_state_history', [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function update(\Vtiger_Record_Model $recordModel, string $fieldName)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param \Vtiger_Record_Model $recordModel
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param int                  $state
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldModel->save();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $dbCommand->dropTable($moduleModel->get('basetable') . '_state_history')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (isset($tableSchema->columns['record_state'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            unset($modules[array_search($moduleName, $modules)]);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        ->createCommand()
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'date' => date('Y-m-d H:i:s'),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param \Vtiger_Record_Model $recordModel
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 147 characters
        Open

                && ($date = self::getStateDate($recordModel, $previousCountingValue)) && ($key = self::$fieldsByStateTime[$previousCountingValue] ?? '')) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get date from the status change history by status.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'include_modules' => \implode(',', $modules),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'is_active' => 1,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function addFieldsAndBlock(string $moduleName)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            ]);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        Line exceeds 120 characters; contains 127 characters
        Open

                $moduleModel = \Settings_LayoutEditor_Module_Model::getInstance('Settings:LayoutEditor')->setSourceModule($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $allFields = $moduleModel->getFields();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function deactivate(string $moduleName, string $fieldName): bool
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'fieldTypeList' => 0,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!($fieldModel = $moduleModel->getFieldByName($fieldName))) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tableSchema = $db->getTableSchema($tableName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $db = Db::getInstance();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (isset($tableSchema->columns['time_counting'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tableName = Fields\Picklist::getPickListTableName($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'is_active' => $modules ? 1 : 0,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->dropColumn($tableName, 'time_counting')->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string               $fieldName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $after = $timeCountingValues[$recordModel->get($fieldName)] ?? 0;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'crmid' => $recordModel->getId(),
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string               $fieldName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $currentCountingValue = $timeCountingValues[$current] ?? null;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                && ($date = self::getStateDate($recordModel, $previousCountingValue)) && ($key = self::$fieldsByStateTime[$previousCountingValue] ?? '')) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            $modules[] = $moduleName;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $blockId = $blockInstance->save($moduleModel->getSourceModule());
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    foreach ($fields as $name => $label) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            $moduleModel->addField($type, $blockId, [
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $params = $fieldModel->getFieldParams();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'before' => $before,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (EventHandler::getAll() as $handler) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        if (!isset($allFields[$name])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'generatedtype' => 1,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    Cache::save("RecordStatus::StateDates::{$recordModel->getId()}", $after, date('Y-m-d H:i:s'));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!isset($tableSchema->columns['time_counting'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        EventHandler::update([
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldModel->set('fieldparams', Json::encode($params));
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                            'after' => $after,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $previousCountingValue = $timeCountingValues[$previous] ?? null;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $dbCommand->addColumn($tableName, 'time_counting', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_TINYINT, 1)->notNull()->defaultValue(0))->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!$blockId) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        ])->execute();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $timeCountingValues = self::getTimeCountingValues($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $moduleModel = \Settings_LayoutEditor_Module_Model::getInstance('Settings:LayoutEditor')->setSourceModule($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $blockInstance = new \Settings_LayoutEditor_Block_Model();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return bool
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                unset($params['isProcessStatusField']);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $current = $recordModel->get($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    if ('Vtiger_RecordStatusHistory_Handler' === $handler['handler_class']) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'fieldName' => $name,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return false;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    if ('Vtiger_RecordStatusHistory_Handler' === $handler['handler_class']) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return (bool) $fieldModel;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param \Vtiger_Record_Model $recordModel
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Update status times.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                static::addFieldsAndBlock($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Add block and fields.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $blockInstance->set('icon', 'fas fa-business-time');
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'displayType' => 2,
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                                'helpinfo' => 'Detail',
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        if (\in_array($moduleName, $modules)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        EventHandler::update([
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param int                  $value
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getTimeCountingIds(string $moduleName)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $field = $byName ? ['vtiger_field.fieldname', 'value'] : ['valueid', 'value'];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $cacheName = "RecordStatus::getLockStatus::$moduleName";
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return Cache::get('RecordStatus::getFieldName', $moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->from($recordModel->getModule()->get('basetable') . '_state_history')
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get time counting values grouped by id from field name.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $values = (new Db\Query())->select($field)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->where(['tabid' => $tabId, 'presence' => [0, 2]])
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->createCommand()->queryAllByGroup($byName ? 2 : 0);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $values;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (!$fieldName) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $tabId = Module::getModuleId($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->from('u_#__picklist_close_state')
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->innerJoin('vtiger_field', 'u_#__picklist_close_state.fieldid = vtiger_field.fieldid')
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                Cache::save($cacheName, $byName, $values);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $result = array_column($query->all(), 'fieldname', 'tabid');
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (Cache::has($cacheName, $state)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->where(['crmid' => $recordModel->getId(), 'after' => $state])->orderBy(['date' => SORT_DESC])
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                Cache::save($cacheName, $state, $date);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $values[$row[$primaryKey]] = (int) $row['time_counting'];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (Cache::has('RecordStatus::getFieldName', $moduleName)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->from('vtiger_field')
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $result;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get time counting values grouped by id from field name.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getTimeCountingValues(string $fieldName)
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return Cache::get($cacheName, $byName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->select(['vtiger_field.fieldname', 'vtiger_field.tabid'])
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if ($moduleName) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    if (isset($row['time_counting'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $date;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                if (Cache::has($cacheName, $byName)) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (Fields\Picklist::getValues($fieldName) as $row) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $values;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->where(['LIKE', 'fieldparams', '"isProcessStatusField":true'])
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                } else {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                Cache::save('RecordStatus::getFieldName', $moduleName, $result);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    return Cache::get($cacheName, $state);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $fieldName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $fieldName = static::getFieldName($moduleName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $values = [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    if (isset($row['time_counting'])) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $cacheName = "RecordStatus::StateDates::{$recordModel->getId()}";
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param bool   $byName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             *
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $values = [];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            /**
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get process status field names.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName optional if we need only one field name for specified module
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getFieldName(string $moduleName = '')
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->andWhere(['presence' => [0, 2]]);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return string
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getStateDate(\Vtiger_Record_Model $recordModel, int $state): string
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    ->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                        $values[$row[$fieldName]] = (int) $row['time_counting'];
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                return $values;
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @return string|string[]
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             */
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $query = (new Db\Query())
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                foreach (Fields\Picklist::getValues($fieldName) as $row) {
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * @param string $moduleName
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            }
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                    $result = $query->andWhere(['vtiger_field.tabid' => Module::getModuleId($moduleName)])->scalar();
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $date = (new Db\Query())->select(['date'])
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

                $primaryKey = Fields\Picklist::getPickListId($fieldName);
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

             * Get closing states for all fields in module.
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

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

            public static function getLockStatus(string $moduleName, bool $byName = true): array
        Severity: Minor
        Found in app/RecordStatus.php by phpcodesniffer

        There are no issues that match your filters.

        Category
        Status