Admidio/admidio

View on GitHub

Showing 586 of 740 total issues

File Preferences.php has 1892 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace Admidio\UserInterface;

use ComponentUpdate;
use FileSystemUtils;
Severity: Major
Found in src/UserInterface/Preferences.php - About 5 days to fix

    File User.php has 1210 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    use Admidio\Exception;
    
    /**
     * @brief Class handle role rights, cards and other things of users
    Severity: Major
    Found in adm_program/system/classes/User.php - About 3 days to fix

      File Form.php has 930 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      namespace Admidio\UserInterface;
      
      use Admidio\Exception;
      use Database;
      Severity: Major
      Found in src/UserInterface/Form.php - About 2 days to fix

        File HtmlForm.php has 898 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        use Admidio\Exception;
        
        /**
         * @brief Creates an Admidio specific form with special elements
        Severity: Major
        Found in adm_program/system/classes/HtmlForm.php - About 2 days to fix

          Function makeSqlStatement has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
          Open

              public function makeSqlStatement(string $sourceCondition, string $columnName, string $columnType, string $fieldName): string
              {
                  $conditionComplete = $this->startDestCond($columnType, $columnName, $sourceCondition);
                  if ($conditionComplete) {
                      return $this->destCond;
          Severity: Minor
          Found in adm_program/system/classes/ConditionParser.php - About 2 days to fix

          Cognitive Complexity

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

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

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

          Further reading

          File ComponentUpdateSteps.php has 866 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          use Ramsey\Uuid\Uuid;
          use Admidio\Exception;
          
          // this must be declared for backwards compatibility. Can be removed if update scripts don't use it anymore
          Severity: Major
          Found in adm_program/system/classes/ComponentUpdateSteps.php - About 2 days to fix

            File FileSystemUtils.php has 745 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            use Admidio\Exception;
            
            /**
            Severity: Major
            Found in adm_program/system/classes/FileSystemUtils.php - About 1 day to fix

              Function sendEmail has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function sendEmail()
                  {
                      global $gSettingsManager, $gLogger, $gDebug, $gValidLogin, $gCurrentUser, $gL10n, $gDisableEmailSending;
              
                      $errorMessage = '';
              Severity: Minor
              Found in adm_program/system/classes/Email.php - About 1 day to fix

              Cognitive Complexity

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

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

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

              Further reading

              File ListConfiguration.php has 655 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              use Admidio\Exception;
              
              /**
               * @brief Class manages the list configuration
              Severity: Major
              Found in adm_program/system/classes/ListConfiguration.php - About 1 day to fix

                File events.php has 650 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 ***********************************************************************************************
                 * Show a list of all events
                 *
                Severity: Major
                Found in adm_program/modules/events/events.php - About 1 day to fix

                  Function getHtmlValue has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getHtmlValue(string $fieldNameIntern, $value, string $value2 = '')
                      {
                          global $gSettingsManager, $gL10n;
                  
                          if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
                  Severity: Minor
                  Found in adm_program/system/classes/ProfileFields.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function getSQL has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getSQL(array $options = array()): string
                      {
                          global $gL10n, $gProfileFields;
                  
                          // create array with all options
                  Severity: Minor
                  Found in adm_program/system/classes/ListConfiguration.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function setValue has a Cognitive Complexity of 68 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setValue(string $fieldNameIntern, $fieldValue, bool $checkValue = true): bool
                      {
                          global $gSettingsManager, $gL10n;
                  
                          if (!array_key_exists($fieldNameIntern, $this->mProfileFields)) {
                  Severity: Minor
                  Found in adm_program/system/classes/ProfileFields.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function convertColumnContentForOutput has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function convertColumnContentForOutput(int $columnNumber, string $format, string $content, string $userUuid, bool $setSortValue = true)
                      {
                          global $gDb, $gProfileFields, $gL10n, $gSettingsManager;
                  
                          $column = $this->getColumnObject($columnNumber);
                  Severity: Minor
                  Found in adm_program/system/classes/ListConfiguration.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function createContentCards has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function createContentCards()
                      {
                          global $gSettingsManager, $gCurrentUser, $gL10n, $gDb;
                  
                          $templateData = array();
                  Severity: Minor
                  Found in adm_program/system/classes/ModuleGroupsRoles.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function setMembership has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setMembership(int $userId, string $startDate, string $endDate, ?bool $leader = null, bool $forcePeriod = false)
                      {
                          global $gCurrentUser, $gCurrentUserId, $gCurrentSession;
                  
                          $newMembershipSaved = false;
                  Severity: Minor
                  Found in adm_program/system/classes/TableRoles.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function generate_listData has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function generate_listData()
                      {
                          global $gDb, $gProfileFields, $gL10n, $gCurrentOrgId;
                  
                          $workArray = array();
                  Severity: Minor
                  Found in adm_program/system/classes/CategoryReport.php - About 1 day to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  User has 68 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class User extends TableAccess
                  {
                      public const MAX_INVALID_LOGINS = 3;
                  
                      /**
                  Severity: Major
                  Found in adm_program/system/classes/User.php - About 1 day to fix

                    Function checkRolesRight has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function checkRolesRight(string $right = null): bool
                        {
                            $sqlFetchedRows = array();
                    
                            if ((int)$this->getValue('usr_id') === 0) {
                    Severity: Minor
                    Found in adm_program/system/classes/User.php - About 1 day to fix

                    Cognitive Complexity

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

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

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

                    Further reading

                    File profile.php has 555 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     ***********************************************************************************************
                     * Show user profile
                     *
                    Severity: Major
                    Found in adm_program/modules/profile/profile.php - About 1 day to fix
                      Severity
                      Category
                      Status
                      Source
                      Language