YetiForceCompany/YetiForceCRM

View on GitHub
app/UserPrivilegesFile.php

Summary

Maintainability
F
1 wk
Test Coverage
D
63%

Function getRelatedModuleSharingArray has a Cognitive Complexity of 191 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
    {
        $relatedModSharingPermission = [];
        $modShareReadPermission = [];
        $modShareWritePermission = [];
Severity: Minor
Found in app/UserPrivilegesFile.php - About 3 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 populateSharingPrivileges has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
    {
        $tabId = Module::getModuleId($module);
        $dbCommand = \App\Db::getInstance()->createCommand();
        if (empty($varArr)) {
Severity: Minor
Found in app/UserPrivilegesFile.php - About 7 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function populateRelatedSharingPrivileges has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $tabId = Module::getModuleId($module);
        $relTabId = Module::getModuleId($relmodule);
Severity: Minor
Found in app/UserPrivilegesFile.php - About 7 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File UserPrivilegesFile.php has 399 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App;

/**
Severity: Minor
Found in app/UserPrivilegesFile.php - About 5 hrs to fix

    Method getRelatedModuleSharingArray has 123 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
        {
            $relatedModSharingPermission = [];
            $modShareReadPermission = [];
            $modShareWritePermission = [];
    Severity: Major
    Found in app/UserPrivilegesFile.php - About 4 hrs to fix

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

      class UserPrivilegesFile
      {
          /**
           * Function to recalculate the Sharing Rules for all the vtiger_users
           * This function will recalculate all the sharing rules for all the vtiger_users in the Organization and will write them in flat vtiger_files.
      Severity: Minor
      Found in app/UserPrivilegesFile.php by phpmd

      Function createUserPrivilegesfile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function createUserPrivilegesfile($userid)
          {
              $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
              $handle = fopen($fileUserPrivileges, 'w+');
              if ($handle) {
      Severity: Minor
      Found in app/UserPrivilegesFile.php - About 2 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      Method createUserSharingPrivilegesfile has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function createUserSharingPrivilegesfile($userid)
          {
              \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
              require 'user_privileges/user_privileges_' . $userid . '.php';
              $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
      Severity: Major
      Found in app/UserPrivilegesFile.php - About 2 hrs to fix

        Method createUserPrivilegesfile has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function createUserPrivilegesfile($userid)
            {
                $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                $handle = fopen($fileUserPrivileges, 'w+');
                if ($handle) {
        Severity: Major
        Found in app/UserPrivilegesFile.php - About 2 hrs to fix

          Method populateRelatedSharingPrivileges has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
              {
                  $dbCommand = \App\Db::getInstance()->createCommand();
                  $tabId = Module::getModuleId($module);
                  $relTabId = Module::getModuleId($relmodule);
          Severity: Minor
          Found in app/UserPrivilegesFile.php - About 1 hr to fix

            Method populateSharingPrivileges has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                {
                    $tabId = Module::getModuleId($module);
                    $dbCommand = \App\Db::getInstance()->createCommand();
                    if (empty($varArr)) {
            Severity: Minor
            Found in app/UserPrivilegesFile.php - About 1 hr to fix

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

                  public static function populateSharingtmptables($userid)
                  {
                      $dbCommand = \App\Db::getInstance()->createCommand();
                      \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
              
              
              Severity: Minor
              Found in app/UserPrivilegesFile.php - About 1 hr to fix

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

                    public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                Severity: Minor
                Found in app/UserPrivilegesFile.php - About 45 mins to fix

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

                      public static function populateSharingtmptables($userid)
                      {
                          $dbCommand = \App\Db::getInstance()->createCommand();
                          \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
                  
                  
                  Severity: Minor
                  Found in app/UserPrivilegesFile.php - About 45 mins to fix

                  Cognitive Complexity

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

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

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

                  Further reading

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

                      public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                  Severity: Minor
                  Found in app/UserPrivilegesFile.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                                if (!isset($grpWritePer[$subgrpid])) {
                                                                    $grpWritePer[$subgrpid] = $subgrpusers;
                                                                }
                    Severity: Major
                    Found in app/UserPrivilegesFile.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                                  if (!isset($grpReadPer[$subgrpid])) {
                                                                      $grpReadPer[$subgrpid] = $subgrpusers;
                                                                  }
                      Severity: Major
                      Found in app/UserPrivilegesFile.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                    if (!isset($grpReadPer[$subgrpid])) {
                                                                        $grpReadPer[$subgrpid] = $subgrpusers;
                                                                    }
                        Severity: Major
                        Found in app/UserPrivilegesFile.php - About 45 mins to fix

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

                              public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                          Severity: Minor
                          Found in app/UserPrivilegesFile.php - About 35 mins to fix

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

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php - About 35 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            The method populateRelatedSharingPrivileges() has an NPath complexity of 206. The configured NPath complexity threshold is 200.
                            Open

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                                {
                                    $dbCommand = \App\Db::getInstance()->createCommand();
                                    $tabId = Module::getModuleId($module);
                                    $relTabId = Module::getModuleId($relmodule);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 populateSharingPrivileges() has an NPath complexity of 206. The configured NPath complexity threshold is 200.
                            Open

                                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                                {
                                    $tabId = Module::getModuleId($module);
                                    $dbCommand = \App\Db::getInstance()->createCommand();
                                    if (empty($varArr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray() has 127 lines of code. Current threshold is set to 100. Avoid really long methods.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

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

                                public static function createUserPrivilegesfile($userid)
                                {
                                    $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                                    $handle = fopen($fileUserPrivileges, 'w+');
                                    if ($handle) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 populateSharingPrivileges() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
                            Open

                                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                                {
                                    $tabId = Module::getModuleId($module);
                                    $dbCommand = \App\Db::getInstance()->createCommand();
                                    if (empty($varArr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray() has a Cyclomatic Complexity of 40. The configured cyclomatic complexity threshold is 10.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 populateRelatedSharingPrivileges() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
                            Open

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                                {
                                    $dbCommand = \App\Db::getInstance()->createCommand();
                                    $tabId = Module::getModuleId($module);
                                    $relTabId = Module::getModuleId($relmodule);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 47 to the 15 allowed.
                            Open

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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

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

                                public static function createUserPrivilegesfile($userid)
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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

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

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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

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

                                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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

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

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UndefinedVariable

                            Since: 2.8.0

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

                            Example

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

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

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

                            class UserPrivilegesFile
                            {
                                /**
                                 * Function to recalculate the Sharing Rules for all the vtiger_users
                                 * This function will recalculate all the sharing rules for all the vtiger_users in the Organization and will write them in flat vtiger_files.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 populateSharingPrivileges has a boolean flag argument $varArr, which is a certain sign of a Single Responsibility Principle violation.
                            Open

                                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 populateRelatedSharingPrivileges has a boolean flag argument $varArr, which is a certain sign of a Single Responsibility Principle violation.
                            Open

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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

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

                                            $newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Purifier' in method 'createUserPrivilegesfile'.
                            Open

                                                    $userInfo[$field] = is_numeric($userFocus->{$field}) ? $userFocus->{$field} : \App\Purifier::encodeHtml($userFocus->{$field});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                            }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 '\CRMEntity' in method 'createUserPrivilegesfile'.
                            Open

                                        $userFocus = \CRMEntity::getInstance('Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 createUserPrivilegesfile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                } else {
                                                    $userInfo[$field] = is_numeric($userFocus->{$field}) ? $userFocus->{$field} : \App\Purifier::encodeHtml($userFocus->{$field});
                                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $actionPermissionArr = PrivilegeUtil::getCombinedUserActionsPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$profileGlobalPermission=' . Utils::varExport($globalPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                        User::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$related_module_share=' . Utils::varExport($relatedModuleShare) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_HelpDesk_share_write_permission=array('ROLE'=>" . Utils::varExport($accTktShareWriteer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareWriteer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                            $customModules = Module::getSharingModuleList(['Accounts', 'Contacts']);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                            User::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'populateSharingtmptables'.
                            Open

                                    $modules = \vtlib\Functions::getAllModules(true, true, 0, false, 0);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$profileTabsPermission=' . Utils::varExport($tabsPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                        \Users_Privileges_Model::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                                    Utils::varExport($modShareWritePerm['ROLE']) . ",'GROUP'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                                } else {
                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                                                                    $shareGrpUsers = $usersByGroup['users'];
                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                                                                        if (!isset($grpReadPer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $tabsPermissionArr = PrivilegeUtil::getCombinedUserModulesPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$subordinate_roles_users=' . Utils::varExport($subRoleAndUsers) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Contacts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 createUserPrivilegesfile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $newBuf .= "\$is_admin=false;\n";
                                            $globalPermissionArr = PrivilegeUtil::getCombinedUserGlobalPermissions($userid);
                                            $tabsPermissionArr = PrivilegeUtil::getCombinedUserModulesPermissions($userid);
                                            $actionPermissionArr = PrivilegeUtil::getCombinedUserActionsPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Utils' in method 'createUserPrivilegesfile'.
                            Open

                                            $newBuf .= '$subordinate_roles=' . Utils::varExport($subRoles) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                                } else {
                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                                                                    $shareGrpUsers = $usersByGroup['users'];
                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                                                                        if (!isset($grpReadPer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Utils' in method 'createUserPrivilegesfile'.
                            Open

                                            $newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                            $relatedModuleShare = PrivilegeUtil::getDatashareRelatedModules();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                                    Utils::varExport($modShareWritePerm['GROUP']) . "];\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                    $shareModId = Module::getModuleId($share_mod);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'populateSharingtmptables'.
                            Open

                                        $relTabName = Module::getModuleName($relTabId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                                    Utils::varExport($modShareReadPerm['ROLE']) . ",'GROUP'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Deprecated' in method 'populateSharingtmptables'.
                            Open

                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $globalPermissionArr = PrivilegeUtil::getCombinedUserGlobalPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $userRole = PrivilegeUtil::getRoleByUsers($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $parentRoles = PrivilegeUtil::getParentRole($userRole);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Contacts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$profileActionPermission=' . Utils::varExport($actionPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Contacts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= 'return ' . Utils::varExport($sharingPrivileges) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\MultiCompany' in method 'reloadByMultiCompany'.
                            Open

                                    foreach (MultiCompany::getUsersByCompany($companyId) as $userId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                    $parModId = Module::getModuleId($par_mod);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'populateSharingPrivileges'.
                            Open

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

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 '\CRMEntity' in method 'createUserSharingPrivilegesfile'.
                            Open

                                        $userFocus = \CRMEntity::getInstance('Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 createUserSharingPrivilegesfile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                        } else {
                                            $sharingPrivileges = [];
                                            //Constructig the Default Org Share Array
                                            $defOrgShare = PrivilegeUtil::getAllDefaultSharingAction();
                                            $newBuf .= '$defaultOrgSharingPermission=' . Utils::varExport($defOrgShare) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Utils' in method 'createUserSharingPrivilegesfile'.
                            Open

                                            $newBuf .= '$defaultOrgSharingPermission=' . Utils::varExport($defOrgShare) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Contacts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= '$parent_roles=' . Utils::varExport($parentRoles) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                        \App\Cache::resetFileCache($fileUserPrivileges);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $subRoles = PrivilegeUtil::getRoleSubordinates($userRole);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            \App\Cache::resetFileCache($fileUserSharingPrivileges);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                                } else {
                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                                                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Utils' in method 'createUserSharingPrivilegesfile'.
                            Open

                                            $newBuf .= "\$Accounts_HelpDesk_share_read_permission=array('ROLE'=>" . Utils::varExport($accTktShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_HelpDesk_share_write_permission=array('ROLE'=>" . Utils::varExport($accTktShareWriteer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareWriteer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                                } else {
                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                                                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            ElseExpression

                            Since: 1.4.0

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

                            Example

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

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

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

                                                                } else {
                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                                                                    $shareGrpUsers = $usersByGroup['users'];
                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                                                                        if (!isset($grpWritePer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'getRelatedModuleSharingArray'.
                            Open

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'populateRelatedSharingPrivileges'.
                            Open

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

                                                $subRoleAndUsers[$subRoleId] = \App\PrivilegeUtil::getUsersNameByRole($subRoleId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserPrivilegesfile'.
                            Open

                                            $newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

                            Avoid using static access to class 'App\PrivilegeFile' in method 'createUserPrivilegesfile'.
                            Open

                                        PrivilegeFile::createUserPrivilegesFile($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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\Deprecated' in method 'createUserSharingPrivilegesfile'.
                            Open

                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'createUserSharingPrivilegesfile'.
                            Open

                                            $defOrgShare = PrivilegeUtil::getAllDefaultSharingAction();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                            $newBuf .= "\$Accounts_HelpDesk_share_read_permission=array('ROLE'=>" . Utils::varExport($accTktShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            StaticAccess

                            Since: 1.4.0

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

                            Example

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

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

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

                                                    Utils::varExport($modShareReadPerm['GROUP']) . "];\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 getRelatedModuleSharingArray uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                            Open

                                                                } else {
                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                                                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            ElseExpression

                            Since: 1.4.0

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

                            Example

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

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

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

                                                $tabName = Module::getModuleName($tabId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 'populateRelatedSharingPrivileges'.
                            Open

                                    $relTabId = Module::getModuleId($relmodule);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 "user_privileges/sharing_privileges_" 3 times.
                            Open

                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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" 39 times.
                            Open

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "shareduserid" 4 times.
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Critical
                            Found in app/UserPrivilegesFile.php by sonar-php

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

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

                            Noncompliant Code Example

                            With the default threshold of 3:

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

                            Compliant Solution

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

                            Exceptions

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

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

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "subGroups" 3 times.
                            Open

                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "userid" 7 times.
                            Open

                                        $dbCommand->delete($tableName, ['userid' => $userid])->execute();
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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" 4 times.
                            Open

                                        $userFocus = \CRMEntity::getInstance('Users');
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "user_privileges/user_privileges_" 3 times.
                            Open

                                    $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "relatedtabid" 3 times.
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "Accounts" 4 times.
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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" 4 times.
                            Open

                                            $sharingPrivileges['permission']['Accounts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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" 3 times.
                            Open

                                                                    $shareGrpUsers = $usersByGroup['users'];
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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 "write" 16 times.
                            Open

                                            $accountShareWritePer = $accountSharePerArray['write'];
                            Severity: Critical
                            Found in app/UserPrivilegesFile.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.

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

                                        foreach ($userFocus->column_fields as $field => $value) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UnusedLocalVariable

                            Since: 0.2

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

                            Example

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

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

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

                                            foreach ($varArr['GROUP'] as $groupId => $grpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UnusedLocalVariable

                            Since: 0.2

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

                            Example

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

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

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

                                    foreach ($related_module_share as $relTabId => $tabIdArr) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            UnusedLocalVariable

                            Since: 0.2

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

                            Example

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

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

                            Reference to undeclared property \CRMEntity->currency_symbol
                            Open

                                                    $userInfo[$field] = $userFocus->{$field};
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

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

                                    $userIds = (new Db\Query())->select(['id'])->from('vtiger_users')->where(['deleted' => 0])->column();
                            Severity: Critical
                            Found in app/UserPrivilegesFile.php by phan

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

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

                            Variable $current_user_roles is undeclared
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['ROLE'] as $roleUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Reference to undeclared property \CRMEntity->id
                            Open

                                        $userFocus->id = $userid;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

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

                                 * @returns sharing_privileges_userid file under the user_privileges directory
                            Severity: Info
                            Found in app/UserPrivilegesFile.php by phan

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

                                        User::clearCache($userid);
                            Severity: Critical
                            Found in app/UserPrivilegesFile.php by phan

                            Variable $current_user_groups is undeclared
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['GROUP'] as $groupId => $grpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['GROUP'] as $groupId => $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Variable $related_module_share is undeclared
                            Open

                                    foreach ($related_module_share as $relTabId => $tabIdArr) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

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

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

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

                                 * @returns User_Privileges_Userid file under the User_Privileges Directory
                            Severity: Info
                            Found in app/UserPrivilegesFile.php by phan

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

                                            User::clearCache($userid);
                            Severity: Critical
                            Found in app/UserPrivilegesFile.php by phan

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['GROUP'] as $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Reference to undeclared property \CRMEntity->column_fields
                            Open

                                        foreach ($userFocus->column_fields as $field => $value) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Variable $current_user_roles is undeclared
                            Open

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['ROLE'] as $roleUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Reference to undeclared property \CRMEntity->is_admin
                            Open

                                        if ('on' == $userFocus->is_admin) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Saw an @param annotation for userid, but it was not found in the param list of function populateRelatedSharingPrivileges(string $enttype, mixed $userId, string $module, string $relmodule, string $pertype, bool|false $varArr = null)
                            Open

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

                            Reference to undeclared property \CRMEntity->column_fields
                            Open

                                        $userFocus->column_fields['id'] = '';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Reference to undeclared property \CRMEntity->is_admin
                            Open

                                        if ('on' == $userFocus->is_admin) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Variable $current_user_groups is undeclared
                            Open

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Variable $parent_roles is undeclared
                            Open

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

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

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

                            Variable $parent_roles is undeclared
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

                            Expected @param annotation for userId to be before the @param annotation for module
                            Open

                                 * @param string $module
                            Severity: Info
                            Found in app/UserPrivilegesFile.php by phan

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

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

                            Suspicious array access to true
                            Open

                                            foreach ($varArr['GROUP'] as $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phan

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

                                                            if (!isset($grpReadPer[$shareEntId])) {
                                                                if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
                                                                    $shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
                                                                } elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
                                                                    $shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
                            Severity: Major
                            Found in app/UserPrivilegesFile.php and 1 other location - About 3 hrs to fix
                            app/UserPrivilegesFile.php on lines 262..277

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

                            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 (!isset($grpWritePer[$shareEntId])) {
                                                                if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
                                                                    $shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
                                                                } elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
                                                                    $shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
                            Severity: Major
                            Found in app/UserPrivilegesFile.php and 1 other location - About 3 hrs to fix
                            app/UserPrivilegesFile.php on lines 279..294

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

                            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 (!isset($roleReadPer[$shareEntId])) {
                                                                if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
                                                                    $shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
                                                                } elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
                                                                    $shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php and 1 other location - About 1 hr to fix
                            app/UserPrivilegesFile.php on lines 222..231

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

                            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 (!isset($roleWritePer[$shareEntId])) {
                                                                if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
                                                                    $shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
                                                                } elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
                                                                    $shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php and 1 other location - About 1 hr to fix
                            app/UserPrivilegesFile.php on lines 233..242

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

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

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $moduleSharingWritePermvar. Keep variable name length under 20.
                            Open

                                        $moduleSharingWritePermvar = $module . '_share_write_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $relmoduleSharingWritePermvar. Keep variable name length under 20.
                            Open

                                                $relmoduleSharingWritePermvar = $tabName . '_' . $relTabName . '_share_write_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $fileUserSharingPrivileges. Keep variable name length under 20.
                            Open

                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $modShareWritePermission. Keep variable name length under 20.
                            Open

                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $modShareReadPermission. Keep variable name length under 20.
                            Open

                                    $modShareReadPermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $relatedModSharingPermission. Keep variable name length under 20.
                            Open

                                    $relatedModSharingPermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $relmoduleSharingReadPermvar. Keep variable name length under 20.
                            Open

                                                $relmoduleSharingReadPermvar = $tabName . '_' . $relTabName . '_share_read_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $accountSharingruleMembers. Keep variable name length under 20.
                            Open

                                            $accountSharingruleMembers = $accountSharePerArray['sharingrules'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $moduleSharingReadPermvar. Keep variable name length under 20.
                            Open

                                        $moduleSharingReadPermvar = $module . '_share_read_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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

                            The parameter $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $par_mod is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $share_mod is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $mod_sharingrule_members is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            The parameter $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseParameterName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name parameters.

                            Example

                            class ClassName {
                                public function doSomething($user_name) {
                                }
                            }

                            Source

                            Line exceeds 120 characters; contains 146 characters
                            Open

                                 * This function will recalculate all the sharing rules for all the vtiger_users in the Organization and will write them in flat vtiger_files.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                    $userInfo[$field] = $userFocus->{$field};
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if ('on' == $userFocus->is_admin) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                 * Creates a file with all the organization default sharing permissions
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                 * In this file the information of the other users whose data is shared with the specified user is stored.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 176 characters
                            Open

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $accountShareReadPer = $accountSharePerArray['read'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        static::createUserSharingPrivilegesfile($id);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                public static function createUserPrivilegesfile($userid)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                if ('currency_symbol' === $field || $field === 'imagename'|| $field === 'othereventduration') {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$profileGlobalPermission=' . Utils::varExport($globalPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$subordinate_roles=' . Utils::varExport($subRoles) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$defaultOrgSharingPermission=' . Utils::varExport($defOrgShare) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $sharingPrivileges['permission']['Accounts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Accounts_HelpDesk_share_write_permission=array('ROLE'=>" . Utils::varExport($accTktShareWriteer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareWriteer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $modShareReadPerm = $modSharePermArray['read'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 124 characters
                            Open

                                    $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $newBuf .= "<?php\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $userFocus = \CRMEntity::getInstance('Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $userFocus->retrieveEntityInfo($userid, 'Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                            $newBuf .= "\$current_user_roles='" . $userRole . "';\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$parent_roles=' . Utils::varExport($parentRoles) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $sharingPrivileges['relatedModuleShare'] = $relatedModuleShare;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 200 characters
                            Open

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Contacts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $modShareWritePerm = $modSharePermArray['write'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        static::createUserPrivilegesfile($id);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    return \count($userIds);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 150 characters
                            Open

                                                    $userInfo[$field] = is_numeric($userFocus->{$field}) ? $userFocus->{$field} : \App\Purifier::encodeHtml($userFocus->{$field});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $globalPermissionArr = PrivilegeUtil::getCombinedUserGlobalPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                 * @returns sharing_privileges_userid file under the user_privileges directory
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Accounts_HelpDesk_share_read_permission=array('ROLE'=>" . Utils::varExport($accTktShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $userIds = (new Db\Query())->select(['id'])->from('vtiger_users')->where(['deleted' => 0])->column();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $tabsPermissionArr = PrivilegeUtil::getCombinedUserModulesPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $subRoleAndUsers[$subRoleId] = \App\PrivilegeUtil::getUsersNameByRole($subRoleId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $parentRoles = PrivilegeUtil::getParentRole($userRole);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 125 characters
                            Open

                                            $newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$profileActionPermission=' . Utils::varExport($actionPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 203 characters
                            Open

                                            $newBuf .= "\$Contacts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    $parModId = Module::getModuleId($par_mod);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                ->from('vtiger_datashare_relatedmodule_permission')
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    'vtiger_datashare_relatedmodule_permission.shareid' => $sharingid,
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                    $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$is_admin=true;\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $actionPermissionArr = PrivilegeUtil::getCombinedUserActionsPermissions($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $accountSharingruleMembers = $accountSharePerArray['sharingrules'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Accounts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            //Constructing Contact Sharing Rules
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 136 characters
                            Open

                                            $sharingPrivileges['permission']['Accounts_HelpDesk'] = ['read' => $accTktShareReadPer, 'write' => $accTktShareWriteer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        $userFocus->column_fields['id'] = '';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $newBuf .= '$profileTabsPermission=' . Utils::varExport($tabsPermissionArr) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        User::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        \App\Cache::resetFileCache($fileUserPrivileges);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            fclose($handle);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $sharingPrivileges['permission']['Contacts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $acctRelatedTkt = static::getRelatedModuleSharingArray('Accounts', 'HelpDesk', $accountSharingruleMembers, $accountShareReadPer, $accountShareWritePer, $defOrgShare);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 208 characters
                            Open

                                            $newBuf .= "\$Accounts_HelpDesk_share_write_permission=array('ROLE'=>" . Utils::varExport($accTktShareWriteer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareWriteer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            static::populateSharingtmptables($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                ])->scalar();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                foreach ($shareEntArr as $shareEntId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                            if (!isset($roleReadPer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                } elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            fwrite($handle, $newBuf);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 182 characters
                            Open

                                            $acctRelatedTkt = static::getRelatedModuleSharingArray('Accounts', 'HelpDesk', $accountSharingruleMembers, $accountShareReadPer, $accountShareWritePer, $defOrgShare);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $accTktShareWriteer = $acctRelatedTkt['write'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $sharingPrivileges['permission']['Accounts_HelpDesk'] = ['read' => $accTktShareReadPer, 'write' => $accTktShareWriteer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                 * groups and user's related module data that is to be shared  for the specified parent module and shared module.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    if ('ROLE' == $shareType) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                    $handle = fopen($fileUserPrivileges, 'w+');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                            $customModules = Module::getSharingModuleList(['Accounts', 'Contacts']);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 178 characters
                            Open

                                                $modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $newBuf .= '$' . $moduleName . "_share_write_permission=['ROLE'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            // END
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                    $shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                        if (!isset($grpWritePer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                 * This function will recalculate all the sharing rules for all the vtiger_users in the Organization and will write them in flat vtiger_files.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    foreach ($userIds as $id) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        $newBuf = '';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$subordinate_roles_users=' . Utils::varExport($subRoleAndUsers) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                            $newBuf .= '$related_module_share=' . Utils::varExport($relatedModuleShare) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            fclose($handle);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            \App\Cache::resetFileCache($fileUserSharingPrivileges);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                } elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                    $shareGrpUsers = $usersByGroup['users'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                                    $shareGrpUsers = $usersByGroup['users'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                    Utils::varExport($modShareWritePerm['GROUP']) . "];\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    $modShareReadPermission['GROUP'] = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    'vtiger_datashare_relatedmodules.relatedto_tabid' => $shareModId,
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($sharingInfoArr as $shareType => $shareEntArr) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        } elseif (0 == $sharePermission && 3 == $def_org_share[$shareModId]) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    } elseif ('GROUP' == $shareType) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                 * @returns User_Privileges_Userid file under the User_Privileges Directory
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        $userFocus->retrieveEntityInfo($userid, 'Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            //Constructig the Default Org Share Array
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $defOrgShare = PrivilegeUtil::getAllDefaultSharingAction();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 200 characters
                            Open

                                            $newBuf .= "\$Contacts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    Utils::varExport($modShareReadPerm['ROLE']) . ",'GROUP'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                            if (!isset($roleWritePer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                            if (3 == $def_org_share[$shareModId] && !isset($grpReadPer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                                    $shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        \Users_Privileges_Model::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $handle = fopen($fileUserSharingPrivileges, 'w+');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Contacts_share_read_permission=array('ROLE'=>" . Utils::varExport($accountShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 129 characters
                            Open

                                                $sharingPrivileges['permission'][$moduleName] = ['read' => $modShareReadPerm, 'write' => $modShareWritePerm];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    if (3 == $def_org_share[$shareModId] || 0 == $def_org_share[$shareModId]) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                } elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                        } elseif (0 == $sharePermission && 3 == $def_org_share[$shareModId]) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                } elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                            $grpReadPer[$subgrpid] = $subgrpusers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                 * Function to recalculate the Sharing Rules for all the vtiger_users
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $userFocus->id = $userid;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $userRole = PrivilegeUtil::getRoleByUsers($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                 * and custom sharing permissins specific for the specified user.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            //Constructing Account Sharing Rules
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $accountShareWritePer = $accountSharePerArray['write'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($customModules as $moduleName) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $newBuf .= '$' . $moduleName . "_share_read_permission=['ROLE'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    Utils::varExport($modShareReadPerm['GROUP']) . "];\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                    'vtiger_datashare_relatedmodules.tabid' => $parModId,
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                            if (3 == $def_org_share[$shareModId] && !isset($roleReadPer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                                                $grpReadPer[$shareEntId] = $shareGrpUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $relatedModSharingPermission['write'] = $modShareWritePermission;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    return $relatedModSharingPermission;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $sharingArray = array_column($modules, 'name');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                foreach ($roleUsers as $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 145 characters
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $tableName = 'vtiger_tmp_write_group_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                                 * Creates a file with all the user, user-role,user-profile, user-groups informations.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $userRoleParent = PrivilegeUtil::getRoleDetail($userRole)['parentrole'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        fwrite($handle, $newBuf);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                public static function createUserSharingPrivilegesfile($userid)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if ('on' == $userFocus->is_admin) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 130 characters
                            Open

                                            $sharingPrivileges['permission']['Contacts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 207 characters
                            Open

                                            $newBuf .= "\$Accounts_HelpDesk_share_read_permission=array('ROLE'=>" . Utils::varExport($accTktShareReadPer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accTktShareReadPer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= 'return ' . Utils::varExport($sharingPrivileges) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

                            Line exceeds 120 characters; contains 162 characters
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                            if (!isset($grpWritePer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                        if (!isset($grpReadPer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    //Populating Values into the temp related sharing tables
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $tableName = 'vtiger_tmp_write_user_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

                            Line exceeds 120 characters; contains 126 characters
                            Open

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if ('read' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                public static function recalculateAll(): int
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            if (isset($userFocus->{$field})) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    $userInfo[$field] = is_numeric($userFocus->{$field}) ? $userFocus->{$field} : \App\Purifier::encodeHtml($userFocus->{$field});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $subRoles = PrivilegeUtil::getRoleSubordinates($userRole);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($subRoles as $subRoleId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 122 characters
                            Open

                                            $newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        fclose($handle);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 134 characters
                            Open

                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $newBuf = "<?php\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $userFocus = \CRMEntity::getInstance('Users');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 203 characters
                            Open

                                            $newBuf .= "\$Accounts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 130 characters
                            Open

                                            $sharingPrivileges['permission']['Accounts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            //Constructing the Account Ticket Related Module Sharing Array
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $accTktShareReadPer = $acctRelatedTkt['read'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            User::clearCache($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    $shareModId = Module::getModuleId($share_mod);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                ->where([
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                $roleWritePer[$shareEntId] = $shareRoleUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                } elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                $grpReadPer[$shareEntId] = $shareGrpUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                            foreach ($tabIdArr as $tabId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        foreach ($userFocus->column_fields as $field => $value) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$is_admin=false;\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$current_user_parent_role_seq='" . $userRoleParent . "';\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        PrivilegeFile::createUserPrivilegesFile($userid);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $relatedModuleShare = PrivilegeUtil::getDatashareRelatedModules();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $newBuf .= "\$Accounts_share_write_permission=array('ROLE'=>" . Utils::varExport($accountShareWritePer['ROLE']) . ",'GROUP'=>" . Utils::varExport($accountShareWritePer['GROUP']) . ");\n";
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $sharingPrivileges['permission'][$moduleName] = ['read' => $modShareReadPerm, 'write' => $modShareWritePerm];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            $sharePermission = (new Db\Query())->select(['vtiger_datashare_relatedmodule_permission.permission'])
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 199 characters
                            Open

                                                ->innerJoin('vtiger_datashare_relatedmodules', 'vtiger_datashare_relatedmodules.datashare_relatedmodule_id = vtiger_datashare_relatedmodule_permission.datashare_relatedmodule_id')
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                    $shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                } elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                            if (!isset($grpReadPer[$shareEntId])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                            $tableName = 'vtiger_tmp_write_user_rel_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            //Populating Temp Tables
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                $roleReadPer[$shareEntId] = $shareRoleUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                        if (!isset($grpReadPer[$subgrpid])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                            $grpWritePer[$subgrpid] = $subgrpusers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $modShareReadPermission['ROLE'] = $roleReadPer;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $relatedModSharingPermission['read'] = $modShareReadPermission;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        } elseif ('write' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            fwrite($handle, $newBuf);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $modShareWritePermission['ROLE'] = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    $modShareWritePermission['GROUP'] = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        if (1 == $sharePermission) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                $roleReadPer[$shareEntId] = $shareRoleUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                            $grpReadPer[$subgrpid] = $subgrpusers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    foreach ($tableArr as $tableName) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if (!empty($relTabName)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    if ('USER' === $enttype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if (!empty($varArr['GROUP'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                    $grpArr[] = $groupId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        if ('read' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($varArr['GROUP'] as $groupId => $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    foreach ($related_module_share as $relTabId => $tabIdArr) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $tabName = Module::getModuleName($tabId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                    $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'sharedgroupid' => $groupId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                 * Reload user privileges file by multi company id.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    Utils::varExport($modShareWritePerm['ROLE']) . ",'GROUP'=>" .
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                 * Gives an array which contains the information for what all roles,
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    $modShareReadPermission['ROLE'] = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        foreach ($mod_sharingrule_members as $sharingid => $sharingInfoArr) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                ->innerJoin('vtiger_datashare_relatedmodules', 'vtiger_datashare_relatedmodules.datashare_relatedmodule_id = vtiger_datashare_relatedmodule_permission.datashare_relatedmodule_id')
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        if (1 == $sharePermission) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                                    $shareGrpUsers = $usersByGroup['users'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                                $grpWritePer[$shareEntId] = $shareGrpUsers;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

                            Line exceeds 120 characters; contains 333 characters
                            Open

                                    $tableArr = ['vtiger_tmp_read_user_sharing_per', 'vtiger_tmp_write_user_sharing_per', 'vtiger_tmp_read_group_sharing_per', 'vtiger_tmp_write_group_sharing_per', 'vtiger_tmp_read_user_rel_sharing_per', 'vtiger_tmp_write_user_rel_sharing_per', 'vtiger_tmp_read_group_rel_sharing_per', 'vtiger_tmp_write_group_rel_sharing_per'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                 * Function to populate the read/wirte Sharing permissions data for the specified user into the database.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $tableName = 'vtiger_tmp_read_user_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            foreach ($varArr['GROUP'] as $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($varArr['GROUP'] as $groupId => $grpusers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    } elseif ('GROUP' === $enttype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    foreach (MultiCompany::getUsersByCompany($companyId) as $userId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        $dbCommand->delete($tableName, ['userid' => $userid])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    foreach ($sharingArray as $module) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $moduleSharingWritePermvar = $module . '_share_write_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        static::populateSharingPrivileges('GROUP', $userid, $module, 'read', ${$moduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 143 characters
                            Open

                                                static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        } elseif ('write' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        $useArrr[] = $sharedUserId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    } elseif ('GROUP' === $enttype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $tableName = 'vtiger_tmp_read_group_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        if (!empty($varArr['ROLE'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            $tableName = 'vtiger_tmp_read_group_rel_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        $moduleSharingReadPermvar = $module . '_share_read_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 142 characters
                            Open

                                                static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        if (!empty($varArr['ROLE'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        } elseif ('write' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        } elseif ('write' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                if (!\in_array($groupId, $grpArr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    $grpArr[] = $groupId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        $modShareWritePermission['ROLE'] = $roleWritePer;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $modShareWritePermission['GROUP'] = $grpWritePer;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    require 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        static::populateSharingPrivileges('USER', $userid, $module, 'read', ${$moduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        static::populateSharingPrivileges('GROUP', $userid, $module, 'write', ${$moduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                        if ('read' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                    if (!\in_array($sharedUserId, $useArrr) && $userId != $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 145 characters
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        if (!empty($varArr['GROUP'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                if (!\in_array($groupId, $grpArr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                    if (!\in_array($sharedUserId, $userArr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    // Look up for modules for which sharing access is enabled.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 144 characters
                            Open

                                                static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                 * Function to populate the read/wirte Sharing permissions related module data for the specified user into the database.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 174 characters
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $modShareReadPermission['GROUP'] = $grpReadPer;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    //Deleting from the existing vtiger_tables
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                            foreach ($varArr['ROLE'] as $roleUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

                            Line exceeds 120 characters; contains 124 characters
                            Open

                                 * Function to populate the read/wirte Sharing permissions related module data for the specified user into the database.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    $relTabId = Module::getModuleId($relmodule);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                        static::populateSharingPrivileges('USER', $userid, $module, 'write', ${$moduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                        $relTabName = Module::getModuleName($relTabId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 145 characters
                            Open

                                                static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                foreach ($grpUsers as $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                    if ('USER' === $enttype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                            foreach ($varArr['ROLE'] as $roleUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                foreach ($roleUsers as $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

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

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

                                            foreach ($varArr['GROUP'] as $grpUsers) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                public static function reloadByMultiCompany(int $companyId)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 125 characters
                            Open

                                /** Function to populate the read/wirte Sharing permissions data of user/groups for the specified user into the database.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                    $tableArr = ['vtiger_tmp_read_user_sharing_per', 'vtiger_tmp_write_user_sharing_per', 'vtiger_tmp_read_group_sharing_per', 'vtiger_tmp_write_group_sharing_per', 'vtiger_tmp_read_user_rel_sharing_per', 'vtiger_tmp_write_user_rel_sharing_per', 'vtiger_tmp_read_group_rel_sharing_per', 'vtiger_tmp_write_group_rel_sharing_per'];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                                $relmoduleSharingWritePermvar = $tabName . '_' . $relTabName . '_share_write_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

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

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

                                                        $useArrr[] = $sharedUserId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 137 characters
                            Open

                                                    $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'sharedgroupid' => $groupId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

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

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

                                                        $userArr[] = $sharedUserId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

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

                                    }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                    if (!\in_array($sharedUserId, $userArr) && $userId != $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                        $userArr[] = $sharedUserId;
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 174 characters
                            Open

                                                        $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                            }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                    $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'sharedgroupid' => $groupId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        static::createUserPrivilegesfile($userId);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                /** Function to populate the read/wirte Sharing permissions data of user/groups for the specified user into the database.
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                public static function populateSharingtmptables($userid)
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                    $modules = \vtlib\Functions::getAllModules(true, true, 0, false, 0);
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                $relmoduleSharingReadPermvar = $tabName . '_' . $relTabName . '_share_read_permission';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                    if (!\in_array($sharedUserId, $useArrr)) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        if ('read' === $pertype) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                 * @param mixed  $userId
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                            $tableName = 'vtiger_tmp_read_user_rel_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        if (!empty($varArr['GROUP'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                            $tableName = 'vtiger_tmp_write_group_rel_sharing_per';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        if (!empty($varArr['GROUP'])) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Line exceeds 120 characters; contains 166 characters
                            Open

                                                    $dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'sharedgroupid' => $groupId])->execute();
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                            }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                    }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                 */
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                                foreach ($grpUsers as $sharedUserId) {
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            Spaces must be used to indent lines; tabs are not allowed
                            Open

                                        }
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpcodesniffer

                            The variable $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $related_module_share is not named in camelCase.
                            Open

                                public static function populateSharingtmptables($userid)
                                {
                                    $dbCommand = \App\Db::getInstance()->createCommand();
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
                            
                            
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $current_user_groups is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_sharingrule_members is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $share_mod is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $current_user_roles is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $current_user_roles is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $parent_roles is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $par_mod is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $def_org_share is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $parent_roles is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.php by phpmd

                            CamelCaseVariableName

                            Since: 0.2

                            It is considered best practice to use the camelCase notation to name variables.

                            Example

                            class ClassName {
                                public function doSomething() {
                                    $data_module = new DataModule();
                                }
                            }

                            Source

                            The variable $current_user_groups is not named in camelCase.
                            Open

                                public static function createUserSharingPrivilegesfile($userid)
                                {
                                    \vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
                                    require 'user_privileges/user_privileges_' . $userid . '.php';
                                    $fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_write_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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 $mod_share_read_per is not named in camelCase.
                            Open

                                public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
                                {
                                    $relatedModSharingPermission = [];
                                    $modShareReadPermission = [];
                                    $modShareWritePermission = [];
                            Severity: Minor
                            Found in app/UserPrivilegesFile.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