e107inc/e107

View on GitHub

Showing 571 of 6,975 total issues

Consider simplifying this complex logical expression.
Open

        if($field['type'] === 'method' && !empty($field['data']) && ($field['data'] === 'string' || $field['data'] === 'str' || $field['data'] === 'safestr' || $field['data'] === 'int'))
        {
            $searchable_types[] = 'method';
        }
Severity: Major
Found in e107_handlers/admin_ui.php - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

            if (strpos($file, 'http') === 0)
            {
                $path = $file;
            }
            elseif (strpos($file, 'e_MEDIA') !== false || strpos($file, 'e_THEME') !== false || strpos($file, 'e_PLUGIN') !== false || strpos($file, '{e_IMAGE}') !== false) //v2.x path.
    Severity: Major
    Found in e107_handlers/e_parse_class.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                  if (($category == 0) || ($isSignup && (int) $this->catDefinitions[$category]['user_extended_struct_applicable'] === (int) e_UC_MEMBER && (int) $this->catDefinitions[$category]['user_extended_struct_write'] === (int) e_UC_MEMBER) || (check_class($this->catDefinitions[$category]['user_extended_struct_applicable']) && check_class($this->catDefinitions[$category]['user_extended_struct_write'])))
                  {    // Category applicable to user
                      
                      if (($isSignup && (int) $defs['user_extended_struct_applicable'] === (int) e_UC_MEMBER && (int) $defs['user_extended_struct_write'] === (int) e_UC_MEMBER) || (check_class($defs['user_extended_struct_applicable']) && check_class($defs['user_extended_struct_write'])))
                      {    // User can also update field
      Severity: Major
      Found in e107_handlers/user_extended_class.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if($def == 'legacyCustom' || $def=='legacyDefault' )  // 0.6 themes.
            {
              //    echo "MODE 0.6";
                if($def == 'legacyCustom')
                {
        Severity: Major
        Found in e107_core/templates/header_default.php - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                          if (!array_key_exists($uc_id,$this->fixed_classes)
                          && (   getperms('0')
                              || (
                                  (!isset($opt_arr['matchclass']) || check_class($uc_id))
                                  &&
          Severity: Major
          Found in e107_handlers/userclass_class.php - About 40 mins to fix

            Consider simplifying this complex logical expression.
            Open

                        if((isset($_POST['e-token']) && !$this->checkFormToken($_POST['e-token']))
                        || (isset($_GET['e-token']) && !$this->checkFormToken($_GET['e-token']))
                        || (isset($_POST['e_token']) && !$this->checkFormToken($_POST['e_token']))) // '-' is not allowed in jquery. b
                        {
                            $this->log('Unauthorized access!');
            Severity: Major
            Found in e107_handlers/session_handler.php - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                      if((!empty($parm) && !empty($mandatory[$parm]) && (int) $pref[$mandatory[$parm]] === 2) || $parm === 'true' || ($parm === 'email' && empty($pref['disable_emailcheck'])))
                      {
                          return "<span class='required'><!-- empty --></span>";
                      }
              Severity: Major
              Found in e107_core/shortcodes/batch/signup_shortcodes.php - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                                    if((!strpos($pref['download_denied'], ".php") &&
                                        !strpos($pref['download_denied'], ".htm") &&
                                        !strpos($pref['download_denied'], ".html") &&
                                        !strpos($pref['download_denied'], ".shtml") ||
                                        (strpos($pref['download_denied'], "signup.php") && USER == true)
                Severity: Major
                Found in e107_plugins/download/request.php - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((isset($_POST['newthread']) && trim($_POST['subject']) == '') || trim($_POST['post']) == '')
                          {
                              message_handler('ALERT', 5);
                          }
                          else
                  Severity: Major
                  Found in e107_plugins/forum/forum_post.php - About 40 mins to fix

                    Method parsesearch has 8 arguments (exceeds 7 allowed). Consider refactoring.
                    Open

                        public function parsesearch($table, $return_fields, $search_fields, $weights, $handler, $no_results, $where, $order)
                    Severity: Major
                    Found in e107_handlers/search_class.php - About 35 mins to fix

                      Method form_text has 8 arguments (exceeds 7 allowed). Consider refactoring.
                      Open

                          public function form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = 'tbox form-control', $form_readonly = '', $form_tooltip = '', $form_js = '') {
                      Severity: Major
                      Found in e107_handlers/form_handler.php - About 35 mins to fix

                        Method renderInline has 8 arguments (exceeds 7 allowed). Consider refactoring.
                        Open

                            public function renderInline($dbField, $pid, $fieldName, $curVal, $linkText, $type='text', $array=null, $options=array())
                        Severity: Major
                        Found in e107_handlers/form_handler.php - About 35 mins to fix

                          Method form_password has 8 arguments (exceeds 7 allowed). Consider refactoring.
                          Open

                              public function form_password($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = 'tbox form-control', $form_readonly = '', $form_tooltip = '', $form_js = '') {
                          Severity: Major
                          Found in e107_handlers/form_handler.php - About 35 mins to fix

                            Method addEvent has 8 arguments (exceeds 7 allowed). Consider refactoring.
                            Open

                                public function addEvent($importance, $source_call, $eventcode = 'GEN', $event_title = 'Untitled', $explain = '', $finished = FALSE, $target_logs = LOG_TO_AUDIT, $userData=null )
                            Severity: Major
                            Found in e107_handlers/admin_log_class.php - About 35 mins to fix

                              Method e_log_event has 8 arguments (exceeds 7 allowed). Consider refactoring.
                              Open

                                  public function e_log_event($importance, $source_call, $eventcode = 'GEN', $event_title = 'Untitled', $explain = '', $finished = FALSE, $target_logs = LOG_TO_AUDIT, $userData=null )
                              Severity: Major
                              Found in e107_handlers/admin_log_class.php - About 35 mins to fix

                                Method compose_comment has 8 arguments (exceeds 7 allowed). Consider refactoring.
                                Open

                                    function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE, $return = FALSE, $tablerender = TRUE)
                                Severity: Major
                                Found in e107_handlers/comment_class.php - About 35 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                              return;
                                  Severity: Major
                                  Found in e107_admin/db.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                            if ($just_check) return update_needed('Rename dblog to admin_log');
                                    Severity: Major
                                    Found in e107_admin/update_routines.php - About 30 mins to fix

                                      Avoid too many return statements within this method.
                                      Open

                                              if ($just_check) return update_needed('Import '.count($dl_files).' Download File(s) and '.count($public_files).' Public File(s) into Media Manager');
                                      Severity: Major
                                      Found in e107_admin/update_routines.php - About 30 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                    return $ret;
                                        Severity: Major
                                        Found in e107_admin/lancheck.php - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language