spotweb/spotweb

View on GitHub
lib/services/Upgrade/Services_Upgrade_Users.php

Summary

Maintainability
D
2 days
Test Coverage

File Services_Upgrade_Users.php has 372 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

class Services_Upgrade_Users
{
    private $_dbCon;
Severity: Minor
Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 4 hrs to fix

    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
    Severity: Major
    Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 3 hrs to fix

      Method updateSecurityGroups has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateSecurityGroups($forceReset)
          {
              // DB connectie
              $dbCon = $this->_dbCon;
      
      
      Severity: Major
      Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 2 hrs to fix

        Function resetUserGroupMembership has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function resetUserGroupMembership($systemType)
            {
                // DB connection
                $dbCon = $this->_dbCon;
        
        
        Severity: Minor
        Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

        Method 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;
        Severity: Minor
        Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 1 hr to fix

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

              public function updateSecurityGroups($forceReset)
              {
                  // DB connectie
                  $dbCon = $this->_dbCon;
          
          
          Severity: Minor
          Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function 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
          Severity: Minor
          Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 1 hr to fix

          Cognitive Complexity

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

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

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

          Further reading

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

              public function resetUserGroupMembership($systemType)
              {
                  // DB connection
                  $dbCon = $this->_dbCon;
          
          
          Severity: Minor
          Found in lib/services/Upgrade/Services_Upgrade_Users.php - About 1 hr to fix

            There are no issues that match your filters.

            Category
            Status