YetiForceCompany/YetiForceCRM

View on GitHub
app/Fields/Owner.php

Summary

Maintainability
F
6 days
Test Coverage
F
48%

File Owner.php has 616 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Owner class.
 *
 * @package App
Severity: Major
Found in app/Fields/Owner.php - About 1 day to fix

    Function transferOwnershipForWorkflow has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function transferOwnershipForWorkflow($oldId, $newId)
        {
            $db = \App\Db::getInstance();
            $ownerName = static::getLabel($oldId);
            $newOwnerName = static::getLabel($newId);
    Severity: Minor
    Found in app/Fields/Owner.php - About 4 hrs 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 getUsersAndGroupForModuleList has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
        {
            $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
            if ($view) {
                $queryGenerator->initForCustomViewById($view);
    Severity: Minor
    Found in app/Fields/Owner.php - About 3 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

    class Owner
    {
        /**
         * Module name or false.
         *
    Severity: Minor
    Found in app/Fields/Owner.php by phpmd

    Owner has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Owner
    {
        /**
         * Module name or false.
         *
    Severity: Minor
    Found in app/Fields/Owner.php - About 2 hrs to fix

      Method getQueryInitUsers has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getQueryInitUsers($private = false, $status = false, $roles = false)
          {
              $entityData = \App\Module::getEntityInfo('Users');
              $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
              // Including deleted vtiger_users for now.
      Severity: Major
      Found in app/Fields/Owner.php - About 2 hrs to fix

        Function getLabel has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function getLabel($mixedId)
            {
                $multiMode = \is_array($mixedId);
                $ids = $multiMode ? $mixedId : [$mixedId];
                $missing = [];
        Severity: Minor
        Found in app/Fields/Owner.php - About 2 hrs 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 getAllocation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAllocation($mode, $private, $fieldType)
            {
                $moduleName = false;
                if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                    $moduleName = $this->moduleName;
        Severity: Minor
        Found in app/Fields/Owner.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

        Method transferOwnershipForWorkflow has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function transferOwnershipForWorkflow($oldId, $newId)
            {
                $db = \App\Db::getInstance();
                $ownerName = static::getLabel($oldId);
                $newOwnerName = static::getLabel($newId);
        Severity: Minor
        Found in app/Fields/Owner.php - About 1 hr to fix

          Function getQueryInitUsers has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getQueryInitUsers($private = false, $status = false, $roles = false)
              {
                  $entityData = \App\Module::getEntityInfo('Users');
                  $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
                  // Including deleted vtiger_users for now.
          Severity: Minor
          Found in app/Fields/Owner.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

          Method getUsersAndGroupForModuleList has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
              {
                  $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                  if ($view) {
                      $queryGenerator->initForCustomViewById($view);
          Severity: Minor
          Found in app/Fields/Owner.php - About 1 hr to fix

            Method getGroups has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getGroups($addBlank = true, $private = '')
                {
                    \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                    $moduleName = '';
                    if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
            Severity: Minor
            Found in app/Fields/Owner.php - About 1 hr to fix

              Function initUsers has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
                  {
                      $cacheKeyMod = 'private' === $private ? $this->moduleName : '';
                      $cacheKeyAss = \is_array($assignedUser) ? md5(json_encode($assignedUser)) : $assignedUser;
                      $cacheKeyRole = \is_array($roles) ? md5(json_encode($roles)) : $roles;
              Severity: Minor
              Found in app/Fields/Owner.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 getGroups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getGroups($addBlank = true, $private = '')
                  {
                      \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                      $moduleName = '';
                      if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
              Severity: Minor
              Found in app/Fields/Owner.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

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

                  public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
                  {
                      $cacheKeyMod = 'private' === $private ? $this->moduleName : '';
                      $cacheKeyAss = \is_array($assignedUser) ? md5(json_encode($assignedUser)) : $assignedUser;
                      $cacheKeyRole = \is_array($roles) ? md5(json_encode($roles)) : $roles;
              Severity: Minor
              Found in app/Fields/Owner.php - About 1 hr to fix

                Method getLabel has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function getLabel($mixedId)
                    {
                        $multiMode = \is_array($mixedId);
                        $ids = $multiMode ? $mixedId : [$mixedId];
                        $missing = [];
                Severity: Minor
                Found in app/Fields/Owner.php - About 1 hr to fix

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

                      public static function getUserLabel($id)
                      {
                          if (isset(self::$userLabelCache[$id])) {
                              return self::$userLabelCache[$id];
                          }
                  Severity: Minor
                  Found in app/Fields/Owner.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 getAccessibleGroups has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
                      {
                          $cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
                          if (!\App\Cache::has('getAccessibleGroups', $cacheKey)) {
                              $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                  Severity: Minor
                  Found in app/Fields/Owner.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

                  Method transferOwnership has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function transferOwnership($oldId, $newId)
                      {
                          $db = \App\Db::getInstance();
                          //Updating the smcreatorid,smownerid, modifiedby, smcreatorid in vtiger_crmentity
                          $db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
                  Severity: Minor
                  Found in app/Fields/Owner.php - About 1 hr to fix

                    Function getInstance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function getInstance($moduleName = false, $currentUser = false)
                        {
                            if ($currentUser && $currentUser instanceof \Users) {
                                $currentUser = \App\User::getUserModel($currentUser->id);
                            } elseif (false === $currentUser) {
                    Severity: Minor
                    Found in app/Fields/Owner.php - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Function getAccessibleUsers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getAccessibleUsers($private = '', $fieldType = false)
                        {
                            $cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
                            if (!\App\Cache::has('getAccessibleUsers', $cacheKey)) {
                                $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                    Severity: Minor
                    Found in app/Fields/Owner.php - About 55 mins to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    Method getUsers has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                    Severity: Minor
                    Found in app/Fields/Owner.php - About 45 mins to fix

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

                          public static function transferOwnership($oldId, $newId)
                          {
                              $db = \App\Db::getInstance();
                              //Updating the smcreatorid,smownerid, modifiedby, smcreatorid in vtiger_crmentity
                              $db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php - About 45 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function getUsers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                          {
                              \App\Log::trace("Entering getUsers($addBlank,$status,$private) method ...");
                      
                              $tempResult = $this->initUsers($status, $assignedUser, $private, $roles);
                      Severity: Minor
                      Found in app/Fields/Owner.php - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function getAccessibleUsersForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getAccessibleUsersForModule()
                          {
                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                                  $users = $this->getAccessibleUsers('');
                      Severity: Minor
                      Found in app/Fields/Owner.php - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function getAccessibleGroupForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getAccessibleGroupForModule()
                          {
                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                                  $groups = $this->getAccessibleGroups('');
                      Severity: Minor
                      Found in app/Fields/Owner.php - About 35 mins to fix

                      Cognitive Complexity

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

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

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

                      Further reading

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

                          public function changeFavorites(string $ownerFieldType, int $ownerId): bool
                          {
                              $userId = $this->currentUser->getId();
                              $tabId = \App\Module::getModuleId($this->moduleName);
                              $dbCommand = \App\Db::getInstance()->createCommand();
                      Severity: Minor
                      Found in app/Fields/Owner.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 getGroups() has an NPath complexity of 360. The configured NPath complexity threshold is 200.
                      Open

                          public function getGroups($addBlank = true, $private = '')
                          {
                              \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                              $moduleName = '';
                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      NPathComplexity

                      Since: 0.1

                      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                      Example

                      class Foo {
                          function bar() {
                              // lots of complicated code
                          }
                      }

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

                      The method getLabel() has an NPath complexity of 336. The configured NPath complexity threshold is 200.
                      Open

                          public static function getLabel($mixedId)
                          {
                              $multiMode = \is_array($mixedId);
                              $ids = $multiMode ? $mixedId : [$mixedId];
                              $missing = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      NPathComplexity

                      Since: 0.1

                      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                      Example

                      class Foo {
                          function bar() {
                              // lots of complicated code
                          }
                      }

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

                      The method getUsersAndGroupForModuleList() has an NPath complexity of 448. The configured NPath complexity threshold is 200.
                      Open

                          public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                          {
                              $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                              if ($view) {
                                  $queryGenerator->initForCustomViewById($view);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      NPathComplexity

                      Since: 0.1

                      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                      Example

                      class Foo {
                          function bar() {
                              // lots of complicated code
                          }
                      }

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

                      The method getGroups() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function getGroups($addBlank = true, $private = '')
                          {
                              \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                              $moduleName = '';
                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The method getUsersAndGroupForModuleList() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                          {
                              $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                              if ($view) {
                                  $queryGenerator->initForCustomViewById($view);
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The method getQueryInitUsers() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function getQueryInitUsers($private = false, $status = false, $roles = false)
                          {
                              $entityData = \App\Module::getEntityInfo('Users');
                              $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
                              // Including deleted vtiger_users for now.
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The method transferOwnershipForWorkflow() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                      Open

                          private static function transferOwnershipForWorkflow($oldId, $newId)
                          {
                              $db = \App\Db::getInstance();
                              $ownerName = static::getLabel($oldId);
                              $newOwnerName = static::getLabel($newId);
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The method getLabel() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                      Open

                          public static function getLabel($mixedId)
                          {
                              $multiMode = \is_array($mixedId);
                              $ids = $multiMode ? $mixedId : [$mixedId];
                              $missing = [];
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The method initUsers() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                      Open

                          public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
                          {
                              $cacheKeyMod = 'private' === $private ? $this->moduleName : '';
                              $cacheKeyAss = \is_array($assignedUser) ? md5(json_encode($assignedUser)) : $assignedUser;
                              $cacheKeyRole = \is_array($roles) ? md5(json_encode($roles)) : $roles;
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                      class Owner
                      {
                          /**
                           * Module name or false.
                           *
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getAccessibleUsers($private = '', $fieldType = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public static function getInstance($moduleName = false, $currentUser = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public static function getInstance($moduleName = false, $currentUser = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '277', column '18').
                      Open

                                  $query = (new \App\Db\Query())->select($selectFields)->from('vtiger_users')->where($whereSection);
                      Severity: Minor
                      Found in app/Fields/Owner.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 '799', column '22').
                      Open

                              $dataReader = (new \App\Db\Query())->select(['tabid', 'fieldname', 'tablename', 'columnname'])
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUsersAndGroupForModuleList has a boolean flag argument $conditions, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                      Severity: Minor
                      Found in app/Fields/Owner.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 '837', column '22').
                      Open

                              $dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])->from('com_vtiger_workflowtasks')
                      Severity: Minor
                      Found in app/Fields/Owner.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 getQueryInitUsers has a boolean flag argument $roles, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getQueryInitUsers($private = false, $status = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '461', column '25').
                      Open

                              $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.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 getGroups has a boolean flag argument $addBlank, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getGroups($addBlank = true, $private = '')
                      Severity: Minor
                      Found in app/Fields/Owner.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 '283', column '18').
                      Open

                                  $query = (new \App\Db\Query())->select($selectFields)->from('vtiger_users')->innerJoin('vtiger_user2role', 'vtiger_users.id = vtiger_user2role.userid');
                      Severity: Minor
                      Found in app/Fields/Owner.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 '712', column '15').
                      Open

                                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessible has a boolean flag argument $fieldType, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getAccessible($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getQueryInitUsers($private = false, $status = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '370', column '17').
                      Open

                              $query = (new \App\Db\Query())->select(['groupid', 'groupname'])->from('vtiger_groups');
                      Severity: Minor
                      Found in app/Fields/Owner.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 '715', column '14').
                      Open

                                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUsers has a boolean flag argument $addBlank, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getQueryInitUsers($private = false, $status = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '262', column '19').
                      Open

                                      ['id' => (new \App\Db\Query())
                      Severity: Minor
                      Found in app/Fields/Owner.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 '680', column '59').
                      Open

                                  \App\Cache::save('getFavoriteOwners', $cacheName, (new \App\Db\Query())->select(['ownerid', 'owner' => 'ownerid'])
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUsersAndGroupForModuleList has a boolean flag argument $view, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                          public function getAccessible($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '372', column '21').
                      Open

                                  $subQuery = (new \App\Db\Query())->select(['groupid'])->from('vtiger_group2modules')->where(['tabid' => $tabId]);
                      Severity: Minor
                      Found in app/Fields/Owner.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 initUsers has a boolean flag argument $roles, which is a certain sign of a Single Responsibility Principle violation.
                      Open

                          public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.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 '271', column '19').
                      Open

                                          'id' => (new \App\Db\Query())
                      Severity: Minor
                      Found in app/Fields/Owner.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 '290', column '17').
                      Open

                                  $query = new \App\Db\Query();
                      Severity: Minor
                      Found in app/Fields/Owner.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 '382', column '24').
                      Open

                                      $unionQuery = (new \App\Db\Query())->select(['sharedgroupid as groupid', 'vtiger_groups.groupname as groupname'])
                      Severity: Minor
                      Found in app/Fields/Owner.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\User' in method 'getInstance'.
                      Open

                                  $currentUser = \App\User::getUserModel($currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleGroups'.
                      Open

                                  $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\Vtiger_Cache' in method 'getInstance'.
                      Open

                              $instance = \Vtiger_Cache::get('App\Fields\Owner', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleGroups'.
                      Open

                              if (!\App\Cache::has('getAccessibleGroups', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\User' in method 'getInstance'.
                      Open

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

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\User' in method 'getInstance'.
                      Open

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

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\Vtiger_Cache' in method 'getInstance'.
                      Open

                                  \Vtiger_Cache::set('App\Fields\Owner', $cacheKey, $instance);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getInstance'.
                      Open

                                  $instance->showRoleName = \App\Config::module('Users', 'SHOW_ROLE_NAME');
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleGroups'.
                      Open

                                  $accessibleGroups = \App\Cache::get('getAccessibleGroups', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessibleGroups uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $accessibleGroups = $this->getGroups(false, $private);
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Language' in method 'getAccessibleGroups'.
                      Open

                                      $name = \App\Language::translate($name);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleGroups'.
                      Open

                                  \App\Cache::save('getAccessibleGroups', $cacheKey, $accessibleGroups);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\User' in method 'getInstance'.
                      Open

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

                              } else {
                                  $accessibleGroups = \App\Cache::get('getAccessibleGroups', $cacheKey);
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.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\PrivilegeUtil' in method 'getAccessibleUsers'.
                      Open

                                      $childrenRoles = \App\PrivilegeUtil::getRoleSubordinates($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.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 initUsers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $entityData = \App\Module::getEntityInfo('Users');
                                  $query = $this->getQueryInitUsers($private, $status, $roles);
                                  if (!empty($assignedUser)) {
                                      $query->andWhere(['vtiger_users.id' => $assignedUser]);
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getUsers'.
                      Open

                              \App\Log::trace('Exiting getUsers method ...');
                      Severity: Minor
                      Found in app/Fields/Owner.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\Request' in method 'getGroups'.
                      Open

                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.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_SharingAccess_Module_Model' in method 'getAccessibleUsersForModule'.
                      Open

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getUserLabel'.
                      Open

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

                                  } else {
                                      $groups = $this->getAccessibleGroups('');
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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 assigning values to variables in if clauses and the like (line '655', column '8').
                      Open

                          public static function getUserLabel($id)
                          {
                              if (isset(self::$userLabelCache[$id])) {
                                  return self::$userLabelCache[$id];
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      IfStatementAssignment

                      Since: 2.7.0

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

                      Example

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

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

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

                                  \App\Cache::save('getFavoriteOwners', $cacheName, (new \App\Db\Query())->select(['ownerid', 'owner' => 'ownerid'])
                                      ->from($tableName)
                                      ->where(['tabid' => $tabId, 'userid' => $userId])->createCommand()->queryAllByGroup());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                  $where[] = ['like', \App\Module::getSqlForNameInDisplayFormat('Users'), $this->searchValue];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                  $tabId = \App\Module::getModuleId($moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessibleUsersForModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $users = $this->getAccessibleUsers('');
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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\User' in method 'getUsersAndGroupForModuleList'.
                      Open

                                  $userModel = \App\User::getUserModel($id);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getFavorites'.
                      Open

                              return \App\Cache::get('getFavoriteOwners', $cacheName);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'transferOwnershipForWorkflow'.
                      Open

                                          $updatedTask = \App\Json::encode($fieldMapping);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleUsers'.
                      Open

                              if (!\App\Cache::has('getAccessibleUsers', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleUsers'.
                      Open

                                      $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              $tabId = \App\Module::getModuleId($this->moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleUsers'.
                      Open

                              return \App\Cache::get('getAccessibleUsers', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getGroups'.
                      Open

                              if (\App\Cache::has('OwnerGroups', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                          $roleName = \App\Language::translate($userModel->getRoleInstance()->getName());
                      Severity: Minor
                      Found in app/Fields/Owner.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 getLabel uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $result[$id] = null;
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

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

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

                                      $fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getGroups'.
                      Open

                              \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUsersAndGroupForModuleList uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $queryGenerator->setFields([$fieldName]);
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Config' in method 'getUsersAndGroupForModuleList'.
                      Open

                              $adminInList = \App\Config::performance('SHOW_ADMINISTRATORS_IN_USERS_LIST');
                      Severity: Minor
                      Found in app/Fields/Owner.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 changeFavorites uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $result = $dbCommand->insert($tableName, ['tabid' => $tabId, 'userid' => $userId, 'ownerid' => $ownerId])->execute();
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Purifier' in method 'initUsers'.
                      Open

                                          $row[$field] = \App\Purifier::encodeHtml($row[$field]);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getUsersIds'.
                      Open

                                  if (\App\Config::performance('ENABLE_CACHING_USERS')) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 transferOwnership uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                      } else {
                                          $db->createCommand()->update($row['tablename'], [$row['columnname'] => $newId], [$row['columnname'] => $oldId])
                                              ->execute();
                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.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 '\Settings_RecordAllocation_Module_Model' in method 'getAllocation'.
                      Open

                              $usersGroups = \Settings_RecordAllocation_Module_Model::getRecordAllocationByModule($fieldType, $moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'initUsers'.
                      Open

                              if (\App\Cache::has('getUsers', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              $entityData = \App\Module::getEntityInfo('Users');
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getUsers'.
                      Open

                              \App\Log::trace("Entering getUsers($addBlank,$status,$private) method ...");
                      Severity: Minor
                      Found in app/Fields/Owner.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 '\Users_Privileges_Model' in method 'getAccessibleUsersForModule'.
                      Open

                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\User' in method 'getUserLabel'.
                      Open

                                  if ($users = \App\User::getAllLabels()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                              $tabId = \App\Module::getModuleId($this->moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getType'.
                      Open

                                  $users = \App\PrivilegeFile::getUser('id');
                      Severity: Minor
                      Found in app/Fields/Owner.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 'initUsers'.
                      Open

                                  $tempResult = \App\Cache::get('getUsers', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'initUsers'.
                      Open

                                  \App\Cache::save('getUsers', $cacheKey, $tempResult);
                      Severity: Minor
                      Found in app/Fields/Owner.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 '\Users_Privileges_Model' in method 'getAccessibleGroupForModule'.
                      Open

                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessibleUsersForModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                                  if ($sharingAccessModel && $sharingAccessModel->isPrivate()) {
                                      $users = $this->getAccessibleUsers('private');
                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.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 '\Settings_Roles_Record_Model' in method 'getAccessibleUsers'.
                      Open

                                  $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getAccessibleUsers'.
                      Open

                                  \App\Cache::save('getAccessibleUsers', $cacheKey, $accessibleUser);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\User' in method 'getQueryInitUsers'.
                      Open

                                  $userPrivileges = \App\User::getPrivilegesFile($this->currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getQueryInitUsers'.
                      Open

                                  \App\Log::trace('Sharing is Public. All vtiger_users should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getGroups'.
                      Open

                              \App\Log::trace('Exiting getGroups method ...');
                      Severity: Minor
                      Found in app/Fields/Owner.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 getColor uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      static::$colorsCache = [];
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Config' in method 'getUsers'.
                      Open

                              $adminInList = \App\Config::performance('SHOW_ADMINISTRATORS_IN_USERS_LIST');
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getUsersIds'.
                      Open

                                      $rows = \App\PrivilegeFile::getUser('id');
                      Severity: Minor
                      Found in app/Fields/Owner.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 'changeFavorites'.
                      Open

                              \App\Cache::delete('getFavoriteOwners', "{$tabId}:{$userId}:{$ownerFieldType}");
                      Severity: Minor
                      Found in app/Fields/Owner.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 'transferOwnershipForWorkflow'.
                      Open

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

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

                      Avoid using static access to class '\App\PrivilegeUtil' in method 'getAccessibleUsers'.
                      Open

                                      $childrenRoles = \App\PrivilegeUtil::getRoleSubordinates($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                          $roleName = \App\Language::translate($row['rolename'], '_Base', false, true);
                      Severity: Minor
                      Found in app/Fields/Owner.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 getQueryInitUsers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  \App\Log::trace('Sharing is Public. All vtiger_users should be listed');
                                  $query = new \App\Db\Query();
                                  $query->select($selectFields)->from('vtiger_users');
                                  if ($this->showRoleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUsersIds uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $instance = new self();
                                      $rows = $instance->initUsers($status);
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAllocation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $groups = $usersGroups['groups'] ?? [];
                                  if (!empty($groups)) {
                                      $groupsAll = $this->getGroups(false, $private);
                                      foreach ($groupsAll as $ID => $name) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getGroups'.
                      Open

                                  return \App\Cache::get('OwnerGroups', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getGroups'.
                      Open

                              \App\Cache::save('OwnerGroups', $cacheKey, $tempResult);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getUserLabel'.
                      Open

                              if (\App\Config::performance('ENABLE_CACHING_USERS')) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 transferOwnershipForWorkflow uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      //For VTCreateTodoTask and VTCreateEventTask
                                      if (isset($unserializeTask->assigned_user_id)) {
                                          $value = $unserializeTask->assigned_user_id;
                                          if ($value == $oldId) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      ElseExpression

                      Since: 1.4.0

                      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                      Example

                      class Foo
                      {
                          public function bar($flag)
                          {
                              if ($flag) {
                                  // one branch
                              } else {
                                  // another branch
                              }
                          }
                      }

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

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

                                  $entityData = \App\Module::getEntityInfo('Users');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      StaticAccess

                      Since: 1.4.0

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

                      Example

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

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

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

                                              ->where(['vtiger_tmp_write_user_sharing_per.userid' => $this->currentUser->getId(), 'vtiger_tmp_write_user_sharing_per.tabid' => \App\Module::getModuleId($this->moduleName)]),
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessibleUsers uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                                  } else {
                                      $accessibleUser[$this->currentUser->getId()] = $this->currentUser->getName();
                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Request' in method 'getAllocation'.
                      Open

                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getQueryInitUsers'.
                      Open

                                  \App\Log::trace('Sharing is Private. Only the current user should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.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\Log' in method 'getGroups'.
                      Open

                              \App\Log::trace('Sharing is Public. All vtiger_users should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.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 getAccessibleGroupForModule uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                                  if ($sharingAccessModel && $sharingAccessModel->isPrivate()) {
                                      $groups = $this->getAccessibleGroups('private');
                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.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 '\Settings_SharingAccess_Module_Model' in method 'getAccessibleGroupForModule'.
                      Open

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUserLabel uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  if ($users = \App\User::getAllLabels()) {
                                      foreach ($users as $uid => &$user) {
                                          self::$userLabelCache[$uid] = $user;
                                          self::$ownerLabelCache[$uid] = $user;
                      Severity: Minor
                      Found in app/Fields/Owner.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\Purifier' in method 'initUsers'.
                      Open

                                          $row['rolename'] = \App\Purifier::encodeHtml($row['rolename']);
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getFavorites'.
                      Open

                              if (!\App\Cache::has('getFavoriteOwners', $cacheName)) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 'getType'.
                      Open

                              if (\App\Config::performance('ENABLE_CACHING_USERS')) {
                      Severity: Minor
                      Found in app/Fields/Owner.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 getType uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                      Open

                              } else {
                                  $isExists = !empty(self::getUserLabel($id));
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.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\Db' in method 'transferOwnership'.
                      Open

                              $db = \App\Db::getInstance();
                      Severity: Minor
                      Found in app/Fields/Owner.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

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

                                  $accessibleGroups = array_filter($accessibleGroups, fn ($name) => strstr(strtolower($name), $this->searchValue));
                      Severity: Critical
                      Found in app/Fields/Owner.php by phan

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public function getAccessibleUsersForModule()
                          {
                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                                  $users = $this->getAccessibleUsers('');
                      Severity: Major
                      Found in app/Fields/Owner.php and 1 other location - About 1 hr to fix
                      app/Fields/Owner.php on lines 411..425

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 119.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                          public function getAccessibleGroupForModule()
                          {
                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                                  $groups = $this->getAccessibleGroups('');
                      Severity: Major
                      Found in app/Fields/Owner.php and 1 other location - About 1 hr to fix
                      app/Fields/Owner.php on lines 434..448

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 119.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

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

                                  $classNameWithDoubleQuotes = $taskComponents[2];
                      Severity: Minor
                      Found in app/Fields/Owner.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 = false;
                      Severity: Minor
                      Found in app/Fields/Owner.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 getUserLabel($id)
                      Severity: Minor
                      Found in app/Fields/Owner.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 getGroupName($id)
                      Severity: Minor
                      Found in app/Fields/Owner.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 getType($id)
                      Severity: Minor
                      Found in app/Fields/Owner.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 getColor($id)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

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

                      ShortVariable

                      Since: 0.2

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

                      Example

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

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

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

                              $db = \App\Db::getInstance();
                      Severity: Minor
                      Found in app/Fields/Owner.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

                      The 'getType()' method which returns a boolean should be named 'is...()' or 'has...()'
                      Open

                          public static function getType($id)
                          {
                              if (isset(self::$typeCache[$id])) {
                                  return self::$typeCache[$id];
                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpmd

                      BooleanGetMethodName

                      Since: 0.2

                      Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

                      Example

                      class Foo {
                          /**
                           * @return boolean
                           */
                          public function getFoo() {} // bad
                          /**
                           * @return bool
                           */
                          public function isFoo(); // ok
                          /**
                           * @return boolean
                           */
                          public function getFoo($bar); // ok, unless checkParameterizedMethods=true
                      }

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

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

                           * @var bool|string
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                           * Show role name.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * Module name or false.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          protected $searchValue;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          protected $moduleName = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          protected $currentUser;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              } elseif (\is_object($currentUser) && 'Users_Record_Model' === \get_class($currentUser)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $instance = new self();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $instance->moduleName = $moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  \Vtiger_Cache::set('App\Fields\Owner', $cacheKey, $instance);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                      $name = \App\Language::translate($name);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $this->searchValue = strtolower($this->searchValue);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * @param string $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool   $fieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              $moduleName = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * Function to get the instance.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $currentUser = \App\User::getUserModel($currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!\App\Cache::has('getAccessibleGroups', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                           * @param string $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $usersGroups = \Settings_RecordAllocation_Module_Model::getRecordAllocationByModule($fieldType, $moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $usersGroups = $usersGroups[$this->currentUser->getId()] ?? [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $users = $usersGroups['users'] ?? [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $this->searchValue = $value;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $accessibleGroups = \App\Cache::get('getAccessibleGroups', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $accessibleUser = $this->getUsers(false, 'Active', '', '', false, array_unique($childrenRoles));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $accessibleUser[$this->currentUser->getId()] = $this->currentUser->getName();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool   $translate
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getAccessible($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                              $cacheKey = $moduleName . $currentUser->getId();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $instance;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getAccessibleGroups($private = '', $fieldType = false, $translate = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  } elseif (3 === $assignTypeValue) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $currentUser = \App\User::getCurrentUserModel();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed $translate
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                      $roles = array_merge($sameLevelRoles, $childrenRoles);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $currentUser = \App\User::getUserModel($currentUser->id);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                          public static function getInstance($moduleName = false, $currentUser = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              } elseif (is_numeric($currentUser)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $instance->currentUser = $currentUser;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                          public function find($value)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  if (!empty($fieldType) && (5 === (int) $currentUserRoleModel->get('sharedOwner' === $fieldType ? 'assignedmultiowner' : 'allowassignedrecordsto')) && 'Public' !== $private) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $accessibleGroups = array_filter($accessibleGroups, fn ($name) => strstr(strtolower($name), $this->searchValue));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Function to get all the accessible users.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * @param mixed  $fieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $sameLevelRoles = array_keys($currentUserRoleModel->getSameLevelRoles());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  if (!empty($users)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              } elseif (false === $currentUser) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  foreach ($accessibleGroups as &$name) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  } elseif (2 === $assignTypeValue) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  } elseif (!empty($fieldType) && 5 === $assignTypeValue) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  'groups' => $this->getAccessibleGroups($private, $fieldType, $translate),
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $instance = \Vtiger_Cache::get('App\Fields\Owner', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $instance->showRoleName = \App\Config::module('Users', 'SHOW_ROLE_NAME');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed $fieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $accessibleGroups = $this->getAllocation('groups', $private, $fieldType);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $assignTypeValue = (int) $currentUserRoleModel->get('sharedOwner' === $fieldType ? 'assignedmultiowner' : 'allowassignedrecordsto');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 144 characters
                      Open

                                  $assignTypeValue = (int) $currentUserRoleModel->get('sharedOwner' === $fieldType ? 'assignedmultiowner' : 'allowassignedrecordsto');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $childrenRoles = \App\PrivilegeUtil::getRoleSubordinates($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  \App\Cache::save('getAccessibleUsers', $cacheKey, $accessibleUser);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return \App\Cache::get('getAccessibleUsers', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                          public function getAllocation($mode, $private, $fieldType)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ('users' == $mode) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @var bool
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if (false === $instance) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $accessibleUser = $this->getAllocation('users', '', $fieldType);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $moduleName = $this->moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $result = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed  $currentUser
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

                      Line exceeds 120 characters; contains 186 characters
                      Open

                                  if (!empty($fieldType) && (5 === (int) $currentUserRoleModel->get('sharedOwner' === $fieldType ? 'assignedmultiowner' : 'allowassignedrecordsto')) && 'Public' !== $private) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                                      $accessibleUser[$this->currentUser->getId()] = $this->currentUser->getName();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * @param string $fieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                          public $showRoleName = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $currentUser = \App\User::getUserModel($currentUser);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Function to get all the accessible groups.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $accessibleGroups = $this->getGroups(false, $private);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  \App\Cache::save('getAccessibleGroups', $cacheKey, $accessibleGroups);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 125 characters
                      Open

                                  $accessibleGroups = array_filter($accessibleGroups, fn ($name) => strstr(strtolower($name), $this->searchValue));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!\App\Cache::has('getAccessibleUsers', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if (1 === $assignTypeValue || 'Public' === $private) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  'users' => $this->getAccessibleUsers($private, $fieldType),
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $mode
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $accessibleGroups;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getAccessibleUsers($private = '', $fieldType = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $currentUserRoleModel = \Settings_Roles_Record_Model::getInstanceById($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $accessibleUser = $this->getUsers(false, 'Active', '', 'Public', true);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              if ($translate) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $cacheKey = $private . $this->moduleName . $fieldType . $this->currentUser->getRole();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $accessibleUser = $this->getUsers(false, 'Active', '', '', false, array_unique($roles));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $childrenRoles = \App\PrivilegeUtil::getRoleSubordinates($this->currentUser->getRole());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Get accessible.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * Get allocation.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              if ($currentUser && $currentUser instanceof \Users) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!empty($this->searchValue)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                              return $result;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                                  $tempResult = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * @param mixed $roles
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 130 characters
                      Open

                              $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      ['id' => $this->currentUser->getId()],
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                              ->where(['vtiger_tmp_write_user_sharing_per.userid' => $this->currentUser->getId(), 'vtiger_tmp_write_user_sharing_per.tabid' => \App\Module::getModuleId($this->moduleName)]),
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $groups = $usersGroups['groups'] ?? [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          if (\in_array($ID, $groups)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $fullName .= " ({$roleName})";
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                          ->select(['vtiger_user2role.userid'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->innerJoin('vtiger_role', 'vtiger_user2role.roleid = vtiger_role.roleid')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                      $query->andWhere(['vtiger_users.id' => $assignedUser]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $tempResult;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Function gets sql query.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $whereSection = [
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      'or',
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Function initiates users list.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->where(['like', 'parentrole', $userPrivileges['_privileges']['parent_role_seq'] . '::%', false]),
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $cacheKeyMod = 'private' === $private ? $this->moduleName : '';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          'id' => (new \App\Db\Query())
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  if ($this->showRoleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $fullName .= ' ' . $row[$field];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->innerJoin('vtiger_role', 'vtiger_user2role.roleid = vtiger_role.roleid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  \App\Log::trace('Sharing is Private. Only the current user should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 122 characters
                      Open

                                      $query->addSelect(['rolename'])->innerJoin('vtiger_role', 'vtiger_user2role.roleid = vtiger_role.roleid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $whereSection[] = [
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!empty($this->searchValue)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $query->andWhere(array_merge(['and'], $where));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      foreach ($groupsAll as $ID => $name) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $entityData = \App\Module::getEntityInfo('Users');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

                      Line exceeds 120 characters; contains 135 characters
                      Open

                                      $query->addSelect(['vtiger_role.rolename'])->innerJoin('vtiger_user2role', 'vtiger_user2role.userid = vtiger_users.id')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 164 characters
                      Open

                                  $query = (new \App\Db\Query())->select($selectFields)->from('vtiger_users')->innerJoin('vtiger_user2role', 'vtiger_users.id = vtiger_user2role.userid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ($where) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                          public function &initUsers($status = 'Active', $assignedUser = '', $private = '', $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      foreach ($entityData['fieldnameArr'] as &$field) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $tempResult[$row['id']] = $row;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getQueryInitUsers($private = false, $status = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $entityData = \App\Module::getEntityInfo('Users');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if (\App\Cache::has('getUsers', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if (!empty($assignedUser)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $row[$field] = \App\Purifier::encodeHtml($row[$field]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed $status
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                           * @param mixed  $assignedUser
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  // Get the id and the name.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                              ->from('vtiger_tmp_write_user_sharing_per')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              } elseif (false !== $roles) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($this->showRoleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $query->select($selectFields)->from('vtiger_users');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $where[] = ['like', \App\Module::getSqlForNameInDisplayFormat('Users'), $this->searchValue];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ($status) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $result = $this->getUsers(false, 'Active', $users);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $row['rolename'] = \App\Purifier::encodeHtml($row['rolename']);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  \App\Cache::save('getUsers', $cacheKey, $tempResult);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              // Including deleted vtiger_users for now.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $query->addSelect(['vtiger_role.rolename'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool             $onlyAdmin    Show only admin users
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $cacheKeyAss = \is_array($assignedUser) ? md5(json_encode($assignedUser)) : $assignedUser;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $tempResult = \App\Cache::get('getUsers', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $query = $this->getQueryInitUsers($private, $status, $roles);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      if ($this->showRoleName && isset($row['rolename'])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $roleName = \App\Language::translate($row['rolename'], '_Base', false, true);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $where = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ('private' === $private) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $query->addSelect(['rolename'])->innerJoin('vtiger_role', 'vtiger_user2role.roleid = vtiger_role.roleid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $where[] = ['status' => $status];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $cacheKeyRole = \is_array($roles) ? md5(json_encode($roles)) : $roles;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

                      Line exceeds 120 characters; contains 199 characters
                      Open

                                              ->where(['vtiger_tmp_write_user_sharing_per.userid' => $this->currentUser->getId(), 'vtiger_tmp_write_user_sharing_per.tabid' => \App\Module::getModuleId($this->moduleName)]),
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                           * @param string|array|int $assignedUser User id
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if (!empty($groups)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 143 characters
                      Open

                              $cacheKey = $cacheKeyMod . '_' . $status . '|' . $cacheKeyAss . '_' . $private . '|' . $cacheKeyRole . '_' . (int) $this->showRoleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  while ($row = $dataReader->read()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $fullName = '';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  if ($this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                          ->innerJoin('vtiger_role', 'vtiger_user2role.roleid = vtiger_role.roleid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * @param string           $private      Sharing type
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $status
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $query = (new \App\Db\Query())->select($selectFields)->from('vtiger_users')->innerJoin('vtiger_user2role', 'vtiger_users.id = vtiger_user2role.userid');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $where[] = ['vtiger_user2role.roleid' => $roles];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param mixed  $roles
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $dataReader = $query->createCommand()->query();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $row['fullName'] = trim($fullName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                      ['id' => (new \App\Db\Query())
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $query = (new \App\Db\Query())->select($selectFields)->from('vtiger_users')->where($whereSection);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($this->showRoleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $cacheKey = $cacheKeyMod . '_' . $status . '|' . $cacheKeyAss . '_' . $private . '|' . $cacheKeyRole . '_' . (int) $this->showRoleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                          ->from('vtiger_user2role')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  \App\Log::trace('Sharing is Public. All vtiger_users should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * Function returns the user key in user array.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              \App\Log::trace("Entering getUsers($addBlank,$status,$private) method ...");
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $groupsAll = $this->getGroups(false, $private);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                              $result[$ID] = $name;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $selectFields = array_unique(array_merge($entityData['fieldnameArr'], ['id' => 'id', 'is_admin', 'cal_color', 'status']));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $userPrivileges = \App\User::getPrivilegesFile($this->currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                              ->select(['vtiger_tmp_write_user_sharing_per.shareduserid'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $query->addSelect(['vtiger_role.rolename'])->innerJoin('vtiger_user2role', 'vtiger_user2role.userid = vtiger_users.id')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->innerJoin('vtiger_user2role', 'vtiger_user2role.userid = vtiger_users.id')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool             $addBlank
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool             $roles
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 138 characters
                      Open

                          public function getUsers($addBlank = false, $status = 'Active', $assignedUser = '', $private = '', $onlyAdmin = false, $roles = false)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  // Add in a blank row
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $moduleName = $this->moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 125 characters
                      Open

                                  $subQuery = (new \App\Db\Query())->select(['groupid'])->from('vtiger_group2modules')->where(['tabid' => $tabId]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->andWhere(['vtiger_tmp_write_group_sharing_per.tabid' => $tabId]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                           * Function returns list of accessible users for a module.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getAccessibleGroupForModule()
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              $adminInList = \App\Config::performance('SHOW_ADMINISTRATORS_IN_USERS_LIST');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  return \App\Cache::get('OwnerGroups', $cacheKey);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              // Including deleted vtiger_users for now.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ($moduleName && 'CustomView' !== $moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->from('vtiger_tmp_write_group_sharing_per')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $query->union($unionQuery);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $query->orderBy(['groupname' => SORT_ASC]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $users = $this->getAccessibleUsers('private');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $tempResult = $this->initUsers($status, $assignedUser, $private, $roles);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                           * Function to get groups.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

                      Line exceeds 120 characters; contains 131 characters
                      Open

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($sharingAccessModel && $sharingAccessModel->isPrivate()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * Get users and group for module list.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getUsersAndGroupForModuleList($view = false, $conditions = false, $fieldName = 'assigned_user_id')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if (true === $addBlank) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              asort($users);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($this->currentUser->getGroups()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              \App\Cache::save('OwnerGroups', $cacheKey, $tempResult);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $users = $this->getAccessibleUsers('');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      foreach ($conditions['join'] as $join) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 129 characters
                      Open

                                      $unionQuery = (new \App\Db\Query())->select(['sharedgroupid as groupid', 'vtiger_groups.groupname as groupname'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              return $groups;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $users[$key] = $row['fullName'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                          public function getGroups($addBlank = true, $private = '')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $cacheKey = $addBlank . $private . $moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $query->andWhere(['groupid' => $this->currentUser->getId()]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $query->orWhere(['vtiger_groups.groupid' => $this->currentUser->getGroups()]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($moduleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                              $users = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $private
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $moduleName = '';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $users[''] = '';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 131 characters
                      Open

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $queryGenerator->clearFields();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              \App\Log::trace('Exiting getGroups method ...');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $tempResult;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              $users = $groups = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $queryField = $queryGenerator->getQueryRelatedField($fieldName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $isAdmin = $this->currentUser->isAdmin();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool   $addBlank
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $tabId = \App\Module::getModuleId($moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 124 characters
                      Open

                                          ->innerJoin('vtiger_groups', 'vtiger_tmp_write_group_sharing_per.sharedgroupid = vtiger_groups.groupid')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          ->where(['vtiger_tmp_write_group_sharing_per.userid' => $this->currentUser->getId()])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $groups = $this->getAccessibleGroups('');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $curentUserPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ($conditions) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              \App\Log::trace('Exiting getUsers method ...');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $users;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $tempResult[$row['groupid']] = $row['groupname'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $sharingAccessModel = $this->moduleName ? \Settings_SharingAccess_Module_Model::getInstance($this->moduleName) : false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($sharingAccessModel && $sharingAccessModel->isPrivate()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                          public function getAccessibleUsersForModule()
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $queryGenerator = new \App\QueryGenerator($this->moduleName, $this->currentUser->getId());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ($view) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                          $queryGenerator->addJoin($join);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!\is_array($tempResult)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  if (!$onlyAdmin || $isAdmin || !(!$adminInList && 'on' == $row['is_admin'])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $unionQuery = (new \App\Db\Query())->select(['sharedgroupid as groupid', 'vtiger_groups.groupname as groupname'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $queryGenerator->addNativeCondition($conditions['condition']);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if (!empty($conditions['join'])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (\App\Cache::has('OwnerGroups', $cacheKey)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $subQuery = (new \App\Db\Query())->select(['groupid'])->from('vtiger_group2modules')->where(['tabid' => $tabId]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $query->where(['groupid' => $subQuery]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  // Add in a blank row
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                           * Function returns list of accessible users for a module.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param string $module
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool       $view
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * @param bool|array $conditions
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              while ($row = $dataReader->read()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if ($this->currentUser->isAdmin() || $curentUserPrivileges->hasGlobalWritePermission()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $groups = $this->getAccessibleGroups('');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              \App\Log::trace('Sharing is Public. All vtiger_users should be listed');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $query = (new \App\Db\Query())->select(['groupid', 'groupname'])->from('vtiger_groups');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if ('private' === $private) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $dataReader = $query->createCommand()->query();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $tempResult[''] = '';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  $queryGenerator->initForCustomViewById($view);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              if (false !== strpos($fieldName, ':')) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              foreach ($tempResult as $key => $row) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                          ->innerJoin('vtiger_groups', 'vtiger_tmp_write_group_sharing_per.sharedgroupid = vtiger_groups.groupid')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $tempResult = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (true === $addBlank) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $groups = $this->getAccessibleGroups('private');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $users = $this->getAccessibleUsers('');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              return $users;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $queryGenerator->setFields([])->setCustomColumn($queryField->getColumnName())->addRelatedJoin($queryField->getRelated());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $queryGenerator->setFields([$fieldName]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return ['users' => $users, 'group' => $groups];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              $ids = $multiMode ? $mixedId : [$mixedId];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($id && !isset(self::$ownerLabelCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  foreach ($missing as $userId) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  if ($diffIds) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $label = $groups[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  self::$groupIdCache[$label] = $id;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                           * The function gets the user label.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              foreach ($ids as $id) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $rows = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return self::$usersIdsCache[$status];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (isset(self::$groupLabelCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $label = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

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

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

                          public static function getAllUsers($status = 'Active')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                          self::getGroupName($groupId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $groups = $instance->getGroups(false);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  $id = self::$groupIdCache[$name] = $groups[$name];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  $userModel = \App\User::getUserModel($id);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                  foreach (array_values($diffIds) as $id) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                                      $instance = new self();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                              if (isset($groups[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (isset($groups[$name])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 133 characters
                      Open

                                  $queryGenerator->setFields([])->setCustomColumn($queryField->getColumnName())->addRelatedJoin($queryField->getRelated());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              $adminInList = \App\Config::performance('SHOW_ADMINISTRATORS_IN_USERS_LIST');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              $diffIds = array_diff($ids, array_keys($users));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                           * The function retrieves all users with active status.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              return $instance->initUsers($status);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                              if (!isset(self::$usersIdsCache[$status])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                      $rows = $instance->initUsers($status);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

                                  self::$groupLabelCache[$id] = self::$ownerLabelCache[$id] = $label;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                                  if (!empty($name) && ($adminInList || (!$adminInList && !$userModel->isAdmin()))) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

                              foreach ($ids as $id) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

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

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

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

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

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

                          public static function getGroupName($id)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $instance = new self();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Function gets labels.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              foreach ($ids as $id) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * The function gets the group names.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $label;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getGroupId($name)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $id = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $instance = new self();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $groupIdCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Function to get the group id for a given group groupname.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      if (!empty($name)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $diffIds = array_diff($missing, array_keys(self::$ownerLabelCache));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $result[$id] = null;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset(self::$groupIdCache[$name])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $users[$id] = $name;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.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/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $rows = \App\PrivilegeFile::getUser('id');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $missing = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $missing[] = $id;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!empty($missing)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      foreach ($diffIds as $groupId) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return string
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $ids = $queryGenerator->createQuery()->distinct()->column();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $name = $userModel->getName();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $users[$id] .= " ({$roleName})";
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return string
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return array
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $ownerLabelCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $userLabelCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $multiMode = \is_array($mixedId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $id;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $name = self::getGroupName($id);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $groupLabelCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $result = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $instance = new self();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $groups[$id] = $name;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $usersIdsCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getUsersIds($status = 'Active')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      self::getUserLabel($userId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param string $name
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      if ($this->showRoleName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param array|int $mixedId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return array|int
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getLabel($mixedId)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int $id
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return self::$groupIdCache[$name];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if ($diffIds) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * The function retrieves user ids with active status.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param string $status
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $multiMode ? $result : array_shift($result);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $groups = array_flip($instance->getGroups(false));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $roleName = \App\Language::translate($userModel->getRoleInstance()->getName());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param string $status
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  self::$usersIdsCache[$status] = array_keys($rows);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (isset(self::$ownerLabelCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $result[$id] = self::$ownerLabelCache[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return self::$groupLabelCache[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      self::$ownerLabelCache[$uid] = $user['fullName'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!static::$colorsCache) {
                      Severity: Minor
                      Found in app/Fields/Owner.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/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return self::$userLabelCache[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $tableName = 'sharedOwner' === $ownerFieldType ? 'u_#__favorite_shared_owners' : 'u_#__favorite_owners';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $userId = $this->currentUser->getId();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $result = $dbCommand->delete($tableName, ['tabid' => $tabId, 'userid' => $userId, 'ownerid' => $ownerId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      static::$colorsCache = require ROOT_DIRECTORY . '/app_data/owners_colors.php';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      static::$colorsCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return self::$typeCache[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Transfer ownership records.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $userLabel = isset($users[$id]) ? $users[$id]['fullName'] : false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $userLabel = $users[$id] ?? false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  case 'Groups':
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      break;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $result;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 149 characters
                      Open

                              $db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if ($users = \App\User::getAllLabels()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      break;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              \App\Cache::delete('getFavoriteOwners', "{$tabId}:{$userId}:{$ownerFieldType}");
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Get owner color.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int $id
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset(static::$colorsCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return bool
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return bool|string
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $tabId = \App\Module::getModuleId($this->moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $dbCommand = \App\Db::getInstance()->createCommand();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset($this->getFavorites($ownerFieldType)[$ownerId])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $typeCache = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db = \App\Db::getInstance();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              //Updating the smcreatorid,smownerid, modifiedby, smcreatorid in vtiger_crmentity
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      foreach ($users as $uid => &$user) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  \App\Cache::save('getFavoriteOwners', $cacheName, (new \App\Db\Query())->select(['ownerid', 'owner' => 'ownerid'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      ->where(['tabid' => $tabId, 'userid' => $userId])->createCommand()->queryAllByGroup());
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return \App\Cache::get('getFavoriteOwners', $cacheName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              switch (self::getType($ownerId)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $ownerList = $this->getAccessibleUsers('', $ownerFieldType);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $ownerList = $this->getAccessibleGroups('', $ownerFieldType);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  default:
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $result = $dbCommand->insert($tableName, ['tabid' => $tabId, 'userid' => $userId, 'ownerid' => $ownerId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          protected static $colorsCache = false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return '#' . substr($hash, 0, 2) . substr($hash, 2, 2) . substr($hash, 4, 2);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Function checks record type.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $result = $isExists ? 'Users' : 'Groups';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $cacheName = "{$tabId}:{$userId}:{$ownerFieldType}";
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!isset($ownerList[$ownerId])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 129 characters
                      Open

                                  $result = $dbCommand->insert($tableName, ['tabid' => $tabId, 'userid' => $userId, 'ownerid' => $ownerId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param string $ownerFieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return (bool) $result;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $isExists = !empty(self::getUserLabel($id));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int $newId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          self::$userLabelCache[$uid] = $user;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public function getFavorites(string $ownerFieldType): array
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (!\App\Cache::has('getFavoriteOwners', $cacheName)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getUserLabel($id)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int    $ownerId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset(self::$userLabelCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public function changeFavorites(string $ownerFieldType, int $ownerId): bool
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 129 characters
                      Open

                                  $result = $dbCommand->delete($tableName, ['tabid' => $tabId, 'userid' => $userId, 'ownerid' => $ownerId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $tableName = 'sharedOwner' === $ownerFieldType ? 'u_#__favorite_shared_owners' : 'u_#__favorite_owners';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $hash = md5('color' . $id);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int $id
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param int $oldId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function transferOwnership($oldId, $newId)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      self::$userLabelCache[$uid] = $user['fullName'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @throws \App\Exceptions\NoPermitted
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param bool $single
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  case 'Users':
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $userLabel = false;
                      Severity: Minor
                      Found in app/Fields/Owner.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/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param string $ownerFieldType
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $users = \App\PrivilegeFile::getUser('id');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (file_exists(ROOT_DIRECTORY . '/app_data/owners_colors.php')) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  return static::$colorsCache[$id];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return array
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              if (isset(self::$typeCache[$id])) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              self::$typeCache[$id] = $result;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $users = \App\PrivilegeFile::getUser('id');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 126 characters
                      Open

                                  \App\Cache::save('getFavoriteOwners', $cacheName, (new \App\Db\Query())->select(['ownerid', 'owner' => 'ownerid'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @throws \yii\db\Exception
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return bool
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @var bool|string Owners color
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  foreach ($users as $uid => $user) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          self::$ownerLabelCache[$uid] = $user;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $userId = $this->currentUser->getId();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Change favorite owner state.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getColor($id)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $isExists = isset($users[$id]);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              return $userLabel ?? false;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Gets favorite owners.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      ->from($tableName)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $tabId = \App\Module::getModuleId($this->moduleName);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED');
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @return string
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          public static function getType($id)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db->createCommand()->update('vtiger_crmentity', ['smcreatorid' => $newId], ['smcreatorid' => $oldId, 'setype' => 'ModComments'])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->from('vtiger_field')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $taskComponents = explode(':', $task);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                      $condition['value'] = $newOwnerName;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $column = $row['tablename'] . '.' . $row['columnname'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              ->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $unserializeTask = unserialize($task);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $serializeTask = serialize($unserializeTask);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $dataReader = (new \App\Db\Query())->select(['tabid', 'fieldname', 'tablename', 'columnname'])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $value = $unserializeTask->assigned_user_id;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db->createCommand()->update('vtiger_crmentity', ['modifiedby' => $newId], ['modifiedby' => $oldId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db->createCommand()->update('vtiger_import_maps', ['date_modified' => date('Y-m-d H:i:s'), 'assigned_user_id' => $newId], ['assigned_user_id' => $oldId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 131 characters
                      Open

                                          $db->createCommand()->update($row['tablename'], [$row['columnname'] => $newId], [$row['columnname'] => $oldId])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              self::transferOwnershipForWorkflow($oldId, $newId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $ownerName = static::getLabel($oldId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $className = str_replace('"', '', $classNameWithDoubleQuotes);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                      $condition['value'] = $newId;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      if (isset($unserializeTask->assigned_user_id)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $newOwnerName = static::getLabel($newId);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              while ($row = $dataReader->read()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          foreach ($fieldMapping as $key => $condition) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                  } elseif ($value == $ownerName) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              $fieldMapping[$key] = $condition;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              //update workflow tasks Assigned User from Deleted User to Transfer User
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $fieldSearchValue = 's:16:"assigned_user_id"';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])->from('com_vtiger_workflowtasks')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $fieldMapping = \App\Json::decode($unserializeTask->field_value_mapping);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                  $value = $condition['value'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 186 characters
                      Open

                                          $db->createCommand()->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              $unserializeTask->assigned_user_id = $newId;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db->createCommand()->delete('vtiger_users2group', ['userid' => $oldId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 173 characters
                      Open

                                          $db->createCommand()->update($row['tablename'], [$row['columnname'] => $newId], ['and', [$row['columnname'] => $oldId], ['<>', 'setype', 'ModComments']])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      if (!empty($fieldMapping)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      //For VTCreateTodoTask and VTCreateEventTask
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 174 characters
                      Open

                              $db->createCommand()->update('vtiger_import_maps', ['date_modified' => date('Y-m-d H:i:s'), 'assigned_user_id' => $newId], ['assigned_user_id' => $oldId])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->leftJoin('vtiger_fieldmodulerel', 'vtiger_field.fieldid = vtiger_fieldmodulerel.fieldid')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->createCommand()->query();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $columnList = [];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      if ('smcreatorid' === $row['columnname'] || 'smownerid' === $row['columnname']) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              //updating the vtiger_import_maps
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      $columnList[] = $column;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $db->createCommand()->update($row['tablename'], [$row['columnname'] => $newId], [$row['columnname'] => $oldId])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                  }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $updatedTask = \App\Json::encode($fieldMapping);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $db->createCommand()->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          if ($value == $oldId) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db->createCommand()->update('vtiger_crmentity', ['smownerid' => $newId], ['smownerid' => $oldId, 'setype' => 'ModComments'])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          /**
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param type $oldId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           */
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          private static function transferOwnershipForWorkflow($oldId, $newId)
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $db = \App\Db::getInstance();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $idSearchValue = '"fieldname":"assigned_user_id","value":"' . $oldId . '"';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              if ('assigned_user_id' == $condition['fieldname']) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (!\in_array($column, $columnList)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $db->createCommand()->update($row['tablename'], [$row['columnname'] => $newId], ['and', [$row['columnname'] => $oldId], ['<>', 'setype', 'ModComments']])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->createCommand()->query();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $classNameWithDoubleQuotes = $taskComponents[2];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $unserializeTask->field_value_mapping = $updatedTask;
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->where(['or', ['uitype' => [52, 53, 77, 101]], ['uitype' => 10, 'relmodule' => 'Users']])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              while ($row = $dataReader->read()) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                              ->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $db->createCommand()->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 186 characters
                      Open

                                          $db->createCommand()->update('com_vtiger_workflowtasks', ['task' => $serializeTask], ['workflow_id' => $row['workflow_id'], 'task_id' => $row['task_id']])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           *
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * @param type $newId
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 121 characters
                      Open

                              $dataReader = (new \App\Db\Query())->select(['task', 'task_id', 'workflow_id'])->from('com_vtiger_workflowtasks')
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              require_once 'modules/com_vtiger_workflow/VTTaskManager.php';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  require_once 'modules/com_vtiger_workflow/tasks/' . $className . '.php';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                          }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                      } else {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                           * Transfer ownership workflow tasks.
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  $task = $row['task'];
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  if (isset($unserializeTask->field_value_mapping)) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                                  if (is_numeric($value) && $value == $oldId) {
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Line exceeds 120 characters; contains 145 characters
                      Open

                              $db->createCommand()->update('vtiger_crmentity', ['smownerid' => $newId], ['smownerid' => $oldId, 'setype' => 'ModComments'])->execute();
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                  ->where(['or like', 'task', [$nameSearchValue, $idSearchValue, $fieldSearchValue]])
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                                          $serializeTask = serialize($unserializeTask);
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              $nameSearchValue = '"fieldname":"assigned_user_id","value":"' . $ownerName . '"';
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Spaces must be used to indent lines; tabs are not allowed
                      Open

                              }
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      Space before opening parenthesis of function call prohibited
                      Open

                                  $accessibleGroups = array_filter($accessibleGroups, fn ($name) => strstr(strtolower($name), $this->searchValue));
                      Severity: Minor
                      Found in app/Fields/Owner.php by phpcodesniffer

                      The variable $ID is not named in camelCase.
                      Open

                          public function getAllocation($mode, $private, $fieldType)
                          {
                              $moduleName = false;
                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                                  $moduleName = $this->moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.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 $ID is not named in camelCase.
                      Open

                          public function getAllocation($mode, $private, $fieldType)
                          {
                              $moduleName = false;
                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                                  $moduleName = $this->moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.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 $ID is not named in camelCase.
                      Open

                          public function getAllocation($mode, $private, $fieldType)
                          {
                              $moduleName = false;
                              if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
                                  $moduleName = $this->moduleName;
                      Severity: Minor
                      Found in app/Fields/Owner.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