YetiForceCompany/YetiForceCRM

View on GitHub
app/AutoAssign.php

Summary

Maintainability
A
3 hrs
Test Coverage
D
66%

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

class AutoAssign extends Base
{
    /** @var string Basic table name */
    public const TABLE_NAME = 's_#__auto_assign';
    /** @var array Members tables */
Severity: Minor
Found in app/AutoAssign.php by phpmd

Method getAvailableUsersQuery has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAvailableUsersQuery(): QueryGenerator
    {
        $queryGenerator = (new QueryGenerator('Users'))
            ->setFields(['id'])
            ->addCondition('status', 'Active', 'e')
Severity: Minor
Found in app/AutoAssign.php - About 1 hr to fix

    Function getAvailableUsersQuery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getAvailableUsersQuery(): QueryGenerator
        {
            $queryGenerator = (new QueryGenerator('Users'))
                ->setFields(['id'])
                ->addCondition('status', 'Active', 'e')
    Severity: Minor
    Found in app/AutoAssign.php - About 45 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 getMembers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getMembers(): array
        {
            if (!$this->has('members')) {
                $queryAll = null;
                foreach (self::MEMBERS_TABLES as $tableName => $index) {
    Severity: Minor
    Found in app/AutoAssign.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 isActive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function isActive(int $mode): bool
        {
            switch ($mode) {
                case self::MODE_MANUAL:
                    $result = !$this->isEmpty('gui');
    Severity: Minor
    Found in app/AutoAssign.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 AutoAssign has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
    Open

    class AutoAssign extends Base
    {
        /** @var string Basic table name */
        public const TABLE_NAME = 's_#__auto_assign';
        /** @var array Members tables */
    Severity: Minor
    Found in app/AutoAssign.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 '285', column '63').
    Open

            return $this->getQuery()->orderBy(['count' => SORT_ASC, new \yii\db\Expression('RAND()')]);
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '329', column '63').
    Open

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => new \yii\db\Expression($recordLimit)]);
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '424', column '32').
    Open

                    $params['datetime'] = (new \DateTime())->format('Y-m-d H:i:s.u');
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '393', column '32').
    Open

                        ->select(['member' => new \yii\db\Expression('CONCAT(type,\':\', member)')])
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '422', column '69').
    Open

                    $dbCommand->update(self::ROUND_ROBIN_TABLE, ['datetime' => (new \DateTime())->format('Y-m-d H:i:s.u')], $params)->execute();
    Severity: Minor
    Found in app/AutoAssign.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 getName has a boolean flag argument $encode, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getName(bool $encode = true): string
    Severity: Minor
    Found in app/AutoAssign.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 '319', column '38').
    Open

                ->setCustomColumn(['count' => new \yii\db\Expression('COUNT(*)')])
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '335', column '47').
    Open

            $query->andHaving(['or', ['<', 'count', new \yii\db\Expression('temp_limit')], ['temp_limit' => 0], ['count' => null]]);
    Severity: Minor
    Found in app/AutoAssign.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 'getQuery'.
    Open

            $conditions = Json::isEmpty($this->get('record_limit_conditions')) ? [] : Json::decode($this->get('record_limit_conditions'));
    Severity: Minor
    Found in app/AutoAssign.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\PrivilegeUtil' in method 'getAvailableUsersQuery'.
    Open

                        $condition[] = [$columnName => (new Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . Layout::getUniqueId() => PrivilegeUtil::getQueryToUsersByGroup((int) $id)])];
    Severity: Minor
    Found in app/AutoAssign.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\YetiForce\Shop' in method 'getAutoAssignForRecord'.
    Open

            if (!\App\YetiForce\Shop::check('YetiForceAutoAssignment')) {
    Severity: Minor
    Found in app/AutoAssign.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\Condition' in method 'checkConditionForRecord'.
    Open

            return Condition::checkConditions($conditions, $recordModel);
    Severity: Minor
    Found in app/AutoAssign.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 getQuery uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $queryGeneratorUsers->setCustomColumn(['temp_limit' => new \yii\db\Expression($recordLimit)]);
            }
    Severity: Minor
    Found in app/AutoAssign.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\Module' in method 'getByModule'.
    Open

                ->where(['tabid' => Module::getModuleId($moduleName), 'state' => $state]);
    Severity: Minor
    Found in app/AutoAssign.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 'checkConditionForRecord'.
    Open

            $conditions = Json::isEmpty($this->get('conditions')) ? [] : Json::decode($this->get('conditions'));
    Severity: Minor
    Found in app/AutoAssign.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'App\Language' in method 'getName'.
    Open

            return Language::translate($this->get('subject'), 'Settings:AutomaticAssignment', false, $encode);
    Severity: Minor
    Found in app/AutoAssign.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\Owner' in method 'getDefaultOwner'.
    Open

            $type = $defaultOwner ? Fields\Owner::getType($defaultOwner) : null;
    Severity: Minor
    Found in app/AutoAssign.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 'getQuery'.
    Open

            $conditions = Json::isEmpty($this->get('record_limit_conditions')) ? [] : Json::decode($this->get('record_limit_conditions'));
    Severity: Minor
    Found in app/AutoAssign.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\PrivilegeUtil' in method 'getAvailableUsersQuery'.
    Open

                        $condition[] = [$columnName => PrivilegeUtil::getQueryToUsersByRole($id)];
    Severity: Minor
    Found in app/AutoAssign.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\Layout' in method 'getAvailableUsersQuery'.
    Open

                        $condition[] = [$columnName => (new Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . Layout::getUniqueId() => PrivilegeUtil::getQueryToUsersByGroup((int) $id)])];
    Severity: Minor
    Found in app/AutoAssign.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 getMembers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                    } else {
                        $queryAll = $query;
                    }
    Severity: Minor
    Found in app/AutoAssign.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\Json' in method 'getAutoAssignForRecord'.
    Open

                $conditions = Json::isEmpty($autoAssignData['conditions']) ? [] : Json::decode($autoAssignData['conditions']);
    Severity: Minor
    Found in app/AutoAssign.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\PrivilegeUtil' in method 'getAvailableUsersQuery'.
    Open

                        $condition[] = [$columnName => PrivilegeUtil::getQueryToUsersByRoleAndSubordinate($id)];
    Severity: Minor
    Found in app/AutoAssign.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\User' in method 'postProcess'.
    Open

                } elseif (\App\User::isExists($userId, false)) {
    Severity: Minor
    Found in app/AutoAssign.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\Owner' in method 'getDefaultOwner'.
    Open

            $ownerModel = Fields\Owner::getInstance($this->getModuleName());
    Severity: Minor
    Found in app/AutoAssign.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 'checkConditionForRecord'.
    Open

            $conditions = Json::isEmpty($this->get('conditions')) ? [] : Json::decode($this->get('conditions'));
    Severity: Minor
    Found in app/AutoAssign.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\Condition' in method 'getAutoAssignForRecord'.
    Open

                if (Condition::checkConditions($conditions, $recordModel)) {
    Severity: Minor
    Found in app/AutoAssign.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\User' in method 'getDefaultOwner'.
    Open

                $owner = User::isExists($defaultOwner) ? $defaultOwner : $owner;
    Severity: Minor
    Found in app/AutoAssign.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 'getModuleName'.
    Open

            return Module::getModuleName($this->get('tabid'));
    Severity: Minor
    Found in app/AutoAssign.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 'getAutoAssignForRecord'.
    Open

                $conditions = Json::isEmpty($autoAssignData['conditions']) ? [] : Json::decode($autoAssignData['conditions']);
    Severity: Minor
    Found in app/AutoAssign.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 "conditions" 4 times.
    Open

                $conditions = Json::isEmpty($autoAssignData['conditions']) ? [] : Json::decode($autoAssignData['conditions']);
    Severity: Critical
    Found in app/AutoAssign.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 "temp_limit" 5 times.
    Open

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => $queryGeneratorUsers->getColumnName('records_limit')]);
    Severity: Critical
    Found in app/AutoAssign.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 "method" 3 times.
    Open

            switch ($this->get('method')) {
    Severity: Critical
    Found in app/AutoAssign.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 "members" 3 times.
    Open

            if (!$this->has('members')) {
    Severity: Critical
    Found in app/AutoAssign.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 "count" 5 times.
    Open

            return $this->getQuery()->orderBy(['count' => SORT_ASC, new \yii\db\Expression('RAND()')]);
    Severity: Critical
    Found in app/AutoAssign.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.

    Argument 3 (language) is false but \App\Language::translate() takes null|string defined at /code/app/Language.php:161
    Open

            return Language::translate($this->get('subject'), 'Settings:AutomaticAssignment', false, $encode);
    Severity: Minor
    Found in app/AutoAssign.php by phan

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

                    $owner = $this->getQueryByLoadBalance()->all();
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                    $owner = $this->getQueryByRoundRobin()->all();
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Doc-block of getDefaultOwner has declared return type int which is not a permitted replacement of the nullable return type ?int declared in the signature ('?T' should be documented as 'T|null' or '?T')
    Open

         * @return int
    Severity: Minor
    Found in app/AutoAssign.php by phan

    Returning type string but getOwner() is declared to return ?int|int
    Open

            return $owner ? $owner : $this->getDefaultOwner();
    Severity: Minor
    Found in app/AutoAssign.php by phan

    Call to method getInstance from undeclared class \App\Fields\Owner
    Open

            $ownerModel = Fields\Owner::getInstance($this->getModuleName());
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $query = (new Db\Query())->from(self::TABLE_NAME)
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Doc-block of getOwner has declared return type int which is not a permitted replacement of the nullable return type ?int declared in the signature ('?T' should be documented as 'T|null' or '?T')
    Open

         * @return int
    Severity: Minor
    Found in app/AutoAssign.php by phan

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

            $data = (new Db\Query())->from(self::TABLE_NAME)->where(['id' => $id])->one();
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method check from undeclared class \App\YetiForce\Shop
    Open

            if (!\App\YetiForce\Shop::check('YetiForceAutoAssignment')) {
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            return $this->getQuery()->orderBy(['count' => SORT_ASC, new \yii\db\Expression('RAND()')]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method __construct from undeclared class \yii\db\Expression
    Open

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => new \yii\db\Expression($recordLimit)]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                $isExists = (new Db\Query())->from(self::ROUND_ROBIN_TABLE)->where($params)->exists();
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method __construct from undeclared class \yii\db\Expression
    Open

            return $this->getQuery()->orderBy(['count' => SORT_ASC, new \yii\db\Expression('RAND()')]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                ->addNativeCondition([$queryGenerator->getColumnName($ownerFieldName) => $queryGeneratorUsers->createQuery()]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $queryGeneratorUsers->setGroup('id')->setCustomGroup(['temp_limit', 'count']);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $query = $queryGeneratorUsers->createQuery(true);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                        $condition[] = [$columnName => (new Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . Layout::getUniqueId() => PrivilegeUtil::getQueryToUsersByGroup((int) $id)])];
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $queryGenerator->setFields([$ownerFieldName])
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => $queryGeneratorUsers->getColumnName('records_limit')]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => new \yii\db\Expression($recordLimit)]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method isExists from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                $owner = User::isExists($defaultOwner) ? $defaultOwner : $owner;
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => $queryGeneratorUsers->getColumnName('records_limit')]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            return $this->getQuery()->leftJoin($robinTable, "vtiger_users.id = {$robinTable}.user AND {$robinTable}.id={$id}")
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method __construct from undeclared class \yii\db\Expression
    Open

                ->setCustomColumn(['count' => new \yii\db\Expression('COUNT(*)')])
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

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

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

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

    Call to method getType from undeclared class \App\Fields\Owner
    Open

            $type = $defaultOwner ? Fields\Owner::getType($defaultOwner) : null;
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $query->leftJoin(['crm_data_temp_table' => $subQuery], "crm_data_temp_table.{$ownerFieldName}={$queryGeneratorUsers->getColumnName('id')}");
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method isExists from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                } elseif (\App\User::isExists($userId, false)) {
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $queryGenerator = (new QueryGenerator($this->getModuleName()));
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

                ->addNativeCondition([$queryGenerator->getColumnName($ownerFieldName) => $queryGeneratorUsers->createQuery()]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $queryGenerator = (new QueryGenerator('Users'))
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $queryGenerator = (new QueryGenerator('Users'))
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Return type of getAvailableUsersQuery() is undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

        public function getAvailableUsersQuery(): QueryGenerator
    Severity: Minor
    Found in app/AutoAssign.php by phan

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

            $queryGenerator->permissions = false;
    Severity: Minor
    Found in app/AutoAssign.php by phan

    Call to method __construct from undeclared class \yii\db\Expression
    Open

                        ->select(['member' => new \yii\db\Expression('CONCAT(type,\':\', member)')])
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $subQuery = $queryGenerator->createQuery();
    Severity: Critical
    Found in app/AutoAssign.php by phan

    Call to method __construct from undeclared class \yii\db\Expression
    Open

            $query->andHaving(['or', ['<', 'count', new \yii\db\Expression('temp_limit')], ['temp_limit' => 0], ['count' => null]]);
    Severity: Critical
    Found in app/AutoAssign.php by phan

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

            $id = $this->getId();
    Severity: Minor
    Found in app/AutoAssign.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 $id. Configured minimum length is 3.
    Open

        public static function getInstanceById(int $id): ?self
    Severity: Minor
    Found in app/AutoAssign.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 $id. Configured minimum length is 3.
    Open

                [$type, $id] = explode(':', $member);
    Severity: Minor
    Found in app/AutoAssign.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

        /** @var int Handler mode */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $mods = ['or'];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 122 characters
    Open

                $conditions = Json::isEmpty($autoAssignData['conditions']) ? [] : Json::decode($autoAssignData['conditions']);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public static function getInstanceById(int $id): ?self
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $data = (new Db\Query())->from(self::TABLE_NAME)->where(['id' => $id])->one();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

        public function getId(): int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Check conditions for record.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                case self::MODE_HANDLER:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public const MEMBERS_TABLES = ['s_#__auto_assign_users' => 'id', 's_#__auto_assign_groups' => 'id', 's_#__auto_assign_roles' => 'id'];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public static function getAutoAssignForRecord(\Vtiger_Record_Model $recordModel, int $mode = null): ?self
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $autoAssignInstance = null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $autoAssignInstance;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return self|null
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

                    $result = !$this->isEmpty('gui');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get auto assign instance for record.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

        public static function getInstance(array $data): ?self
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        /** @var string Round robin table name */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

    Line exceeds 120 characters; contains 135 characters
    Open

            foreach ([self::MODE_MANUAL => 'gui', self::MODE_HANDLER => 'handler', self::MODE_WORKFLOW => 'workflow'] as $key => $column) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            return $this->get('id');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * @return string
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const TABLE_NAME = 's_#__auto_assign';
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Manual mode */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

        /** @var string Basic table name */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const ROUND_ROBIN_TABLE = 'u_#__auto_assign_rr';
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

        public static function getByModule(string $moduleName, int $mode = self::MODE_HANDLER | self::MODE_WORKFLOW | self::MODE_MANUAL, int $state = self::STATUS_ACTIVE): array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @param int|null $mode       A bitmask of one or more of the mode flags
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $conditions = Json::isEmpty($autoAssignData['conditions']) ? [] : Json::decode($autoAssignData['conditions']);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            return Condition::checkConditions($conditions, $recordModel);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                case self::MODE_WORKFLOW:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var array Members tables */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @param int    $mode       A bitmask of one or more of the mode flags
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                $instances[$autoAssignData['id']] = self::getInstance($autoAssignData);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            if (!\App\YetiForce\Shop::check('YetiForceAutoAssignment')) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * Function to get the Id.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

         * Get module name.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                case self::MODE_MANUAL:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                default:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                ->addGroupBy($columnName)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Query generator object of available users.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                        $condition[] = [$columnName => (new Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . Layout::getUniqueId() => PrivilegeUtil::getQueryToUsersByGroup((int) $id)])];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    case PrivilegeUtil::MEMBER_TYPE_ROLES:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const STATUS_INACTIVE = 0;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const STATUS_ACTIVE = 1;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $query = (new Db\Query())->from(self::TABLE_NAME)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            foreach ([self::MODE_MANUAL => 'gui', self::MODE_HANDLER => 'handler', self::MODE_WORKFLOW => 'workflow'] as $key => $column) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $mods[] = [$column => 1];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

                default:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $result = false;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Round robin method */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

         * @return string
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            switch ($mode) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getOwner(): ?int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    $owner = $this->getQueryByLoadBalance()->all();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get default owner.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * it is always the first one in the results who will be assigned to new entry.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const MODE_WORKFLOW = 4;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public const METHOD_ROUND_ROBIN = 1;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getQueryByRoundRobin(): Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get all auto assign entries for module.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                ->where(['tabid' => Module::getModuleId($moduleName), 'state' => $state]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $query->all();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * @param int|null             $mode        A bitmask of one or more of the mode flags
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * @param bool $encode
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

            $instances = [];
    Severity: Minor
    Found in app/AutoAssign.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/AutoAssign.php by phpcodesniffer

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

         * @return self|null
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @param array $data
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * Get name of auto assign instance.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getName(bool $encode = true): string
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $conditions = Json::isEmpty($this->get('conditions')) ? [] : Json::decode($this->get('conditions'));
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

         * In order to correctly balance the entries attribution
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $queryGenerator->permissions = false;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->setConditions($conditions)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public function getAvailableUsersQuery(): QueryGenerator
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Status inactive */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Load balance method */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                if ($mode & $key) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $query->andWhere($mods);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get all auto assign instances for module.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

         * @return self|null
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            return $result && self::STATUS_ACTIVE === (int) $this->get('state');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const MODE_HANDLER = 2;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    $autoAssignInstance = self::getInstance($autoAssignData);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $data ? (new self())->setData($data) : null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public function isActive(int $mode): bool
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                case self::METHOD_LOAD_BALANCE:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getDefaultOwner(): ?int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $ownerModel = Fields\Owner::getInstance($this->getModuleName());
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            } elseif ($type) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $owner = \array_key_exists($defaultOwner, $ownerModel->getAccessibleGroupForModule()) ? $defaultOwner : $owner;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                ->orderBy([$columnName => SORT_ASC]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Query object for users allowed for assignment.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getQuery(): Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $recordLimit = (int) $this->get('record_limit');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $query->leftJoin(['crm_data_temp_table' => $subQuery], "crm_data_temp_table.{$ownerFieldName}={$queryGeneratorUsers->getColumnName('id')}");
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $columnName = $queryGenerator->getColumnName('id');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $condition = ['or'];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 138 characters
    Open

        public const MEMBERS_TABLES = ['s_#__auto_assign_users' => 'id', 's_#__auto_assign_groups' => 'id', 's_#__auto_assign_roles' => 'id'];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Workflow mode */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            return $instances;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get auto assign instance by ID.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            return $data ? (new self())->setData($data) : null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return Language::translate($this->get('subject'), 'Settings:AutomaticAssignment', false, $encode);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public function getModuleName(): string
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * Check if the instance is active in a given mode.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $result = !$this->isEmpty('handler');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * @return int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                    case PrivilegeUtil::MEMBER_TYPE_ROLE_AND_SUBORDINATES:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        /** @var int Status active */
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const METHOD_LOAD_BALANCE = 0;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 173 characters
    Open

        public static function getByModule(string $moduleName, int $mode = self::MODE_HANDLER | self::MODE_WORKFLOW | self::MODE_MANUAL, int $state = self::STATUS_ACTIVE): array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            foreach (self::getByModule($moduleName, $mode) as $autoAssignData) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                return $autoAssignInstance;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                if (Condition::checkConditions($conditions, $recordModel)) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            return Module::getModuleName($this->get('tabid'));
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function checkConditionForRecord(\Vtiger_Record_Model $recordModel): bool
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

            $query = $queryGeneratorUsers->createQuery(true);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public const MODE_MANUAL = 1;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * @return array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public static function getInstancesByModule(string $moduleName, int $mode = null): array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            foreach (self::getByModule($recordModel->getModuleName(), $mode) as $autoAssignData) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

         * Get auto assign instance by data.
    Severity: Minor
    Found in app/AutoAssign.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/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                    $result = !$this->isEmpty('workflow');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get an automatic selected user ID.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $owner = null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Otherwise, when multiple users have the same amount of entries
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                ->setFields(['id'])
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 201 characters
    Open

                        $condition[] = [$columnName => (new Db\Query())->select(['userid'])->from(["condition_{$type}_{$id}_" . Layout::getUniqueId() => PrivilegeUtil::getQueryToUsersByGroup((int) $id)])];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                default:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

                $owner = \array_key_exists($defaultOwner, $ownerModel->getAccessibleGroupForModule()) ? $defaultOwner : $owner;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

    Line exceeds 120 characters; contains 122 characters
    Open

            return $this->getQuery()->leftJoin($robinTable, "vtiger_users.id = {$robinTable}.user AND {$robinTable}.id={$id}")
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $queryGeneratorUsers->setGroup('id')->setCustomGroup(['temp_limit', 'count']);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $query->andHaving(['or', ['<', 'count', new \yii\db\Expression('temp_limit')], ['temp_limit' => 0], ['count' => null]]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

        public function postProcess(int $userId)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $dbCommand->update(self::ROUND_ROBIN_TABLE, ['datetime' => (new \DateTime())->format('Y-m-d H:i:s.u')], $params)->execute();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                case self::METHOD_ROUND_ROBIN:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            if ('Users' === $type) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * we need ot randomize the order in which they are returned.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->addSelect([$columnName])
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            if (0 === $recordLimit) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 128 characters
    Open

            $query->andHaving(['or', ['<', 'count', new \yii\db\Expression('temp_limit')], ['temp_limit' => 0], ['count' => null]]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            if (1 === \count($condition)) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                foreach (self::MEMBERS_TABLES as $tableName => $index) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $query = (new Db\Query())
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                $members = $queryAll->column();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

        public function getMembers(): array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            if (!$this->has('members')) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        ->select(['member' => new \yii\db\Expression('CONCAT(type,\':\', member)')])
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $queryGenerator->addNativeCondition($condition);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                if ($isExists) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $owner;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $type = $defaultOwner ? Fields\Owner::getType($defaultOwner) : null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $owner = User::isExists($defaultOwner) ? $defaultOwner : $owner;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Query object for users allowed to be assigned by load balanced method.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => new \yii\db\Expression($recordLimit)]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $queryGenerator = (new QueryGenerator('Users'))
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    $dbCommand->insert(self::ROUND_ROBIN_TABLE, $params)->execute();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $owner = $this->getQueryByRoundRobin()->scalar() ?: null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $owner = $this->getQueryByRoundRobin()->all();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return int
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $columnName = "{$robinTable}.datetime";
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $query->addSelect(['crm_data_temp_table.count']);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                switch ($type) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        $condition[] = [$columnName => PrivilegeUtil::getQueryToUsersByRole($id)];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        $condition[] = [$columnName => PrivilegeUtil::getQueryToUsersByRoleAndSubordinate($id)];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                $queryAll = null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    $owner = $this->getQueryByLoadBalance()->scalar() ?: null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            $defaultOwner = (int) $this->get('default_assign');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $id = $this->getId();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 148 characters
    Open

            $query->leftJoin(['crm_data_temp_table' => $subQuery], "crm_data_temp_table.{$ownerFieldName}={$queryGeneratorUsers->getColumnName('id')}");
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                [$type, $id] = explode(':', $member);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    case PrivilegeUtil::MEMBER_TYPE_USERS:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $condition = [$columnName => 0];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Post process action.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            if ($userId && self::METHOD_ROUND_ROBIN === (int) $this->get('method')) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $params = ['id' => $this->getId(), 'user' => $userId];
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $owner ? $owner : $this->getDefaultOwner();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $owner;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $ownerFieldName = 'assigned_user_id';
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

                ->addNativeCondition([$queryGenerator->getColumnName($ownerFieldName) => $queryGeneratorUsers->createQuery()]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $subQuery = $queryGenerator->createQuery();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $query;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $queryGenerator;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                        $queryAll = $query;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $this->get('members');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

                case self::METHOD_LOAD_BALANCE:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                case self::METHOD_ROUND_ROBIN:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            switch ($this->get('method')) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

            $queryGenerator = (new QueryGenerator($this->getModuleName()));
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 134 characters
    Open

            $conditions = Json::isEmpty($this->get('record_limit_conditions')) ? [] : Json::decode($this->get('record_limit_conditions'));
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->setCustomColumn(['count' => new \yii\db\Expression('COUNT(*)')])
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->setGroup($ownerFieldName)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                ->addCondition('auto_assign', 1, 'e');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            foreach ($this->getMembers() as $member) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        ->from($tableName)
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            switch ($this->get('method')) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        $queryAll->union($query, true);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                $this->set('members', $members);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Get automatic selected users.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

        public function getOwners(): array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

            return $this->getQuery()->leftJoin($robinTable, "vtiger_users.id = {$robinTable}.user AND {$robinTable}.id={$id}")
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $queryGenerator->setFields([$ownerFieldName])
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->addNativeCondition([$queryGenerator->getColumnName($ownerFieldName) => $queryGeneratorUsers->createQuery()]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => $queryGeneratorUsers->getColumnName('records_limit')]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            } else {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->addCondition('available', 1, 'e')
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        $condition[$type][$columnName][] = (int) $id;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    case PrivilegeUtil::MEMBER_TYPE_GROUPS:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

         * Get members.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    default:
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    } else {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                } elseif (\App\User::isExists($userId, false)) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                    $owner = null;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

        public function getQueryByLoadBalance(): Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            return $this->getQuery()->orderBy(['count' => SORT_ASC, new \yii\db\Expression('RAND()')]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * Query object for users allowed to be assigned by round robin.
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return Db\Query
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $robinTable = self::ROUND_ROBIN_TABLE;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $queryGeneratorUsers = $this->getAvailableUsersQuery();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

            $conditions = Json::isEmpty($this->get('record_limit_conditions')) ? [] : Json::decode($this->get('record_limit_conditions'));
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

    Line exceeds 120 characters; contains 122 characters
    Open

                $queryGeneratorUsers->setCustomColumn(['temp_limit' => $queryGeneratorUsers->getColumnName('records_limit')]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

         * @return QueryGenerator
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                ->addCondition('status', 'Active', 'e')
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        break;
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

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

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

         * @return array
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                        ->where(["{$tableName}.{$index}" => $this->getId()]);
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    if ($queryAll) {
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

                $isExists = (new Db\Query())->from(self::ROUND_ROBIN_TABLE)->where($params)->exists();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

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

                    $params['datetime'] = (new \DateTime())->format('Y-m-d H:i:s.u');
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

    Line exceeds 120 characters; contains 140 characters
    Open

                    $dbCommand->update(self::ROUND_ROBIN_TABLE, ['datetime' => (new \DateTime())->format('Y-m-d H:i:s.u')], $params)->execute();
    Severity: Minor
    Found in app/AutoAssign.php by phpcodesniffer

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

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

    There are no issues that match your filters.

    Category
    Status