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 = [];
- Read upRead up
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)) {
- Read upRead up
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);
- Read upRead up
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;
/**
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 = [];
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.
- Exclude checks
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) {
- Read upRead up
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';
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) {
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);
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)) {
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');
Method populateRelatedSharingPrivileges
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
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');
- Read upRead up
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)
Avoid deeply nested control flow statements. Open
if (!isset($grpWritePer[$subgrpid])) {
$grpWritePer[$subgrpid] = $subgrpusers;
}
Avoid deeply nested control flow statements. Open
if (!isset($grpReadPer[$subgrpid])) {
$grpReadPer[$subgrpid] = $subgrpusers;
}
Avoid deeply nested control flow statements. Open
if (!isset($grpReadPer[$subgrpid])) {
$grpReadPer[$subgrpid] = $subgrpusers;
}
Method populateSharingPrivileges
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
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';
- Read upRead up
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);
- Read upRead up
- Exclude checks
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)) {
- Read upRead up
- Exclude checks
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 = [];
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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)) {
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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.
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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});
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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
}
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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});
}
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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']);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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'=>" .
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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])) {
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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])) {
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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'=>" .
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
}
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
}
- Read upRead up
- Exclude checks
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])) {
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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";
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
}
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access 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';
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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];
- Read upRead up
- Exclude checks
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";
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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) {
- Read upRead up
- Exclude checks
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};
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$userIds = (new Db\Query())->select(['id'])->from('vtiger_users')->where(['deleted' => 0])->column();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Variable $current_user_roles
is undeclared Open
$accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['ROLE'] as $roleUsers) {
- Exclude checks
Reference to undeclared property \CRMEntity->id
Open
$userFocus->id = $userid;
- Exclude checks
Saw misspelled annotation @returns.
Did you mean @return?
Open
* @returns sharing_privileges_userid file under the user_privileges directory
- Exclude checks
Call to method clearCache
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
User::clearCache($userid);
- Exclude checks
Variable $current_user_groups
is undeclared Open
$accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['GROUP'] as $groupId => $grpusers) {
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['GROUP'] as $groupId => $grpUsers) {
- Exclude checks
Variable $related_module_share
is undeclared Open
foreach ($related_module_share as $relTabId => $tabIdArr) {
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Saw misspelled annotation @returns.
Did you mean @return?
Open
* @returns User_Privileges_Userid file under the User_Privileges Directory
- Exclude checks
Call to method clearCache
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
User::clearCache($userid);
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['GROUP'] as $grpUsers) {
- Exclude checks
Reference to undeclared property \CRMEntity->column_fields
Open
foreach ($userFocus->column_fields as $field => $value) {
- Exclude checks
Variable $current_user_roles
is undeclared Open
$modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['ROLE'] as $roleUsers) {
- Exclude checks
Reference to undeclared property \CRMEntity->is_admin
Open
if ('on' == $userFocus->is_admin) {
- Exclude checks
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
- Exclude checks
Reference to undeclared property \CRMEntity->column_fields
Open
$userFocus->column_fields['id'] = '';
- Exclude checks
Reference to undeclared property \CRMEntity->is_admin
Open
if ('on' == $userFocus->is_admin) {
- Exclude checks
Variable $current_user_groups
is undeclared Open
$modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Variable $parent_roles
is undeclared Open
$modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$sharePermission = (new Db\Query())->select(['vtiger_datashare_relatedmodule_permission.permission'])
- Exclude checks
Variable $parent_roles
is undeclared Open
$accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Expected @param annotation for userId
to be before the @param annotation for module
Open
* @param string $module
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Suspicious array access to true
Open
foreach ($varArr['GROUP'] as $grpUsers) {
- Exclude checks
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];
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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];
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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];
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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];
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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)
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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'];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userInfo[$field] = $userFocus->{$field};
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('on' == $userFocus->is_admin) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates a file with all the organization default sharing permissions
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require 'user_privileges/user_privileges_' . $userid . '.php';
- Exclude checks
Line exceeds 120 characters; contains 176 characters Open
$accountSharePerArray = PrivilegeUtil::getUserModuleSharingObjects('Accounts', $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountShareReadPer = $accountSharePerArray['read'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::createUserSharingPrivilegesfile($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function createUserPrivilegesfile($userid)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($handle) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('currency_symbol' === $field || $field === 'imagename'|| $field === 'othereventduration') {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$profileGlobalPermission=' . Utils::varExport($globalPermissionArr) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$subordinate_roles=' . Utils::varExport($subRoles) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$defaultOrgSharingPermission=' . Utils::varExport($defOrgShare) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['permission']['Accounts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPerm = $modSharePermArray['read'];
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
$fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= "<?php\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus = \CRMEntity::getInstance('Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus->retrieveEntityInfo($userid, 'Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subRoleAndUsers = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= "\$current_user_roles='" . $userRole . "';\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$parent_roles=' . Utils::varExport($parentRoles) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['defOrgShare'] = $defOrgShare;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['relatedModuleShare'] = $relatedModuleShare;
- Exclude checks
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";
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePerm = $modSharePermArray['write'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::createUserPrivilegesfile($id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \count($userIds);
- Exclude checks
Line exceeds 120 characters; contains 150 characters Open
$userInfo[$field] = is_numeric($userFocus->{$field}) ? $userFocus->{$field} : \App\Purifier::encodeHtml($userFocus->{$field});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$globalPermissionArr = PrivilegeUtil::getCombinedUserGlobalPermissions($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @returns sharing_privileges_userid file under the user_privileges directory
- Exclude checks
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";
- Exclude checks
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();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabsPermissionArr = PrivilegeUtil::getCombinedUserModulesPermissions($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subRoleAndUsers[$subRoleId] = \App\PrivilegeUtil::getUsersNameByRole($subRoleId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentRoles = PrivilegeUtil::getParentRole($userRole);
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
$newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$profileActionPermission=' . Utils::varExport($actionPermissionArr) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
- Exclude checks
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";
- Exclude checks
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);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parModId = Module::getModuleId($par_mod);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpReadPer = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_datashare_relatedmodule_permission')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_datashare_relatedmodule_permission.shareid' => $sharingid,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= "\$is_admin=true;\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$actionPermissionArr = PrivilegeUtil::getCombinedUserActionsPermissions($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$current_user_profiles=' . Utils::varExport(PrivilegeUtil::getProfilesByRole($userRole)) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountSharingruleMembers = $accountSharePerArray['sharingrules'];
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Constructing Contact Sharing Rules
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$sharingPrivileges['permission']['Accounts_HelpDesk'] = ['read' => $accTktShareReadPer, 'write' => $accTktShareWriteer];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus->column_fields['id'] = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$profileTabsPermission=' . Utils::varExport($tabsPermissionArr) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
User::clearCache($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::resetFileCache($fileUserPrivileges);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fclose($handle);
- Exclude checks
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);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['permission']['Contacts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$acctRelatedTkt = static::getRelatedModuleSharingArray('Accounts', 'HelpDesk', $accountSharingruleMembers, $accountShareReadPer, $accountShareWritePer, $defOrgShare);
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateSharingtmptables($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->scalar();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($shareEntArr as $shareEntId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($roleReadPer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fwrite($handle, $newBuf);
- Exclude checks
Line exceeds 120 characters; contains 182 characters Open
$acctRelatedTkt = static::getRelatedModuleSharingArray('Accounts', 'HelpDesk', $accountSharingruleMembers, $accountShareReadPer, $accountShareWritePer, $defOrgShare);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accTktShareWriteer = $acctRelatedTkt['write'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['permission']['Accounts_HelpDesk'] = ['read' => $accTktShareReadPer, 'write' => $accTktShareWriteer];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('ROLE' == $shareType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$handle = fopen($fileUserPrivileges, 'w+');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$customModules = Module::getSharingModuleList(['Accounts', 'Contacts']);
- Exclude checks
Line exceeds 120 characters; contains 178 characters Open
$modSharePermArray = PrivilegeUtil::getUserModuleSharingObjects($moduleName, $userid, $defOrgShare, $current_user_roles, $parent_roles, $current_user_groups);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$' . $moduleName . "_share_write_permission=['ROLE'=>" .
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// END
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $def_org_share
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($grpWritePer[$subgrpid])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($userIds as $id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$subordinate_roles_users=' . Utils::varExport($subRoleAndUsers) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$related_module_share=' . Utils::varExport($relatedModuleShare) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fclose($handle);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::resetFileCache($fileUserSharingPrivileges);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $par_mod
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $usersByGroup['users'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $usersByGroup['users'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Utils::varExport($modShareWritePerm['GROUP']) . "];\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePermission = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPermission['GROUP'] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_datashare_relatedmodules.relatedto_tabid' => $shareModId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($sharingInfoArr as $shareType => $shareEntArr) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (0 == $sharePermission && 3 == $def_org_share[$shareModId]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('GROUP' == $shareType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @returns User_Privileges_Userid file under the User_Privileges Directory
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($handle) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus->retrieveEntityInfo($userid, 'Users');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Constructig the Default Org Share Array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defOrgShare = PrivilegeUtil::getAllDefaultSharingAction();
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Utils::varExport($modShareReadPerm['ROLE']) . ",'GROUP'=>" .
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPermission = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($roleWritePer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (3 == $def_org_share[$shareModId] && !isset($grpReadPer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Users_Privileges_Model::clearCache($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$handle = fopen($fileUserSharingPrivileges, 'w+');
- Exclude checks
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";
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$sharingPrivileges['permission'][$moduleName] = ['read' => $modShareReadPerm, 'write' => $modShareWritePerm];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (3 == $def_org_share[$shareModId] || 0 == $def_org_share[$shareModId]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$roleReadPer = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_write_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (0 == $sharePermission && 3 == $def_org_share[$shareModId]) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpReadPer[$subgrpid] = $subgrpusers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to recalculate the Sharing Rules for all the vtiger_users
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus->id = $userid;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userRole = PrivilegeUtil::getRoleByUsers($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* and custom sharing permissins specific for the specified user.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/user_privileges_' . $userid . '.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Constructing Account Sharing Rules
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accountShareWritePer = $accountSharePerArray['write'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($customModules as $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$' . $moduleName . "_share_read_permission=['ROLE'=>" .
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Utils::varExport($modShareReadPerm['GROUP']) . "];\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpWritePer = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'vtiger_datashare_relatedmodules.tabid' => $parModId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (3 == $def_org_share[$shareModId] && !isset($roleReadPer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpReadPer[$shareEntId] = $shareGrpUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModSharingPermission['write'] = $modShareWritePermission;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $relatedModSharingPermission;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingArray = array_column($modules, 'name');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($roleUsers as $sharedUserId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_write_group_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $relmodule
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $varArr
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userInfo = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userRoleParent = PrivilegeUtil::getRoleDetail($userRole)['parentrole'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fwrite($handle, $newBuf);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function createUserSharingPrivilegesfile($userid)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('on' == $userFocus->is_admin) {
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$sharingPrivileges['permission']['Contacts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= 'return ' . Utils::varExport($sharingPrivileges) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
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)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['ROLE'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($grpWritePer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($mod_share_read_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_write_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($grpReadPer[$subgrpid])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Populating Values into the temp related sharing tables
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $pertype
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_write_user_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$useArrr = [];
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('read' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function recalculateAll(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($userFocus->{$field})) {
- Exclude checks
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});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$subRoles = PrivilegeUtil::getRoleSubordinates($userRole);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($subRoles as $subRoleId) {
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$newBuf .= '$current_user_groups=' . Utils::varExport(PrivilegeUtil::getAllGroupsByUser($userid)) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fclose($handle);
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$fileUserSharingPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/sharing_privileges_' . $userid . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf = "<?php\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userFocus = \CRMEntity::getInstance('Users');
- Exclude checks
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";
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$sharingPrivileges['permission']['Accounts'] = ['read' => $accountShareReadPer, 'write' => $accountShareWritePer];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Constructing the Account Ticket Related Module Sharing Array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$accTktShareReadPer = $acctRelatedTkt['read'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
User::clearCache($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModSharingPermission = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareModId = Module::getModuleId($share_mod);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = $mod_share_read_per['ROLE'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareRoleUsers = PrivilegeUtil::getUsersByRole($shareEntId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$roleWritePer[$shareEntId] = $shareRoleUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpReadPer[$shareEntId] = $shareGrpUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($tabIdArr as $tabId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($userFocus->column_fields as $field => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= "\$is_admin=false;\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= "\$current_user_parent_role_seq='" . $userRoleParent . "';\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBuf .= '$user_info=' . Utils::varExport($userInfo) . ";\n";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
PrivilegeFile::createUserPrivilegesFile($userid);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModuleShare = PrivilegeUtil::getDatashareRelatedModules();
- Exclude checks
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";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharingPrivileges['permission'][$moduleName] = ['read' => $modShareReadPerm, 'write' => $modShareWritePerm];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $mod_share_read_per
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sharePermission = (new Db\Query())->select(['vtiger_datashare_relatedmodule_permission.permission'])
- Exclude checks
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')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $mod_share_read_per['GROUP'][$shareEntId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($mod_share_write_per['GROUP'][$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($grpReadPer[$shareEntId])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_write_user_rel_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Populating Temp Tables
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $mod_sharingrule_members
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$roleReadPer[$shareEntId] = $shareRoleUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($grpReadPer[$subgrpid])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpWritePer[$subgrpid] = $subgrpusers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPermission['ROLE'] = $roleReadPer;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedModSharingPermission['read'] = $modShareReadPermission;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function populateSharingPrivileges($enttype, $userId, $module, $pertype, $varArr = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($varArr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('write' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
fwrite($handle, $newBuf);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $mod_share_write_per
- Exclude checks
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)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePermission['ROLE'] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePermission['GROUP'] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 == $sharePermission) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$roleReadPer[$shareEntId] = $shareRoleUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($usersByGroup['subGroups'] as $subgrpid => $subgrpusers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpReadPer[$subgrpid] = $subgrpusers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$usersByGroup = PrivilegeUtil::getUsersByGroup($shareEntId, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\vtlib\Deprecated::checkFileAccessForInclusion('user_privileges/sharing_privileges_' . $userid . '.php');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($tableArr as $tableName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($relTabName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param bool $varArr
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('USER' === $enttype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['GROUP'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpArr[] = $groupId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('read' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['GROUP'] as $groupId => $grpUsers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($related_module_share as $relTabId => $tabIdArr) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabName = Module::getModuleName($tabId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'sharedgroupid' => $groupId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Reload user privileges file by multi company id.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Utils::varExport($modShareWritePerm['ROLE']) . ",'GROUP'=>" .
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gives an array which contains the information for what all roles,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $share_mod
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPermission['ROLE'] = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$roleWritePer = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($mod_sharingrule_members as $sharingid => $sharingInfoArr) {
- Exclude checks
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')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 == $sharePermission) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$shareGrpUsers = $usersByGroup['users'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpWritePer[$shareEntId] = $shareGrpUsers;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
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'];
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_read_user_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['GROUP'] as $grpUsers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['GROUP'] as $groupId => $grpusers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $enttype
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('GROUP' === $enttype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpArr = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (MultiCompany::getUsersByCompany($companyId) as $userId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->delete($tableName, ['userid' => $userid])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($sharingArray as $module) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleSharingWritePermvar = $module . '_share_write_permission';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateSharingPrivileges('GROUP', $userid, $module, 'read', ${$moduleSharingReadPermvar});
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('write' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$useArrr[] = $sharedUserId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('GROUP' === $enttype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_read_group_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $module
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['ROLE'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_read_group_rel_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleSharingReadPermvar = $module . '_share_read_permission';
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['ROLE'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('write' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabId = Module::getModuleId($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('write' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($groupId, $grpArr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpArr[] = $groupId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePermission['ROLE'] = $roleWritePer;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareWritePermission['GROUP'] = $grpWritePer;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
require 'user_privileges/sharing_privileges_' . $userid . '.php';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateSharingPrivileges('USER', $userid, $module, 'read', ${$moduleSharingReadPermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateSharingPrivileges('GROUP', $userid, $module, 'write', ${$moduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('read' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($sharedUserId, $useArrr) && $userId != $sharedUserId) {
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['GROUP'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($groupId, $grpArr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($sharedUserId, $userArr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $companyId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Look up for modules for which sharing access is enabled.
- Exclude checks
Line exceeds 120 characters; contains 144 characters Open
static::populateRelatedSharingPrivileges('USER', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'read', ${$relmoduleSharingReadPermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $enttype
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($varArr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Line exceeds 120 characters; contains 174 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modShareReadPermission['GROUP'] = $grpReadPer;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Deleting from the existing vtiger_tables
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['ROLE'] as $roleUsers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$grpArr = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relTabId = Module::getModuleId($relmodule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::populateSharingPrivileges('USER', $userid, $module, 'write', ${$moduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relTabName = Module::getModuleName($relTabId);
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
static::populateRelatedSharingPrivileges('GROUP', $userid, $tabName, $relTabName, 'write', ${$relmoduleSharingWritePermvar});
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($grpUsers as $sharedUserId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $pertype
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('USER' === $enttype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['ROLE'] as $roleUsers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($roleUsers as $sharedUserId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($varArr['GROUP'] as $grpUsers) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function reloadByMultiCompany(int $companyId)
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
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'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relmoduleSharingWritePermvar = $tabName . '_' . $relTabName . '_share_write_permission';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabId = Module::getModuleId($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$useArrr[] = $sharedUserId;
- Exclude checks
Line exceeds 120 characters; contains 137 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'sharedgroupid' => $groupId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function populateRelatedSharingPrivileges($enttype, $userId, $module, $relmodule, $pertype, $varArr = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userArr = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userArr[] = $sharedUserId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($sharedUserId, $userArr) && $userId != $sharedUserId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userArr[] = $sharedUserId;
- Exclude checks
Line exceeds 120 characters; contains 174 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'shareduserid' => $sharedUserId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'sharedgroupid' => $groupId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
static::createUserPrivilegesfile($userId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
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.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function populateSharingtmptables($userid)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$modules = \vtlib\Functions::getAllModules(true, true, 0, false, 0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relmoduleSharingReadPermvar = $tabName . '_' . $relTabName . '_share_read_permission';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\in_array($sharedUserId, $useArrr)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('read' === $pertype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $userId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_read_user_rel_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['GROUP'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = 'vtiger_tmp_write_group_rel_sharing_per';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($varArr['GROUP'])) {
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
$dbCommand->insert($tableName, ['userid' => $userId, 'tabid' => $tabId, 'relatedtabid' => $relTabId, 'sharedgroupid' => $groupId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($grpUsers as $sharedUserId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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 = [];
- Read upRead up
- Exclude checks
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();
}
}