e107inc/e107

View on GitHub
e107_handlers/userclass_class.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
49%

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

    Avoid too many return statements within this method.
    Open

                if ($c['userclass_visibility'] == $classID) return FALSE;
    Severity: Major
    Found in e107_handlers/userclass_class.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return TRUE;
      Severity: Major
      Found in e107_handlers/userclass_class.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return 2;                        // Full edit rights - a 'normal' class
        Severity: Major
        Found in e107_handlers/userclass_class.php - About 30 mins to fix

          Returning type int|string but getClassFromKey() is declared to return bool
          Open

                      return $this->text_class_link[$text];
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Argument 4 (noWhere) is 'nowhere' but \e_db::select() takes bool|false defined at /code/e107_handlers/e_db_interface.php:265
          Open

                      if($this->sql_r->field('userclass_classes','userclass_parent') &&  $this->sql_r->select('userclass_classes', '*', 'ORDER BY userclass_parent,userclass_name', 'nowhere')) // The order statement should give a consistent return
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Call to deprecated function \getperms() defined at /code/class2.php:1322
          Open

                          && (   getperms('0')
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Argument 1 (number) is string but \abs() takes float
          Open

                  $classIndex = abs($classnum);            // Handle negative class values
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          string passed to foreach instead of array
          Open

                      foreach ($this->class_tree[$parent]['class_children'] as $cc)
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          string passed to foreach instead of array
          Open

                  foreach ($this->class_tree[$our_class]['class_children'] as $cc)
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Parameter $callback has undeclared type \function
          Open

              public function vetted_tree($treename, $callback='', $current_value='', $optlist = '', $opt_options = '')
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Argument 3 (checked) is ' checked=\'checked\''|'' but \e_form::checkbox() takes bool|false defined at /code/e107_handlers/form_handler.php:2685
          Open

                  return $pre.e107::getForm()->checkbox($treename.'[]', $classnum , $chk, array("id"=>$id,'label'=>$description)).$post;
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Saw a token Phan may have failed to parse after '* @return integer:': after integer, saw ':'
          Open

               *    @return integer:
          Severity: Info
          Found in e107_handlers/userclass_class.php by phan

          Default value for int|string $filter can't be false
          Open

              public function uc_get_classlist($filter = FALSE)
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Returning type array<int>|array<int></int></int> but ucRemove() is declared to return string
          Open

                  if ($asArray) { return $tmp; }
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Call to deprecated function \getperms() defined at /code/class2.php:1322
          Open

                  if (!(getperms('4') || getperms('0'))) return;
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Default value for \function|object $callback can't be string
          Open

              public function vetted_tree($treename, $callback='', $current_value='', $optlist = '', $opt_options = '')
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Returning type string but getClassFromKey() is declared to return bool
          Open

                      return $this->text_class_link[$text];
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Argument 1 (number) is string but \abs() takes float
          Open

                  $listIndex = abs($listnum);
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          Returning type array<int></int> but ucAdd() is declared to return string
          Open

                  if ($asArray) { return $tmp; }
          Severity: Minor
          Found in e107_handlers/userclass_class.php by phan

          There are no issues that match your filters.

          Category
          Status