YetiForceCompany/YetiForceCRM

View on GitHub
app/Privilege.php

Summary

Maintainability
F
1 wk
Test Coverage
F
9%

Function checkPermission has a Cognitive Complexity of 131 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
    {
        \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
        if (!$userId) {
            $userId = \App\User::getCurrentUserId();
Severity: Minor
Found in app/Privilege.php - About 2 days to fix

Cognitive Complexity

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

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

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

Further reading

Function isReadPermittedBySharing has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
    {
        \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
        $sharingPrivileges = \App\User::getSharingFile($userId);

Severity: Minor
Found in app/Privilege.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Function isReadWritePermittedBySharing has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
    {
        \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
        $sharingPrivileges = \App\User::getSharingFile($userId);
        if (!isset($sharingPrivileges['permission'][$moduleName])) {
Severity: Minor
Found in app/Privilege.php - About 1 day to fix

Cognitive Complexity

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

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

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

Further reading

Method checkPermission has 259 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
    {
        \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
        if (!$userId) {
            $userId = \App\User::getCurrentUserId();
Severity: Major
Found in app/Privilege.php - About 1 day to fix

    File Privilege.php has 459 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

      class Privilege
      {
          public static $isPermittedLevel;
      
          /**
      Severity: Minor
      Found in app/Privilege.php by phpmd

      Method isReadPermittedBySharing has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
          {
              \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
              $sharingPrivileges = \App\User::getSharingFile($userId);
      
      
      Severity: Major
      Found in app/Privilege.php - About 2 hrs to fix

        Method isReadWritePermittedBySharing has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
            {
                \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                $sharingPrivileges = \App\User::getSharingFile($userId);
                if (!isset($sharingPrivileges['permission'][$moduleName])) {
        Severity: Major
        Found in app/Privilege.php - About 2 hrs to fix

          Function isPermittedBySharing has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
              {
                  $sharingPrivileges = \App\User::getSharingFile($userId);
                  //Retreiving the default Organisation sharing Access
                  $othersPermissionId = $sharingPrivileges['defOrgShare'][$tabId];
          Severity: Minor
          Found in app/Privilege.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

          Avoid deeply nested control flow statements.
          Open

                                          if (\App\Config::security('PERMITTED_BY_SHARING')) {
                                              $relatedPermission = static::isPermittedBySharing($recordMetaData['setype'], Module::getModuleId($recordMetaData['setype']), $actionId, $parentRecord, $userId);
                                          }
          Severity: Major
          Found in app/Privilege.php - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

                        if (((3 == $actionId || 4 == $actionId) && 0 != $role->get('previewrelatedrecord')) || ((0 == $actionId || 1 == $actionId) && 0 != $role->get('editrelatedrecord'))) {
                            $parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
                            if ($parentRecord && Record::isExists($parentRecord)) {
                                $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($parentRecord);
                                $permissionsRoleForRelatedField = $role->get('permissionsrelatedfield');
            Severity: Major
            Found in app/Privilege.php - About 40 mins to fix

              Method isPermittedBySharing has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
              Severity: Minor
              Found in app/Privilege.php - About 35 mins to fix

                Method isReadPermittedBySharing has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                Severity: Minor
                Found in app/Privilege.php - About 35 mins to fix

                  Method isReadWritePermittedBySharing has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                  Severity: Minor
                  Found in app/Privilege.php - About 35 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return false;
                    Severity: Major
                    Found in app/Privilege.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return true;
                      Severity: Major
                      Found in app/Privilege.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                                return true;
                        Severity: Major
                        Found in app/Privilege.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                                      return true;
                          Severity: Major
                          Found in app/Privilege.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return 2 !== $actionId;
                            Severity: Major
                            Found in app/Privilege.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return false;
                              Severity: Major
                              Found in app/Privilege.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                            return false;
                                Severity: Major
                                Found in app/Privilege.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return false;
                                  Severity: Major
                                  Found in app/Privilege.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                return $isPermittedPrivateRecord;
                                    Severity: Major
                                    Found in app/Privilege.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              return $permission;
                                      Severity: Major
                                      Found in app/Privilege.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return false;
                                        Severity: Major
                                        Found in app/Privilege.php - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return false;
                                          Severity: Major
                                          Found in app/Privilege.php - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                        return true;
                                            Severity: Major
                                            Found in app/Privilege.php - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                                  return false;
                                              Severity: Major
                                              Found in app/Privilege.php - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                                                    return true;
                                                Severity: Major
                                                Found in app/Privilege.php - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                              return true;
                                                  Severity: Major
                                                  Found in app/Privilege.php - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                                    return true;
                                                    Severity: Major
                                                    Found in app/Privilege.php - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                              return false;
                                                      Severity: Major
                                                      Found in app/Privilege.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                                        return true;
                                                        Severity: Major
                                                        Found in app/Privilege.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                      return true;
                                                          Severity: Major
                                                          Found in app/Privilege.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                                                return true;
                                                            Severity: Major
                                                            Found in app/Privilege.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return $permission;
                                                              Severity: Major
                                                              Found in app/Privilege.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                return true;
                                                                Severity: Major
                                                                Found in app/Privilege.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                              return true;
                                                                  Severity: Major
                                                                  Found in app/Privilege.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                return false;
                                                                    Severity: Major
                                                                    Found in app/Privilege.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                      return true;
                                                                      Severity: Major
                                                                      Found in app/Privilege.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                                            return true;
                                                                        Severity: Major
                                                                        Found in app/Privilege.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                              return false;
                                                                          Severity: Major
                                                                          Found in app/Privilege.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                                                return true;
                                                                            Severity: Major
                                                                            Found in app/Privilege.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                              return true;
                                                                              Severity: Major
                                                                              Found in app/Privilege.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                return static::isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId);
                                                                                Severity: Major
                                                                                Found in app/Privilege.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                                  return true;
                                                                                  Severity: Major
                                                                                  Found in app/Privilege.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                    return true;
                                                                                    Severity: Major
                                                                                    Found in app/Privilege.php - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                              return true;
                                                                                      Severity: Major
                                                                                      Found in app/Privilege.php - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                    return true;
                                                                                        Severity: Major
                                                                                        Found in app/Privilege.php - About 30 mins to fix

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                          return static::isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId);
                                                                                          Severity: Major
                                                                                          Found in app/Privilege.php - About 30 mins to fix

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                        return true;
                                                                                            Severity: Major
                                                                                            Found in app/Privilege.php - About 30 mins to fix

                                                                                              The method isReadPermittedBySharing() has an NPath complexity of 1144. The configured NPath complexity threshold is 200.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 checkPermission() has 277 lines of code. Current threshold is set to 100. Avoid really long methods.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                                      if (!$userId) {
                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              The method checkPermission() has an NPath complexity of 12695305125888000. The configured NPath complexity threshold is 200.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                                      if (!$userId) {
                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isReadWritePermittedBySharing() has an NPath complexity of 648. The configured NPath complexity threshold is 200.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isPermittedBySharing() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                                                                                              Open

                                                                                                  public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      //Retreiving the default Organisation sharing Access
                                                                                                      $othersPermissionId = $sharingPrivileges['defOrgShare'][$tabId];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 checkPermission() has a Cyclomatic Complexity of 104. The configured cyclomatic complexity threshold is 10.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                                      if (!$userId) {
                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isReadPermittedBySharing() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isReadWritePermittedBySharing() has a Cyclomatic Complexity of 21. The configured cyclomatic complexity threshold is 10.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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

                                                                                              Refactor this function to reduce its Cognitive Complexity from 150 to the 15 allowed.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                                                                              See

                                                                                              This function "checkPermission" has 276 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              A function that grows too large tends to aggregate too many responsibilities.

                                                                                              Such functions inevitably become harder to understand and therefore harder to maintain.

                                                                                              Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

                                                                                              Those smaller functions will not only be easier to understand, but also probably easier to test.

                                                                                              Reduce the number of returns of this function 8, down to the maximum allowed 3.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

                                                                                              function myFunction(){ // Noncompliant as there are 4 return statements
                                                                                                if (condition1) {
                                                                                                  return true;
                                                                                                } else {
                                                                                                  if (condition2) {
                                                                                                    return false;
                                                                                                  } else {
                                                                                                    return true;
                                                                                                  }
                                                                                                }
                                                                                                return false;
                                                                                              }
                                                                                              

                                                                                              Refactor this function to reduce its Cognitive Complexity from 69 to the 15 allowed.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                                                                              See

                                                                                              Reduce the number of returns of this function 8, down to the maximum allowed 3.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

                                                                                              function myFunction(){ // Noncompliant as there are 4 return statements
                                                                                                if (condition1) {
                                                                                                  return true;
                                                                                                } else {
                                                                                                  if (condition2) {
                                                                                                    return false;
                                                                                                  } else {
                                                                                                    return true;
                                                                                                  }
                                                                                                }
                                                                                                return false;
                                                                                              }
                                                                                              

                                                                                              Refactor this function to reduce its Cognitive Complexity from 69 to the 15 allowed.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

                                                                                              See

                                                                                              Reduce the number of returns of this function 8, down to the maximum allowed 3.
                                                                                              Open

                                                                                                  public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

                                                                                              function myFunction(){ // Noncompliant as there are 4 return statements
                                                                                                if (condition1) {
                                                                                                  return true;
                                                                                                } else {
                                                                                                  if (condition2) {
                                                                                                    return false;
                                                                                                  } else {
                                                                                                    return true;
                                                                                                  }
                                                                                                }
                                                                                                return false;
                                                                                              }
                                                                                              

                                                                                              Reduce the number of returns of this function 29, down to the maximum allowed 3.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php by sonar-php

                                                                                              Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

                                                                                              function myFunction(){ // Noncompliant as there are 4 return statements
                                                                                                if (condition1) {
                                                                                                  return true;
                                                                                                } else {
                                                                                                  if (condition2) {
                                                                                                    return false;
                                                                                                  } else {
                                                                                                    return true;
                                                                                                  }
                                                                                                }
                                                                                                return false;
                                                                                              }
                                                                                              

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

                                                                                              class Privilege
                                                                                              {
                                                                                                  public static $isPermittedLevel;
                                                                                              
                                                                                                  /**
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 checkPermission has a boolean flag argument $record, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isPermitted has a boolean flag argument $record, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function isPermitted($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isPermitted has a boolean flag argument $userId, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function isPermitted($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 checkPermission has a boolean flag argument $userId, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 setUpdater has a boolean flag argument $priority, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 setUpdater has a boolean flag argument $record, which is a certain sign of a Single Responsibility Principle violation.
                                                                                              Open

                                                                                                  public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 checkPermission uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                                              Open

                                                                                                          } else {
                                                                                                              $permission = false;
                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_ACTION_TOOL');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (\App\Config::security('PERMITTED_BY_SHARED_OWNERS')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 '\vtlib\Functions' in method 'checkPermission'.
                                                                                              Open

                                                                                                                  $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($parentRecord);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      $userPrivileges = \App\User::getPrivilegesFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_EDIT_ALL_PERMISSION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class 'App\Fields\SharedOwner' in method 'checkPermission'.
                                                                                              Open

                                                                                                          $shownerids = Fields\SharedOwner::getById($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class 'App\Fields\SharedOwner' in method 'checkPermission'.
                                                                                              Open

                                                                                                                              $relatedPermission = \in_array($userId, Fields\SharedOwner::getById($parentRecord));
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class 'App\Fields\Owner' in method 'checkPermission'.
                                                                                              Open

                                                                                                      $recOwnType = Fields\Owner::getType($recOwnId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

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

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                                      if (!$userId) {
                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\Log' in method 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . ($permission) ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_IS_OWNEDBY');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          $userPrivilegesModel = \Users_Privileges_Model::getInstanceById($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_HIERARCHY_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      $actionId = Module::getActionId($actionName);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_VIEW_ALL_PERMISSION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\Field' in method 'checkPermission'.
                                                                                              Open

                                                                                                          && ($fieldInfo = \App\Field::getFieldInfo('private', $recordMetaData['setype'])) && \in_array($fieldInfo['presence'], [0, 2])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_SHARED_OWNER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                      \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_SUBORDINATE_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_RIGHTS_TO_ACTION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 '\vtlib\Functions' in method 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class '\App\Fields\Owner' in method 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

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

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                                      if (!$userId) {
                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\Log' in method 'checkPermission'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (($modules = \App\Config::security('permittedModulesByCreatorField')) && \in_array($moduleName, $modules) && $userId === $recordMetaData['smcreatorid']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_ACTION_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_GROUP');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (1 === Module::getModuleOwner($tabId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          if (\App\Config::security('PERMITTED_BY_ROLES')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                              if (\App\Config::security('PERMITTED_BY_SHARING')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_USER_IS_ADMIN');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          if (!$isPermittedPrivateRecord && \App\Config::security('PERMITTED_BY_SHARED_OWNERS')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class 'App\Fields\SharedOwner' in method 'checkPermission'.
                                                                                              Open

                                                                                                              $shownerIds = Fields\SharedOwner::getById($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (\App\Config::security('PERMITTED_BY_ADVANCED_PERMISSION')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isPermittedBySharing'.
                                                                                              Open

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (!Module::isModuleActive($moduleName)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_WRITE_ACCESS');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                                  $relatedPermission = static::isPermittedBySharing($recordMetaData['setype'], Module::getModuleId($recordMetaData['setype']), $actionId, $parentRecord, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (\App\Config::security('PERMITTED_BY_SHARING')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_PERMISSIONS_NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_RIGHTS_TO_ACTION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 '\vtlib\Functions' in method 'checkPermission'.
                                                                                              Open

                                                                                                              $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class '\App\Fields\Owner' in method 'checkPermission'.
                                                                                              Open

                                                                                                          $recOwnType = \App\Fields\Owner::getType($recOwnId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\PrivilegeAdvanced' in method 'checkPermission'.
                                                                                              Open

                                                                                                          $prvAdv = PrivilegeAdvanced::checkPermissions($record, $moduleName, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_YES');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              $parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      $tabId = Module::getModuleId($moduleName);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if ('Settings' !== Request::_get('parent')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ID_IS_NULL');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 '\vtlib\Functions' in method 'checkPermission'.
                                                                                              Open

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (\App\Config::security('PERMITTED_BY_PRIVATE_FIELD') && $recordMetaData['private']
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          if (\App\Config::security('permittedWriteAccessByCreatorField') && (0 == $actionId || 1 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                      if (\App\Config::security('PERMITTED_BY_RECORD_HIERARCHY')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\Record' in method 'checkPermission'.
                                                                                              Open

                                                                                                              if ($parentRecord && Record::isExists($parentRecord)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isReadPermittedBySharing uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                                              Open

                                                                                                      } else {
                                                                                                          if (isset($read['GROUP'][$ownerId])) {
                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              
                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          if ('Users' === $moduleName && $record == \App\User::getCurrentUserId()) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_READ_ACCESS');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'checkPermission'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

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

                                                                                                                      } else {
                                                                                                                          if (isset($writeRelated['GROUP'][$relOwnerId])) {
                                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              
                                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                              $parRecordOwner = PrivilegeUtil::getParentRecordOwner($tabId, $parModId, $recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\PrivilegeUpdater' in method 'setAllUpdater'.
                                                                                              Open

                                                                                                      PrivilegeUpdater::setAllUpdater();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 '\vtlib\Functions' in method 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

                                                                                              Avoid using static access to class '\App\Fields\Owner' in method 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 isReadPermittedBySharing uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                                                                              Open

                                                                                                                      } else {
                                                                                                                          if (isset($readRelated['GROUP'][$relOwnerId])) {
                                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              
                                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                              $parRecordOwner = PrivilegeUtil::getParentRecordOwner($tabId, $parModId, $recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadWritePermittedBySharing'.
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 'isReadPermittedBySharing'.
                                                                                              Open

                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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\PrivilegeUpdater' in method 'setUpdater'.
                                                                                              Open

                                                                                                      PrivilegeUpdater::setUpdater($moduleName, $record, $priority, $type);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              StaticAccess

                                                                                              Since: 1.4.0

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

                                                                                              Example

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

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

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

                                                                                                          } elseif ('Groups' === $recOwnType) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          foreach ($read['GROUP'] as $userids) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          if (isset($userPrivileges['profile_tabs_permission'][$tabId]) && 0 == $userPrivileges['profile_tabs_permission'][$tabId]) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          if ('Users' === $moduleName && $record == \App\User::getCurrentUserId()) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "Exiting isReadPermittedBySharing method ..." 7 times.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "Exiting isPermitted method ... - " 4 times.
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . ($permission) ? 'YES' : 'NO');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "groups" 5 times.
                                                                                              Open

                                                                                                              if (\in_array($recOwnId, $userPrivileges['groups'])) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "relatedModuleShare" 5 times.
                                                                                              Open

                                                                                                      if (isset($sharingPrivileges['relatedModuleShare'][$tabId])) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          && ($fieldInfo = \App\Field::getFieldInfo('private', $recordMetaData['setype'])) && \in_array($fieldInfo['presence'], [0, 2])) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                      if ((0 == $userPrivileges['profile_global_permission'][1] || 0 == $userPrivileges['profile_global_permission'][2]) && (3 == $actionId || 4 == $actionId)) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "profile_action_permission" 5 times.
                                                                                              Open

                                                                                                      if (!isset($userPrivileges['profile_action_permission'][$tabId][$actionId])) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          $recOwnId = $recordMetaData['smownerid'];
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

                                                                                              Define a constant instead of duplicating this literal "Exiting isReadWritePermittedBySharing method ..." 7 times.
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                              if (0 !== $recordMetaData['deleted'] && (1 === $actionId || 0 === $actionId || 17 === $actionId)) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by sonar-php

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

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

                                                                                              Noncompliant Code Example

                                                                                              With the default threshold of 3:

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

                                                                                              Compliant Solution

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

                                                                                              Exceptions

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

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

                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                          if ('Users' === $moduleName && $record == \App\User::getCurrentUserId()) {
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_ACTION_DOES_NOT_EXIST');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_ACTION_TOOL');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_RIGHTS_TO_ACTION');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Default value for int $record can't be false
                                                                                              Open

                                                                                                  public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Expected @param annotation for tabId to be before the @param annotation for actionId
                                                                                              Open

                                                                                                   * @param $actionId   -- Action Id:: Type integer
                                                                                              Severity: Info
                                                                                              Found in app/Privilege.php by phan

                                                                                              Default value for int $priority can't be false
                                                                                              Open

                                                                                                  public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_RIGHTS_TO_ACTION');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_READ_ACCESS');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                          $recOwnType = \App\Fields\Owner::getType($recOwnId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Argument 4 (actionid) is 0|1|3|4 but \Users_Privileges_Model::getParentRecord() takes \type|false defined at /code/modules/Users/models/Privileges.php:289
                                                                                              Open

                                                                                                              $parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Suspicious type false|true of a variable or expression used to build a string. (Expected type to be able to cast to a string)
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . ($permission) ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . ($permission) ? 'YES' : 'NO');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $recOwnType = Fields\Owner::getType($recOwnId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Expected @param annotation for tabId to be before the @param annotation for actionId
                                                                                              Open

                                                                                                   * @param $actionId   -- Action Id:: Type integer
                                                                                              Severity: Info
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_VIEW_ALL_PERMISSION');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Saw misspelled annotation @returns. Did you mean @return?
                                                                                              Open

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Info
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_PERMISSIONS_NO');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_YES');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_GROUP');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_EDIT_ALL_PERMISSION');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_NO');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_USER');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Saw misspelled annotation @returns. Did you mean @return?
                                                                                              Open

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Info
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ID_IS_NULL');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_WRITE_ACCESS');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_USER_IS_ADMIN');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_HIERARCHY_USER');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $userPrivileges = \App\User::getPrivilegesFile($userId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_SHARED_OWNER');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                      \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_SUBORDINATE_USER');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Saw an @param annotation for recordid, but it was not found in the param list of function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, mixed $recordId, mixed $userId)
                                                                                              Open

                                                                                                   * @param $recordid   -- Record Id:: Type integer
                                                                                              Severity: Info
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_IS_OWNEDBY');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

                                                                                              Call to method trace from undeclared class \App\Log
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Critical
                                                                                              Found in app/Privilege.php by phan

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

                                                                                                              if (!empty($parRecordOwner)) {
                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                                                  if (isset($sharingPrivileges['permission'][$parModName . '_' . $moduleName])) {
                                                                                                                      $writeRelated = $sharingPrivileges['permission'][$parModName . '_' . $moduleName]['write'];
                                                                                                                      $relOwnerType = '';
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php and 1 other location - About 7 hrs to fix
                                                                                              app/Privilege.php on lines 430..466

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

                                                                                              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

                                                                                                              if (\count($parRecordOwner) > 0) {
                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                                                  if (isset($sharingPrivileges['permission'][$parModName . '_' . $moduleName])) {
                                                                                                                      $readRelated = $sharingPrivileges['permission'][$parModName . '_' . $moduleName]['read'];
                                                                                              
                                                                                              
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php and 1 other location - About 7 hrs to fix
                                                                                              app/Privilege.php on lines 525..560

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

                                                                                              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

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

                                                                                                              if (0 !== $recordMetaData['deleted'] && (1 === $actionId || 0 === $actionId || 17 === $actionId)) {
                                                                                                                  switch ($recordMetaData['deleted']) {
                                                                                                                      case 1:
                                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_DELETED';
                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php and 1 other location - About 1 hr to fix
                                                                                              app/Privilege.php on lines 192..206

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

                                                                                              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

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

                                                                                                      if (0 !== $recordMetaData['deleted'] && (1 === $actionId || 0 === $actionId || 17 === $actionId)) {
                                                                                                          switch ($recordMetaData['deleted']) {
                                                                                                              case 1:
                                                                                                                  static::$isPermittedLevel = 'SEC_RECORD_DELETED';
                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Major
                                                                                              Found in app/Privilege.php and 1 other location - About 1 hr to fix
                                                                                              app/Privilege.php on lines 103..117

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

                                                                                              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 $permissionsRelatedField. Keep variable name length under 20.
                                                                                              Open

                                                                                                                  $permissionsRelatedField = '' === $permissionsRoleForRelatedField ? [] : explode(',', $role->get('permissionsrelatedfield'));
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              LongVariable

                                                                                              Since: 0.2

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

                                                                                              Example

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

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

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

                                                                                                      $sharingPrivilegesModule = $sharingPrivileges['permission'][$moduleName];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              LongVariable

                                                                                              Since: 0.2

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

                                                                                              Example

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

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

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

                                                                                                          $isPermittedPrivateRecord = false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              LongVariable

                                                                                              Since: 0.2

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

                                                                                              Example

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

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

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

                                                                                                                  $permissionsRoleForRelatedField = $role->get('permissionsrelatedfield');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpmd

                                                                                              LongVariable

                                                                                              Since: 0.2

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

                                                                                              Example

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

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

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

                                                                                                      $sharingPrivilegesModule = $sharingPrivileges['permission'][$moduleName];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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

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

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

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

                                                                                                          return (static::$interpreter)::isPermitted($moduleName, $actionName, $record, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      return static::checkPermission($moduleName, $actionName, $record, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_IS_CURRENT_USER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if ($userPrivileges['is_admin']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                  public static function checkPermission($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      \App\Log::trace("Entering isPermitted($moduleName,$actionName,$record,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $permission = false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $permission = $userPrivileges['is_admin'] ? true : false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_DELETED';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  private static $interpreter;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      $userId = (int) $userId;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_ADMINISTRATION_MODULE_' . ($permission ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_ARCHIVED';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * Interpreter for privilege.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                      if (!Module::isModuleActive($moduleName)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  static::$isPermittedLevel = 'SEC_RECORD_DOES_NOT_EXIST';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if (!empty(static::$interpreter) && class_exists(static::$interpreter)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $userPrivileges = \App\User::getPrivilegesFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . ($permission) ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - yes');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  public static $isPermittedLevel;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_USER_IS_ADMIN';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //If no actionid, then allow action is vtiger_tab permission is available
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              if (empty($recordMetaData)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_USER_IS_ADMIN');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * Sets interpreter.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                      case 2:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_IS_INACTIVE';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                      case 1:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                                                                                  public static function isPermitted($moduleName, $actionName = null, $record = false, $userId = false)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * @var string
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                                                                                      $actionId = Module::getActionId($actionName);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (0 !== $recordMetaData['deleted'] && (1 === $actionId || 0 === $actionId || 17 === $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                          $userId = \App\User::getCurrentUserId();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      static::$interpreter = $className;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * Function to check permission for a Module/Action/Record.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if ('Users' === $moduleName && $record == \App\User::getCurrentUserId()) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if ($record && 'Users' !== $moduleName) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if ('Settings' !== Request::_get('parent')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return $permission;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  switch ($recordMetaData['deleted']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  public static function setPermissionInterpreter(string $className)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * Invokes function to check permission .
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      } elseif (false === $tabId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking whether the user is admin
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_RIGHTS_TO_ACTION';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                                  static::$isPermittedLevel = 'SEC_RECORD_ARCHIVED';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          && ($fieldInfo = \App\Field::getFieldInfo('private', $recordMetaData['setype'])) && \in_array($fieldInfo['presence'], [0, 2])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $prvAdv = PrivilegeAdvanced::checkPermissions($record, $moduleName, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking for Action Permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (!isset($userPrivileges['profile_action_permission'][$tabId][$actionId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_NO_ACTION_TOOL';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (empty($record)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_READ_ACCESS');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_CREATOR_CURRENT_USER_WRITE_ACCESS');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              $permission = true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_PERMISSIONS_NO';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (false === $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_ACTION_TOOL');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if (1 === Module::getModuleOwner($tabId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (empty($recordMetaData)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $recOwnType = \App\Fields\Owner::getType($recOwnId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if (false !== $prvAdv) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if ('' === $actionId || null === $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 132 characters
                                                                                              Open

                                                                                                      if (!isset($userPrivileges['profile_tabs_permission'][$tabId]) || 0 != $userPrivileges['profile_tabs_permission'][$tabId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

                                                                                              Line exceeds 120 characters; contains 165 characters
                                                                                              Open

                                                                                                      if (($modules = \App\Config::security('permittedModulesByCreatorField')) && \in_array($moduleName, $modules) && $userId === $recordMetaData['smcreatorid']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_RECORD_CREATOR_CURRENT_USER_READ_ACCESS';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (\in_array($userId, $shownerids) || \count(array_intersect($shownerids, $userPrivileges['groups'])) > 0) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  if (isset($usersByRole[$recOwnId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 142 characters
                                                                                              Open

                                                                                                              $parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 145 characters
                                                                                              Open

                                                                                                                  $permissionsRelatedField = '' === $permissionsRoleForRelatedField ? [] : explode(',', $role->get('permissionsrelatedfield'));
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          case 1:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      return $permission;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $othersPermissionId = $sharingPrivileges['defOrgShare'][$tabId];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_NO_ACTION_MODULE_PERMISSIONS' . ($permission ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_RIGHTS_TO_ACTION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking and returning true if recorid is null
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          switch ($recordMetaData['deleted']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              case 2:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (\App\Config::security('PERMITTED_BY_PRIVATE_FIELD') && $recordMetaData['private']
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $level = 'SEC_PRIVATE_RECORD_NO';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  static::$isPermittedLevel = 'SEC_ADVANCED_PERMISSION_NO';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (3 == $actionId || 4 == $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      $recOwnId = $recordMetaData['smownerid'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if (\App\Config::security('PERMITTED_BY_ROLES')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      static::$isPermittedLevel = 'SEC_RECORD_OWNER_SUBORDINATE_USER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          case 2:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              if (\App\Config::security('PERMITTED_BY_SHARING')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              $relatedPermission = static::isPermitted($recordMetaData['setype'], 'DetailView', $parentRecord);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      if (1 == $othersPermissionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (3 === $actionId || 4 === $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return static::isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          return 2 !== $actionId;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  /** Function to check if the currently logged in user has Read Access due to Sharing for the specified record.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_NO_RIGHTS_TO_ACTION';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_ID_IS_NULL';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  static::$isPermittedLevel = 'SEC_RECORD_DELETED';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DELETED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          $recOwnId = $recordMetaData['smownerid'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if (((3 == $actionId || 4 == $actionId) && 0 != $role->get('previewrelatedrecord')) || ((0 == $actionId || 1 == $actionId) && 0 != $role->get('editrelatedrecord'))) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                          case 3:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_VIEW_ALL_PERMISSION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if (0 == $userPrivileges['profile_global_permission'][2] && (3 == $actionId || 4 == $actionId || 0 == $actionId || 1 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (3 == $othersPermissionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                                                                                          //Checking the Read Sharing Permission Array in Role Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (2 == $othersPermissionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

                                                                                              Line exceeds 120 characters; contains 163 characters
                                                                                              Open

                                                                                                      if ((0 == $userPrivileges['profile_global_permission'][1] || 0 == $userPrivileges['profile_global_permission'][2]) && (3 == $actionId || 4 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_DOES_NOT_EXIST';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                  $isPermittedPrivateRecord = true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return $isPermittedPrivateRecord;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_YES');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                          $shownerids = Fields\SharedOwner::getById($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_RECORD_OWNER_CURRENT_GROUP';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $relatedPermission = false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $permission = static::isPermittedBySharing($moduleName, $tabId, $actionId, $record, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return 2 !== $actionId;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * @param $recordId   -- Record Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          foreach ($read['ROLE'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          foreach ($read['GROUP'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_ACTION_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

                                                                                              Line exceeds 120 characters; contains 156 characters
                                                                                              Open

                                                                                                      if (0 != $userPrivileges['profile_action_permission'][$tabId][$actionId] && '' != $userPrivileges['profile_action_permission'][$tabId][$actionId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              case 1:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ARCHIVED');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $level = 'SEC_PRIVATE_RECORD_OWNER_CURRENT_USER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (!$isPermittedPrivateRecord && \App\Config::security('PERMITTED_BY_SHARED_OWNERS')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (\App\Config::security('PERMITTED_BY_ADVANCED_PERMISSION')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (\App\Config::security('permittedWriteAccessByCreatorField') && (0 == $actionId || 1 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          //Checking if the Record Owner is the current User
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_SUBORDINATE_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              $relatedPermission = \in_array($userId, Fields\SharedOwner::getById($parentRecord));
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          $isPermittedPrivateRecord = false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

                                                                                              Line exceeds 120 characters; contains 125 characters
                                                                                              Open

                                                                                                              if (\in_array($userId, $shownerIds) || \count(array_intersect($shownerIds, $userPrivileges['groups'])) > 0) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

                                                                                              Line exceeds 120 characters; contains 121 characters
                                                                                              Open

                                                                                                          if (\in_array($userId, $shownerids) || \count(array_intersect($shownerids, $userPrivileges['groups'])) > 0) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              foreach ($userPrivileges['subordinate_roles_users'] as $usersByRole) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_OWNER_CURRENT_GROUP');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($parentRecord);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      \App\Log::trace('Exiting isPermitted method ... - ' . static::$isPermittedLevel);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking for Default Org Sharing permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @param $moduleName -- Module Name:: Type varchar
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $permissionsRelatedField = '' === $permissionsRoleForRelatedField ? [] : explode(',', $role->get('permissionsrelatedfield'));
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Retreiving the default Organisation sharing Access
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return static::isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (0 === $actionId || 1 === $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return static::isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $ownerId = $recordMetaData['smownerid'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                      //If modules is Products,Vendors,Faq,PriceBook then no sharing
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      // Check advanced permissions
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_RECORD_CREATOR_CURRENT_USER_WRITE_ACCESS';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_RECORD_SHARED_OWNER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $recOwnType = Fields\Owner::getType($recOwnId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      } elseif ('Groups' === $recOwnType) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (\App\Config::security('PERMITTED_BY_SHARING')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          if (isset($userPrivileges['profile_tabs_permission'][$tabId]) && 0 == $userPrivileges['profile_tabs_permission'][$tabId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              $permission = false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_PERMISSIONS_NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 165 characters
                                                                                              Open

                                                                                                      if (\strlen($userPrivileges['profile_action_permission'][$tabId][$actionId]) < 1 && '' === $userPrivileges['profile_action_permission'][$tabId][$actionId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_VIEW_ALL_PERMISSION';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 141 characters
                                                                                              Open

                                                                                                      if (0 == $userPrivileges['profile_global_permission'][2] && (3 == $actionId || 4 == $actionId || 0 == $actionId || 1 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_ID_IS_NULL');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

                                                                                              Line exceeds 120 characters; contains 140 characters
                                                                                              Open

                                                                                                          && ($fieldInfo = \App\Field::getFieldInfo('private', $recordMetaData['setype'])) && \in_array($fieldInfo['presence'], [0, 2])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          } elseif ('Groups' === $recOwnType) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                  $isPermittedPrivateRecord = true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (\App\Config::security('PERMITTED_BY_SHARED_OWNERS')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              $parentRecord = \Users_Privileges_Model::getParentRecord($record, $moduleName, $role->get('previewrelatedrecord'), $actionId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if ($parentRecord && Record::isExists($parentRecord)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              $relatedPermission = $recordMetaData['smownerid'] === $userId || \in_array($recordMetaData['smownerid'], $userPrivileges['groups']);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 164 characters
                                                                                              Open

                                                                                                                              $relatedPermission = $recordMetaData['smownerid'] === $userId || \in_array($recordMetaData['smownerid'], $userPrivileges['groups']);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      static::$isPermittedLevel = 'SEC_RECORD_BY_SHARING_' . ($permission ? 'YES' : 'NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if (1 === $actionId || 0 === $actionId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return 2 !== $actionId;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              if (\in_array($ownerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 135 characters
                                                                                              Open

                                                                                                          if (isset($userPrivileges['profile_tabs_permission'][$tabId]) && 0 == $userPrivileges['profile_tabs_permission'][$tabId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_NO_RIGHTS_TO_ACTION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking for edit all permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_EDIT_ALL_PERMISSION';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_EDIT_ALL_PERMISSION');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_MODULE_IS_OWNEDBY');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (0 !== $recordMetaData['deleted'] && (1 === $actionId || 0 === $actionId || 17 === $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (\in_array($userId, $shownerIds) || \count(array_intersect($shownerIds, $userPrivileges['groups'])) > 0) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          //Checking if the record owner is the current user's group
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                          if (\in_array($recOwnId, $userPrivileges['groups'])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Retreiving the RecordOwnerId
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

                                                                                              Line exceeds 120 characters; contains 168 characters
                                                                                              Open

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $role = $userPrivilegesModel->getRoleDetail();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $sharingPrivilegesModule = $sharingPrivileges['permission'][$moduleName];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $permissionsRoleForRelatedField = $role->get('permissionsrelatedfield');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                  public static function isPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                          if (isset($read['GROUP'][$ownerId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking for vtiger_tab permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if ((0 == $userPrivileges['profile_global_permission'][1] || 0 == $userPrivileges['profile_global_permission'][2]) && (3 == $actionId || 4 == $actionId)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (!isset($userPrivileges['profile_tabs_permission'][$tabId]) || 0 != $userPrivileges['profile_tabs_permission'][$tabId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $isPermittedPrivateRecord = true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_ACTION_DOES_NOT_EXIST';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (\in_array($recOwnId, $userPrivileges['groups'])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                              $shownerIds = Fields\SharedOwner::getById($record);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      //Checking for view all permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = 'SEC_MODULE_IS_OWNEDBY';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $level = 'SEC_PRIVATE_RECORD_SHARED_OWNER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      if (\App\Config::security('PERMITTED_BY_RECORD_HIERARCHY')) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_ADVANCED_PERMISSION_YES';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          static::$isPermittedLevel = 'SEC_RECORD_HIERARCHY_USER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                                                                                                      if (($modules = \App\Config::security('permittedModulesByCreatorField')) && \in_array($moduleName, $modules) && $userId === $recordMetaData['smcreatorid']) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          return $permission;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @param $tabId      -- Tab Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      if (\strlen($userPrivileges['profile_action_permission'][$tabId][$actionId]) < 1 && '' === $userPrivileges['profile_action_permission'][$tabId][$actionId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if (0 != $userPrivileges['profile_action_permission'][$tabId][$actionId] && '' != $userPrivileges['profile_action_permission'][$tabId][$actionId]) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_SHARED_OWNER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          case 0:
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_DOES_NOT_EXIST');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $level = 'SEC_PRIVATE_RECORD_OWNER_CURRENT_GROUP';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          static::$isPermittedLevel = $level;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                  \App\Log::trace('Exiting isPermitted method ... - SEC_ADVANCED_PERMISSION_NO');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * @param $actionId   -- Action Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          $userPrivilegesModel = \Users_Privileges_Model::getInstanceById($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $read = $sharingPrivilegesModule['read'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              static::$isPermittedLevel = 'SEC_RECORD_OWNER_CURRENT_USER';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (\in_array($ownerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 178 characters
                                                                                              Open

                                                                                                          if (((3 == $actionId || 4 == $actionId) && 0 != $role->get('previewrelatedrecord')) || ((0 == $actionId || 1 == $actionId) && 0 != $role->get('editrelatedrecord'))) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              //Checking if the Record Owner is the Subordinate User
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                  foreach ($permissionsRelatedField as $row) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                                  $relatedPermission = static::isPermittedBySharing($recordMetaData['setype'], Module::getModuleId($recordMetaData['setype']), $actionId, $parentRecord, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 129 characters
                                                                                              Open

                                                                                                                              $relatedPermission = static::isPermitted($recordMetaData['setype'], 'DetailView', $parentRecord);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 196 characters
                                                                                              Open

                                                                                                                                  $relatedPermission = static::isPermittedBySharing($recordMetaData['setype'], Module::getModuleId($recordMetaData['setype']), $actionId, $parentRecord, $userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                          //Checking the Read Sharing Permission Array in Groups Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          \App\Log::trace('Exiting isPermitted method ... - SEC_RECORD_HIERARCHY_USER');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                   * @param $moduleName -- Module Name:: Type varchar
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          //Checking in Group Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              if (\in_array($relOwnerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

                                                                                              Line exceeds 120 characters; contains 168 characters
                                                                                              Open

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          foreach ($write['ROLE'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      if (\is_array($relatedModuleArray)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                                                                                                          //Checking in Role Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                  public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              if (\in_array($relOwnerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                                          if (isset($readRelated['GROUP'][$relOwnerId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (\in_array($ownerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          $relOwnerId = $rel_id;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                   * Add to global permissions update queue.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      //Checking for the Related Sharing Permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      foreach ($parRecordOwner as $rel_type => $rel_id) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          //Checking in Group Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          $relOwnerType = $rel_type;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                                          $relOwnerType = $rel_type;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @param $actionId   -- Action Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      $write = $sharingPrivilegesModule['write'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                          foreach ($sharingPrivileges['relatedModuleShare'][$tabId] as $parModId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      foreach ($parRecordOwner as $rel_type => $rel_id) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                      \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                      if (isset($sharingPrivileges['relatedModuleShare'][$tabId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

                                                                                                   * @param $tabId      -- Tab Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

                                                                                              Line exceeds 120 characters; contains 133 characters
                                                                                              Open

                                                                                                      if (isset($sharingPrivileges['relatedModuleShare'][$tabId]) && \is_array($sharingPrivileges['relatedModuleShare'][$tabId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              if (!empty($parRecordOwner)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                   * @param int    $record     If type = 1 starting number if type = 0 record ID
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      $readRelated = $sharingPrivileges['permission'][$parModName . '_' . $moduleName]['read'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                          foreach ($readRelated['ROLE'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      } elseif ('Groups' == $ownerType) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

                                                                                                      //Checking for the Related Sharing Permission
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      $relOwnerType = '';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                                                      $relatedModuleArray = null;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                      $relOwnerType = '';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

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

                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          foreach ($write['GROUP'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          if (isset($write['GROUP'][$ownerId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                   * @param mixed $userId
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      $recordMetaData = \vtlib\Functions::getCRMRecordMetadata($recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          $relatedModuleArray = $sharingPrivileges['relatedModuleShare'][$tabId];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              $parRecordOwner = PrivilegeUtil::getParentRecordOwner($tabId, $parModId, $recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                  /** Function to check if the currently logged in user has Write Access due to Sharing for the specified record.
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      if ('Users' == $ownerType) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      PrivilegeUpdater::setUpdater($moduleName, $record, $priority, $type);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          //Checking in Role Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          foreach ($readRelated['GROUP'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                  }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                   */
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      if (isset($sharingPrivileges['relatedModuleShare'][$tabId]) && \is_array($sharingPrivileges['relatedModuleShare'][$tabId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          foreach ($writeRelated['GROUP'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          if (isset($writeRelated['GROUP'][$relOwnerId])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      $relOwnerId = '';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                   * @param $recordid   -- Record Id:: Type integer
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          //Checking the Write Sharing Permission Array in Role Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      $writeRelated = $sharingPrivileges['permission'][$parModName . '_' . $moduleName]['write'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                                  return true;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          foreach ($relatedModuleArray as $parModId) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              if (\count($parRecordOwner) > 0) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                  $parModName = Module::getModuleName($parModId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                                  \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      $ownerId = $recordMetaData['smownerid'];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              $parRecordOwner = PrivilegeUtil::getParentRecordOwner($tabId, $parModId, $recordId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          foreach ($writeRelated['ROLE'] as $userids) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              if (\in_array($relOwnerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      } else {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadWritePermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                  /**
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      PrivilegeUpdater::setAllUpdater();
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                          $relOwnerId = $rel_id;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              if (\in_array($relOwnerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              \App\Log::trace('Exiting isReadPermittedBySharing method ...');
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                   * @param mixed $recordId
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Line exceeds 120 characters; contains 125 characters
                                                                                              Open

                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      $sharingPrivilegesModule = $sharingPrivileges['permission'][$moduleName];
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                              if (\in_array($ownerId, $userids)) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                  if (isset($sharingPrivileges['permission'][$parModName . '_' . $moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      $relOwnerId = '';
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                   */
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                  public static function setAllUpdater()
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                  if (isset($sharingPrivileges['permission'][$parModName . '_' . $moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                              }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                                      }
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          return false;
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                      $ownerType = \App\Fields\Owner::getType($ownerId);
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              Spaces must be used to indent lines; tabs are not allowed
                                                                                              Open

                                                                                                          //Checking the Write Sharing Permission Array in Groups Users
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.php by phpcodesniffer

                                                                                              The variable $rel_id is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_id is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_type is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_type is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadPermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadPermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                              
                                                                                              
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_type is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_id is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_id is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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 $rel_type is not named in camelCase.
                                                                                              Open

                                                                                                  public static function isReadWritePermittedBySharing($moduleName, $tabId, $actionId, $recordId, $userId)
                                                                                                  {
                                                                                                      \App\Log::trace("Entering isReadWritePermittedBySharing($moduleName,$tabId,$actionId,$recordId,$userId) method ...");
                                                                                                      $sharingPrivileges = \App\User::getSharingFile($userId);
                                                                                                      if (!isset($sharingPrivileges['permission'][$moduleName])) {
                                                                                              Severity: Minor
                                                                                              Found in app/Privilege.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