DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                    if ($tblTest->isContinues() && $tblGrade->getDate()) {
                                        if (strlen($tblGrade->getDate()) > 6) {
                                            $displayGradeDate = substr($tblGrade->getDate(), 0, 6);
                                        }
                                    } elseif ($tblTest->isContinues() && $tblTest->getFinishDate()) {
Severity: Major
Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if ($tblScoreRuleDivisionSubject) {
                                            if ($tblScoreRuleDivisionSubject->getTblScoreRule()
                                                && $tblScoreRuleDivisionSubject->getTblScoreRule()->getId() == $tblScoreRule->getId()
                                            ) {
                                                $Global->POST['Data'][$tblDivision->getId()][$subject->getId()] = 1;
    Severity: Major
    Found in Application/Education/Graduation/Gradebook/ScoreRule/Frontend.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                          if ($tblScoreRuleDivisionSubject->getTblScoreRule()
                                              && $tblScoreRuleDivisionSubject->getTblScoreRule()->getId() != $tblScoreRule->getId()
                                          ) {
                                              $isDisabled = true;
                                              $name .= ' ' . new Label($tblScoreRuleDivisionSubject->getTblScoreRule()->getName(),
      Severity: Major
      Found in Application/Education/Graduation/Gradebook/ScoreRule/Frontend.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if (($tblGradeType = $tblScoreConditionGradeTypeList->getTblGradeType())) {
                                                /** @var TblGrade $tblGrade */
                                                foreach ($tblGradeList as $tblGrade) {
                                                    if (is_numeric($tblGrade->getGrade())
                                                        && $tblGrade->getTblGradeType()
        Severity: Major
        Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if ($posStart !== false) {
                                                  $posEnd = strpos($average, ')');
                                                  if ($posEnd !== false) {
                                                     $priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
                                                  }
          Severity: Major
          Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                    if (is_array($average)) {
                                                        $average = 'Fehler';
                                                    } elseif (is_string($average) && strpos($average, '(')) {
                                                        $average = substr($average, 0, strpos($average, '('));
                                                    }
            Severity: Major
            Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

              Method getSubject has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      TblCertificate $tblCertificate,
                      $tblSubjectAll,
                      $LaneIndex,
                      $LaneRanking,
                      $LaneTitle = '',
              Severity: Minor
              Found in Application/Education/Certificate/Setting/Frontend.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                    if ($posEnd !== false) {
                                                        $priority = substr($average, $posStart + 1, $posEnd - ($posStart + 1));
                                                    }
                Severity: Major
                Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if ($Relationship->getServiceTblPersonFrom() == $tblPersonSession->getId()) {
                                                  $ParentList[] = $Relationship->getServiceTblPersonTo();
                                              } elseif ($Relationship->getServiceTblPersonTo() == $tblPersonSession->getId()) {
                                                  $ParentList[] = $Relationship->getServiceTblPersonFrom();
                                              }
                  Severity: Major
                  Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                    Function frontendApproval has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function frontendApproval($Data = null)
                        {
                    
                            $Stage = new Stage('Einsellungen', 'Automatische Freigabe');
                            $Stage = self::setSettingMenue($Stage, 'Approval');
                    Severity: Minor
                    Found in Application/Education/Certificate/Setting/Frontend.php - About 45 mins 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

                    Avoid deeply nested control flow statements.
                    Open

                                                if ($hasMirror) {
                                                    $value = intval(round($value, 0));
                                                    $gradeMirror[$value]++;
                                                }
                    Severity: Major
                    Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (isset($itemValue['Value']) && isset($itemValue['Multiplier'])) {
                                                              $totalMultiplier += $multiplier;
                                                              $average += $multiplier * ($itemValue['Value'] / $itemValue['Multiplier']);
                                                          }
                      Severity: Major
                      Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ($tblCommon && ($tblCommonBirthDates = $tblCommon->getTblCommonBirthDates())) {
                        
                                                    $Now = new \DateTime();
                                                    $Now->modify('-18 year');
                        
                        
                        Severity: Major
                        Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                          Method updateScoreGroup has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  TblScoreGroup $tblScoreGroup,
                                  $Name,
                                  $Round,
                                  $Multiplier,
                                  $IsEveryGradeASingleGroup,
                          Severity: Minor
                          Found in Application/Education/Graduation/Gradebook/ScoreRule/Data.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (($tblTask = $tblTest->getTblTask()) && !$tblTask->isLocked()) {
                                                            Evaluation::useService()->setTaskLocked($tblTask);
                                                        }
                            Severity: Major
                            Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if ($average != '') {
                                                                      if (isset($averages[$column])) {
                                                                          $averages[$column]['Count']++;
                                                                          $averages[$column]['Sum'] += $average;
                                                                      } else {
                              Severity: Major
                              Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (!$tblDivisionSubject->getTblSubjectGroup()) {
                                                                    $hasStudentSubject = false;
                                                                    $tblDivisionSubjectWhereGroup =
                                                                        Division::useService()->getDivisionSubjectAllWhereSubjectGroupByDivisionAndSubject(
                                                                            $tblDivision,
                                Severity: Major
                                Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if(!in_array($tblSchoolType->getId(), $tblSchoolTypeList)){
                                                                      // Klassen werden nicht angezeigt, wenn die Schulart nicht freigeben ist.
                                                                      continue;
                                                                  }
                                  Severity: Major
                                  Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                            if ($tblScoreRuleDivisionSubject->getTblScoreType()
                                                                                && $tblScoreRuleDivisionSubject->getTblScoreType()->getId() == $tblScoreType->getId()
                                                                            ) {
                                                                                $Global->POST['Data'][$tblDivision->getId()][$subject->getId()] = 1;
                                                                            }
                                    Severity: Major
                                    Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                              if ($tblGrade->getServiceTblPerson()
                                                                                  && ($tblPrepareStudent = Prepare::useService()->getPrepareStudentBy($tblPrepare,
                                                                                      $tblGrade->getServiceTblPerson()))
                                                                                  && ($tblCertificate = $tblPrepareStudent->getServiceTblCertificate())
                                                                                  && !$tblCertificate->isInformation()
                                      Severity: Major
                                      Found in Application/Education/Certificate/Prepare/Service/Data.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language