YetiForceCompany/YetiForceCRM

View on GitHub
app/User.php

Summary

Maintainability
D
1 day
Test Coverage
C
71%

User has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

class User
{
    protected static $currentUserId;
    protected static $currentUserRealId = false;
    protected static $currentUserCache = false;
Severity: Minor
Found in app/User.php - About 4 hrs to fix

    File User.php has 329 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App;
    
    /**
    Severity: Minor
    Found in app/User.php - About 3 hrs to fix

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

      class User
      {
          protected static $currentUserId;
          protected static $currentUserRealId = false;
          protected static $currentUserCache = false;
      Severity: Minor
      Found in app/User.php by phpmd

      Method getPrivilegesFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getPrivilegesFile($userId): array
          {
              if (isset(static::$userPrivilegesCache[$userId])) {
                  return self::$userPrivilegesCache[$userId];
              }
      Severity: Minor
      Found in app/User.php - About 1 hr to fix

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

            public static function isExists(int $id, bool $active = true): bool
            {
                $cacheKey = $active ? 'UserIsExists' : 'UserIsExistsInactive';
                if (Cache::has($cacheKey, $id)) {
                    return Cache::get($cacheKey, $id);
        Severity: Minor
        Found in app/User.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            public static function getActiveAdminId()
            {
                $key = '';
                $cacheName = 'ActiveAdminId';
                if (Cache::has($cacheName, $key)) {
        Severity: Minor
        Found in app/User.php - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Consider simplifying this complex logical expression.
        Open

                    if (($active && isset($users[$id]) && 'Active' == $users[$id]['status'] && !$users[$id]['deleted']) || (!$active && isset($users[$id]))) {
                        $isExists = true;
                    }
        Severity: Major
        Found in app/User.php - About 40 mins to fix

          Function updateLabels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function updateLabels(int $fromUserId = 0): void
              {
                  $timeLimit = 180;
                  $timeMax = $timeLimit + time();
                  $query = (new \App\Db\Query())->select(['id'])->where(['>=', 'id', $fromUserId])->from('vtiger_users');
          Severity: Minor
          Found in app/User.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 method isExists() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
          Open

              public static function isExists(int $id, bool $active = true): bool
              {
                  $cacheKey = $active ? 'UserIsExists' : 'UserIsExistsInactive';
                  if (Cache::has($cacheKey, $id)) {
                      return Cache::get($cacheKey, $id);
          Severity: Minor
          Found in app/User.php by phpmd

          CyclomaticComplexity

          Since: 0.1

          Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

          Example

          // Cyclomatic Complexity = 11
          class Foo {
          1   public function example() {
          2       if ($a == $b) {
          3           if ($a1 == $b1) {
                          fiddle();
          4           } elseif ($a2 == $b2) {
                          fiddle();
                      } else {
                          fiddle();
                      }
          5       } elseif ($c == $d) {
          6           while ($c == $d) {
                          fiddle();
                      }
          7        } elseif ($e == $f) {
          8           for ($n = 0; $n < $h; $n++) {
                          fiddle();
                      }
                  } else {
                      switch ($z) {
          9               case 1:
                              fiddle();
                              break;
          10              case 2:
                              fiddle();
                              break;
          11              case 3:
                              fiddle();
                              break;
                          default:
                              fiddle();
                              break;
                      }
                  }
              }
          }

          Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

          Avoid using undefined variables such as '$user_info' which will lead to PHP notices.
          Open

                  $valueMap['user_info'] = $user_info;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$current_user_parent_role_seq' which will lead to PHP notices.
          Open

                      $valueMap['parent_role_seq'] = $current_user_parent_role_seq;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$parent_roles' which will lead to PHP notices.
          Open

                      $valueMap['parent_roles'] = $parent_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$current_user_groups' which will lead to PHP notices.
          Open

                      $valueMap['groups'] = $current_user_groups;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$member' which will lead to PHP notices.
          Open

                  $member[] = \App\PrivilegeUtil::MEMBER_TYPE_USERS . ":{$this->getId()}";
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$current_user_profiles' which will lead to PHP notices.
          Open

                      $valueMap['profiles'] = $current_user_profiles;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$subordinate_roles' which will lead to PHP notices.
          Open

                      $valueMap['subordinate_roles'] = $subordinate_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$member' which will lead to PHP notices.
          Open

                      $member[] = \App\PrivilegeUtil::MEMBER_TYPE_ROLE_AND_SUBORDINATES . ":{$role}";
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$current_user_roles' which will lead to PHP notices.
          Open

                      $valueMap['roleid'] = $current_user_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$member' which will lead to PHP notices.
          Open

                      $member[] = \App\PrivilegeUtil::MEMBER_TYPE_GROUPS . ":{$groupId}";
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$subordinate_roles_users' which will lead to PHP notices.
          Open

                      $valueMap['subordinate_roles_users'] = $subordinate_roles_users;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$member' which will lead to PHP notices.
          Open

                  return $member;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$is_admin' which will lead to PHP notices.
          Open

                  $valueMap['is_admin'] = (bool) $is_admin;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$profileActionPermission' which will lead to PHP notices.
          Open

                      $valueMap['profile_action_permission'] = $profileActionPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$is_admin' which will lead to PHP notices.
          Open

                  if (!$is_admin) {
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$profileGlobalPermission' which will lead to PHP notices.
          Open

                      $valueMap['profile_global_permission'] = $profileGlobalPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$profileTabsPermission' which will lead to PHP notices.
          Open

                      $valueMap['profile_tabs_permission'] = $profileTabsPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

          Avoid using undefined variables such as '$member' which will lead to PHP notices.
          Open

                  $member[] = \App\PrivilegeUtil::MEMBER_TYPE_ROLES . ":{$this->getRole()}";
          Severity: Minor
          Found in app/User.php by phpmd

          UndefinedVariable

          Since: 2.8.0

          Detects when a variable is used that has not been defined before.

          Example

          class Foo
          {
              private function bar()
              {
                  // $message is undefined
                  echo $message;
              }
          }

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

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

          class User
          {
              protected static $currentUserId;
              protected static $currentUserRealId = false;
              protected static $currentUserCache = false;
          Severity: Minor
          Found in app/User.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 '602', column '15').
          Open

                  return (new \App\Db\Query())->from('l_#__userpass_history')->where(['user_id' => $userId, 'pass' => Encryption::createHash($password)])->exists(\App\Db::getInstance('log'));
          Severity: Minor
          Found in app/User.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 clearCache has a boolean flag argument $userId, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function clearCache($userId = false)
          Severity: Minor
          Found in app/User.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 '403', column '26').
          Open

                      $isExistsQuery = (new \App\Db\Query())->from('vtiger_users')->where(['id' => $id]);
          Severity: Minor
          Found in app/User.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 isExists has a boolean flag argument $active, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public static function isExists(int $id, bool $active = true): bool
          Severity: Minor
          Found in app/User.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 '572', column '10').
          Open

                          (new \App\BatchMethod(['method' => __METHOD__, 'params' => [$row['id'], microtime()]]))->save();
          Severity: Minor
          Found in app/User.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 '589', column '15').
          Open

                  return (new \App\Db\Query())->from('u_#__users_labels')->select(['id', 'label'])->createCommand()->queryAllByGroup();
          Severity: Minor
          Found in app/User.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 '45', column '14').
          Open

                      throw new \App\Exceptions\AppException('User not exists: ' . $userId);
          Severity: Minor
          Found in app/User.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 '568', column '17').
          Open

                  $query = (new \App\Db\Query())->select(['id'])->where(['>=', 'id', $fromUserId])->from('vtiger_users');
          Severity: Minor
          Found in app/User.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\Session' in method 'getCurrentUserModel'.
          Open

                      static::$currentUserId = (int) \App\Session::get('authenticated_user_id');
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  if (Cache::has('UserImageById', $this->getId())) {
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  if (Cache::has($cacheKey, $id)) {
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  Cache::save('NumberOfUsers', '', $count, Cache::LONG);
          Severity: Minor
          Found in app/User.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 'getImage'.
          Open

                  $image = Json::decode($this->getDetail('imagename'));
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  Cache::save('UserImageById', $this->getId(), $imageData);
          Severity: Minor
          Found in app/User.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\Session' in method 'getCurrentUserRealId'.
          Open

                  if (\App\Session::has('baseUserId') && \App\Session::get('baseUserId')) {
          Severity: Minor
          Found in app/User.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 '\Settings_Roles_Record_Model' in method 'getRoleInstance'.
          Open

                  return $this->privileges['roleInstance'] = \Settings_Roles_Record_Model::getInstanceById($this->getRole());
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get('UserImageById', $this->getId());
          Severity: Minor
          Found in app/User.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 getCurrentUserRealId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $id = static::getCurrentUserId();
                  }
          Severity: Minor
          Found in app/User.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

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

                  } else {
                      $isExistsQuery = (new \App\Db\Query())->from('vtiger_users')->where(['id' => $id]);
                      if ($active) {
                          $isExistsQuery->andWhere(['status' => 'Active', 'deleted' => 0]);
                      }
          Severity: Minor
          Found in app/User.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\Cache' in method 'getImageById'.
          Open

                  if (Cache::has('UserImageById', $userId)) {
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  if (Cache::has('NumberOfUsers', '')) {
          Severity: Minor
          Found in app/User.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\Session' in method 'getCurrentUserRealId'.
          Open

                  if (\App\Session::has('baseUserId') && \App\Session::get('baseUserId')) {
          Severity: Minor
          Found in app/User.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 getActiveAdminId uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $adminId = (new Db\Query())->select(['id'])
                          ->from('vtiger_users')
                          ->where(['is_admin' => 'on', 'status' => 'Active'])
                          ->orderBy(['id' => SORT_ASC])
          Severity: Minor
          Found in app/User.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\Cache' in method 'getActiveAdminId'.
          Open

                  Cache::save($cacheName, $key, $adminId, Cache::LONG);
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get('UserIdByName', $name);
          Severity: Minor
          Found in app/User.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 getImage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      $imageData = [];
                  }
          Severity: Minor
          Found in app/User.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 '\Users_Record_Model' in method 'updateLabels'.
          Open

                          $userRecordModel = \Users_Record_Model::getInstanceById($row['id'], 'Users');
          Severity: Minor
          Found in app/User.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\Config' in method 'isExists'.
          Open

                  if (\App\Config::performance('ENABLE_CACHING_USERS')) {
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  Cache::save($cacheKey, $id, $isExists);
          Severity: Minor
          Found in app/User.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 'getUserIdByFullName'.
          Open

                  $instance = \App\Fields\Owner::getInstance();
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get($cacheKey, $id);
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

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

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  return Cache::save('UserIdByName', $name, false !== $userId ? $userId : null, Cache::LONG);
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get('UserImageById', $userId);
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  if (Cache::has('UserIdByName', $name)) {
          Severity: Minor
          Found in app/User.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\Config' in method 'getActiveAdminId'.
          Open

                  if (\App\Config::performance('ENABLE_CACHING_USERS')) {
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

              public function getImage()
              {
                  if (Cache::has('UserImageById', $this->getId())) {
                      return Cache::get('UserImageById', $this->getId());
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          IfStatementAssignment

          Since: 2.7.0

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

          Example

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

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

          Avoid using static access to class '\App\Session' in method 'getCurrentUserRealId'.
          Open

                      $id = \App\Session::get('baseUserId');
          Severity: Minor
          Found in app/User.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 clearCache uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                  } else {
                      self::$userPrivilegesCache = self::$userSharingCache = static::$userModelCache = [];
                      static::$currentUserCache = false;
                  }
          Severity: Minor
          Found in app/User.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\PrivilegeFile' in method 'isExists'.
          Open

                      $users = PrivilegeFile::getUser('id');
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get('NumberOfUsers', '');
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                      return Cache::get($cacheName, $key);
          Severity: Minor
          Found in app/User.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\PrivilegeFile' in method 'getActiveAdminId'.
          Open

                      $users = PrivilegeFile::getUser('id');
          Severity: Minor
          Found in app/User.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\Encryption' in method 'checkPreviousPassword'.
          Open

                  return (new \App\Db\Query())->from('l_#__userpass_history')->where(['user_id' => $userId, 'pass' => Encryption::createHash($password)])->exists(\App\Db::getInstance('log'));
          Severity: Minor
          Found in app/User.php by phpmd

          StaticAccess

          Since: 1.4.0

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

          Example

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

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

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

                  return (new \App\Db\Query())->from('l_#__userpass_history')->where(['user_id' => $userId, 'pass' => Encryption::createHash($password)])->exists(\App\Db::getInstance('log'));
          Severity: Minor
          Found in app/User.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 unused local variables such as '$subordinate_roles_users'.
          Open

                      $valueMap['subordinate_roles_users'] = $subordinate_roles_users;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$parent_roles'.
          Open

                      $valueMap['parent_roles'] = $parent_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$user_info'.
          Open

                  $valueMap['user_info'] = $user_info;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$current_user_profiles'.
          Open

                      $valueMap['profiles'] = $current_user_profiles;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$subordinate_roles'.
          Open

                      $valueMap['subordinate_roles'] = $subordinate_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$current_user_parent_role_seq'.
          Open

                      $valueMap['parent_role_seq'] = $current_user_parent_role_seq;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$current_user_groups'.
          Open

                      $valueMap['groups'] = $current_user_groups;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$profileTabsPermission'.
          Open

                      $valueMap['profile_tabs_permission'] = $profileTabsPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$current_user_roles'.
          Open

                      $valueMap['roleid'] = $current_user_roles;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$profileGlobalPermission'.
          Open

                      $valueMap['profile_global_permission'] = $profileGlobalPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          Avoid unused local variables such as '$profileActionPermission'.
          Open

                      $valueMap['profile_action_permission'] = $profileActionPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          UnusedLocalVariable

          Since: 0.2

          Detects when a local variable is declared and/or assigned, but not used.

          Example

          class Foo {
              public function doSomething()
              {
                  $i = 5; // Unused
              }
          }

          Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

          syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'
          Open

                  return array_filter(\App\Fields\Owner::getInstance('CustomView')->getGroups(false), fn ($key) => \in_array($key, $this->getGroups()), ARRAY_FILTER_USE_KEY);
          Severity: Critical
          Found in app/User.php by phan

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

                      $valueMap['profile_global_permission'] = $profileGlobalPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $valueMap['parent_role_seq'] = $current_user_parent_role_seq;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $valueMap['profile_action_permission'] = $profileActionPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $valueMap['profile_tabs_permission'] = $profileTabsPermission;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $valueMap['subordinate_roles_users'] = $subordinate_roles_users;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $valueMap['profiles'] = $current_user_profiles;
          Severity: Minor
          Found in app/User.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

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

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

                      $id = \App\Session::get('baseUserId');
          Severity: Minor
          Found in app/User.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 isExists(int $id, bool $active = true): bool
          Severity: Minor
          Found in app/User.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

              protected static $userPrivilegesCache = [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get current user model.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (static::$currentUserCache) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  $userModel = new self();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Set current user Id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (!static::$currentUserId) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * @return \self
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              protected static $currentUserId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Get real current user Id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (\App\Session::has('baseUserId') && \App\Session::get('baseUserId')) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      return static::$userModelCache[$userId];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  $privileges = require "user_privileges/user_privileges_{$userId}.php";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $valueMap['user_info'] = $user_info;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              protected static $currentUserCache = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

              protected static $userSharingCache = [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get current user Id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              public static function getCurrentUserRealId()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

               * Get base privileges from file by id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                      $id = \App\Session::get('baseUserId');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  static::$currentUserRealId = $id;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Get user model by id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      static::$userModelCache[$userId] = $userModel;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  if (static::$currentUserRealId) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      static::$currentUserId = (int) \App\Session::get('authenticated_user_id');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  if (isset(static::$userPrivilegesCache[$userId])) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      return [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function getCurrentUserId()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (!self::isExists($userId, false)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              protected $privileges = [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  return $id;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * @return \self
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function getCurrentUserModel()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (!file_exists("user_privileges/user_privileges_{$userId}.php")) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              protected static $userModelCache = [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  return static::$currentUserId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function setCurrentUserId($userId)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  } else {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      return static::$currentUserCache;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function &getUserModel($userId)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (isset(static::$userModelCache[$userId])) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return static::$currentUserCache = static::getUserModel(static::$currentUserId);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $valueMap['id'] = $userId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['defaultOrgSharingPermission'] = $sharingPrivileges['defOrgShare'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

          Line exceeds 120 characters; contains 123 characters
          Open

                      unset(self::$userPrivilegesCache[$userId], self::$userSharingCache[$userId], static::$userModelCache[$userId]);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  return $this->privileges['details'] ?? null;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  return $userModel;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      return self::$userPrivilegesCache[$userId];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['profile_global_permission'] = $profileGlobalPermission;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                      return null;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

              public function getRoleInstance()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              protected static $currentUserRealId = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $userModel->privileges = static::getPrivilegesFile($userId)['_privileges'] ?? [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      $valueMap['profile_tabs_permission'] = $profileTabsPermission;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['subordinate_roles'] = $subordinate_roles;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  return $this->privileges['details']['record_id'] ?? null;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

               * Get user role instance.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      throw new \App\Exceptions\AppException('User not exists: ' . $userId);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  static::$currentUserId = $userId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  static::$currentUserCache = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      return static::$currentUserRealId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $id = static::getCurrentUserId();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              public static function getPrivilegesFile($userId): array
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['profile_action_permission'] = $profileActionPermission;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['groups'] = $current_user_groups;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  self::$userPrivilegesCache[$userId] = $valueMap;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Get user id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

              public function getGroupNames()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user role Id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  $valueMap['is_admin'] = (bool) $is_admin;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get sharing privileges from file by id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  self::$userSharingCache[$userId] = $sharingPrivileges;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Get user groups.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  if (!$is_admin) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      unset(self::$userPrivilegesCache[$userId], self::$userSharingCache[$userId], static::$userModelCache[$userId]);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

               * Get user detail.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      static::$currentUserCache = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  return $this->privileges['details'][$fieldName] ?? null;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getDetails()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                  return $this->privileges['roleName'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  return $this->privileges['groups'] ?? [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user group names.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  return $this;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Function checks if user is active.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                      $users = PrivilegeFile::getUser('id');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                          if ('Active' === $user['status'] && 'on' === $user['is_admin']) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['profiles'] = $current_user_profiles;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  return $this->privileges['displayName'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

          Line exceeds 120 characters; contains 164 characters
          Open

                  return array_filter(\App\Fields\Owner::getInstance('CustomView')->getGroups(false), fn ($key) => \in_array($key, $this->getGroups()), ARRAY_FILTER_USE_KEY);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $this->privileges[$key];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function isActive()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                              $adminId = $id;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['subordinate_roles_users'] = $subordinate_roles_users;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['roleid'] = $current_user_roles;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                      return self::$userSharingCache[$userId];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

               * Get user profiles.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

               * @return mixed
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return \array_key_exists($key, $this->privileges);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user all details.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getParentRolesSeq()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  $isExists = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Function to check whether the user is an super user.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public function get($key)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Check for existence of key.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  Cache::save($cacheName, $key, $adminId, Cache::LONG);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  } else {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  } else {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user parent roles seq.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Set user parameters.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                      foreach ($users as $id => $user) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $adminId = (new Db\Query())->select(['id'])
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

               * @return bool true/false
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public function isSuperUser(): bool
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

          Line exceeds 120 characters; contains 150 characters
          Open

                      if (($active && isset($users[$id]) && 'Active' == $users[$id]['status'] && !$users[$id]['deleted']) || (!$active && isset($users[$id]))) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      $valueMap['related_module_share'] = $sharingPrivileges['relatedModuleShare'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $adminId = 1;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      if (static::$currentUserId === $userId) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      self::$userPrivilegesCache = self::$userSharingCache = static::$userModelCache = [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getName()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * @return mixed
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  if (!empty($this->privileges['roleInstance'])) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  return $this->privileges['parent_role_seq'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return !empty($this->privileges['details']['is_admin']);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  if (Cache::has($cacheKey, $id)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * @return mixed
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $key = '';
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $cacheName = 'ActiveAdminId';
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $this->privileges[$key] = $value;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  $cacheKey = $active ? 'UserIsExists' : 'UserIsExistsInactive';
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (\App\Config::performance('ENABLE_CACHING_USERS')) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $isExists;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                      return Cache::get($cacheName, $key);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (\App\Config::performance('ENABLE_CACHING_USERS')) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $valueMap['_privileges'] = $privileges;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['parent_roles'] = $parent_roles;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Clear user cache.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function getSharingFile($userId)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user role Id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * @return \Settings_Roles_Record_Model
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                      return $this->privileges['roleInstance'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Function to check whether the user is an Admin user.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                      $isExistsQuery = (new \App\Db\Query())->from('vtiger_users')->where(['id' => $id]);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              public static function getActiveAdminId()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $users = PrivilegeFile::getUser('id');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                          ->from('vtiger_users')
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                          ->where(['is_admin' => 'on', 'status' => 'Active'])
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return $adminId;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return !empty($this->privileges['details']['super_user']);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  Cache::save($cacheKey, $id, $isExists);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Function to get the user if of the active admin user.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                          ->scalar();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public static function clearCache($userId = false)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $sharingPrivileges;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

               * @return mixed
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return 'Active' === ($this->privileges['details']['status'] ?? null);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                          $isExists = true;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

               * Get user parent roles.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

              public function isAdmin()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

              public static function isExists(int $id, bool $active = true): bool
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      if (($active && isset($users[$id]) && 'Active' == $users[$id]['status'] && !$users[$id]['deleted']) || (!$active && isset($users[$id]))) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                          $isExistsQuery->andWhere(['status' => 'Active', 'deleted' => 0]);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * @return int - Active Admin User ID
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                          ->orderBy(['id' => SORT_ASC])
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $valueMap['parent_role_seq'] = $current_user_parent_role_seq;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      $sharingPrivileges = static::getSharingFile($userId);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (isset(self::$userSharingCache[$userId])) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

               * Get user parameters.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Function checks if user exists.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      return Cache::get($cacheKey, $id);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  if (Cache::has($cacheName, $key)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $valueMap;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                          static::$currentUserCache = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  } else {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                  if (!file_exists("user_privileges/sharing_privileges_{$userId}.php")) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  $sharingPrivileges = require "user_privileges/sharing_privileges_{$userId}.php";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get user id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getDetail($fieldName)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public function getProfiles()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $this->privileges['profiles'] ?? null;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                  return array_filter(\App\Fields\Owner::getInstance('CustomView')->getGroups(false), fn ($key) => \in_array($key, $this->getGroups()), ARRAY_FILTER_USE_KEY);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $this->privileges['details']['roleid'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getParentRoles()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

              public function has(string $key): bool
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * @param mixed  $value
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

               * Function gets user ID by name.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                  return $this->privileges['roleInstance'] = \Settings_Roles_Record_Model::getInstanceById($this->getRole());
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return $this->privileges['parent_roles'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public function set(string $key, $value)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

                      $isExists = $isExistsQuery->exists();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              public static function getUserIdByName($name): ?int
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return $users[$fullName] ?? 0;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * @return array|string[]
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  Cache::save('UserImageById', $this->getId(), $imageData);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

          Line exceeds 120 characters; contains 181 characters
          Open

                  return (new \App\Db\Query())->from('l_#__userpass_history')->where(['user_id' => $userId, 'pass' => Encryption::createHash($password)])->exists(\App\Db::getInstance('log'));
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Gets member structure.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (empty($userModel)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

               * Get number of users.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                      if (time() >= $timeMax) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public static function getAllLabels()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

              public function getImage()
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                      return Cache::get('UserImageById', $userId);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

              public static function getNumberOfUsers(): int
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                  $image = Json::decode($this->getDetail('imagename'));
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  $userModel = static::getUserModel($userId);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

              public static function updateLabels(int $fromUserId = 0): void
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

                          (new \App\BatchMethod(['method' => __METHOD__, 'params' => [$row['id'], microtime()]]))->save();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Line exceeds 120 characters; contains 125 characters
          Open

                  return (new \App\Db\Query())->from('u_#__users_labels')->select(['id', 'label'])->createCommand()->queryAllByGroup();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

               * Function gets user ID by user full name.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  if (empty($image) || !($imageData = current($image))) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  return $userModel->getImage();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  Cache::save('NumberOfUsers', '', $count, Cache::LONG);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

                  $timeLimit = 180;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

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

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

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

                  $users = array_column($instance->initUsers(), 'id', 'fullName');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

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

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

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

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

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $instance = \App\Fields\Owner::getInstance();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  foreach ($this->getGroups() as $groupId) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @throws \App\Exceptions\AppException
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      return [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $imageData['path'] = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . $imageData['path'];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $member[] = \App\PrivilegeUtil::MEMBER_TYPE_USERS . ":{$this->getId()}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              public static function getImageById(int $userId)
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               */
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      return Cache::get('NumberOfUsers', '');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                          $userRecordModel = \Users_Record_Model::getInstanceById($row['id'], 'Users');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @param int    $userId
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               */
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return Cache::save('UserIdByName', $name, false !== $userId ? $userId : null, Cache::LONG);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  if (Cache::has('UserImageById', $this->getId())) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  if (file_exists($imageData['path'])) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      $imageData['url'] = "file.php?module=Users&action=MultiImage&field=imagename&record={$this->getId()}&key={$imageData['key']}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      return [];
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $query = (new \App\Db\Query())->select(['id'])->where(['>=', 'id', $fromUserId])->from('vtiger_users');
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              public static function checkPreviousPassword(int $userId, string $password): bool
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return (new \App\Db\Query())->from('l_#__userpass_history')->where(['user_id' => $userId, 'pass' => Encryption::createHash($password)])->exists(\App\Db::getInstance('log'));
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @param string $name
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @return int
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * Get user image details.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      return Cache::get('UserImageById', $this->getId());
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  foreach (explode('::', $this->getParentRolesSeq()) as $role) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               */
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               */
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @throws \App\Exceptions\AppException
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $member[] = \App\PrivilegeUtil::MEMBER_TYPE_ROLES . ":{$this->getRole()}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @return array|string[]
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  if (Cache::has('NumberOfUsers', '')) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * Update users labels.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $dataReader = $query->createCommand()->query();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      if (self::isExists($row['id'], false)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                          $userRecordModel->updateLabel();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @return int
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return (new \App\Db\Query())->from('u_#__users_labels')->select(['id', 'label'])->createCommand()->queryAllByGroup();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  } else {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      $member[] = \App\PrivilegeUtil::MEMBER_TYPE_GROUPS . ":{$groupId}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @param int $userId
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  if (Cache::has('UserImageById', $userId)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $count = (new Db\Query())->from('vtiger_users')->where(['status' => 'Active'])->count();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return $count;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               */
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @return bool
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $userId = (new Db\Query())->select(['id'])->from('vtiger_users')->where(['user_name' => $name])->scalar();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $instance->showRoleName = false;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return $imageData;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  return $member;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * Get user image details by id.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  $timeMax = $timeLimit + time();
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                          break;
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * The function gets the all users label.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @return bool|array
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * Check the previous password.
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               * @param string $password
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  if (Cache::has('UserIdByName', $name)) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      return Cache::get('UserIdByName', $name);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              public static function getUserIdByFullName(string $fullName): int
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Line exceeds 120 characters; contains 138 characters
          Open

                      $imageData['url'] = "file.php?module=Users&action=MultiImage&field=imagename&record={$this->getId()}&key={$imageData['key']}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                      $member[] = \App\PrivilegeUtil::MEMBER_TYPE_ROLE_AND_SUBORDINATES . ":{$role}";
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  }
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              /**
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

               *
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

                  while ($row = $dataReader->read()) {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Spaces must be used to indent lines; tabs are not allowed
          Open

              {
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          Space before opening parenthesis of function call prohibited
          Open

                  return array_filter(\App\Fields\Owner::getInstance('CustomView')->getGroups(false), fn ($key) => \in_array($key, $this->getGroups()), ARRAY_FILTER_USE_KEY);
          Severity: Minor
          Found in app/User.php by phpcodesniffer

          The variable $is_admin is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $is_admin is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $parent_roles is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $subordinate_roles_users is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $current_user_profiles is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $current_user_parent_role_seq is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $user_info is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $current_user_roles is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $subordinate_roles is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          The variable $current_user_groups is not named in camelCase.
          Open

              public static function getPrivilegesFile($userId): array
              {
                  if (isset(static::$userPrivilegesCache[$userId])) {
                      return self::$userPrivilegesCache[$userId];
                  }
          Severity: Minor
          Found in app/User.php by phpmd

          CamelCaseVariableName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name variables.

          Example

          class ClassName {
              public function doSomething() {
                  $data_module = new DataModule();
              }
          }

          Source

          There are no issues that match your filters.

          Category
          Status