File Services_Upgrade_Users.php
has 372 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class Services_Upgrade_Users
{
private $_dbCon;
Method updateUserPreferences
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateUserPreferences()
{
$userList = $this->_userDao->getUserList();
// loop through every user and fix it
Method updateSecurityGroups
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateSecurityGroups($forceReset)
{
// DB connectie
$dbCon = $this->_dbCon;
Function resetUserGroupMembership
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function resetUserGroupMembership($systemType)
{
// DB connection
$dbCon = $this->_dbCon;
- 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 updateUserFilters
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateUserFilters($forceReset)
{
if (($this->_settings->get('securityversion') < 0.12) || $forceReset) {
// DB connection
$dbCon = $this->_dbCon;
Function updateSecurityGroups
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function updateSecurityGroups($forceReset)
{
// DB connectie
$dbCon = $this->_dbCon;
- 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 updateUserPreferences
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function updateUserPreferences()
{
$userList = $this->_userDao->getUserList();
// loop through every user and fix it
- 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 resetUserGroupMembership
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resetUserGroupMembership($systemType)
{
// DB connection
$dbCon = $this->_dbCon;