DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                        if ($tblSubjectStudentAllByDivisionSubject) {
                                            foreach ($tblSubjectStudentAllByDivisionSubject as $tblSubjectStudent) {

                                                $tblPerson = $tblSubjectStudent->getServiceTblPerson();
                                                if ($tblPerson) {
Severity: Major
Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

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

            TblDivision $tblDivision,
            TblSubject $tblSubject,
            TblYear $tblYear,
            TblPerson $tblPerson,
            TblTestType $tblTestType,
    Severity: Minor
    Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

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

          public function getDisplayGrade($WithTrend = true)
          {
      
              $gradeValue = $this->getGrade();
              if ($gradeValue !== null && $gradeValue !== '') {

      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 getGradesByStudent has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              TblPerson $tblPerson,
              TblDivision $tblDivision,
              TblSubject $tblSubject,
              TblTestType $tblTestType,
              TblPeriod $tblPeriod = null,
      Severity: Minor
      Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                                    if ($this->checkIsPersonInActive($tblDivision, $tblPerson, $taskDate)) {
                                                        continue;
                                                    }
        Severity: Major
        Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                      if ($taskDate->format('Y-m-d') >= $testDate->format('Y-m-d')) {
                                                          $count++;
                                                          $date = $tblTestTemp->getDate();
                                                          if (strlen($date) > 6) {
                                                              $date = substr($date, 0, 6);
          Severity: Major
          Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                    if ($Data == null) {
                                                        $Global = $this->getGlobal();
                                                        /** @var TblSubject $subject */
                                                        foreach ($subjectList as $subject) {
                                                            $tblScoreRuleSubjectGroup = Gradebook::useService()->getScoreRuleSubjectGroupByDivisionAndSubjectAndGroup(
            Severity: Major
            Found in Application/Education/Graduation/Gradebook/ScoreRule/Frontend.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($tblTest->getDate()
                                              && ($testDate = (new \DateTime($tblTest->getDate())))
                                              && ($toDateTimeTask = new \DateTime($appointedDateTask->getToDate()))
                                              && ($nowDateTime = (new \DateTime('now')))
                                              && $testDate <= $toDateTimeTask
              Severity: Major
              Found in Application/Education/Graduation/Evaluation/Frontend.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (($tblGrade = $this->getGradeById($gradeId))) {
                                                    $tblGradeList[] = $tblGrade;
                                                }
                Severity: Major
                Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                      if (($tblScoreGroup = $tblScoreConditionGroupRequirement->getTblScoreGroup())
                                                          && ($tblGradeTypeList = Gradebook::useService()->getScoreGroupGradeTypeListByGroup($tblScoreGroup))
                                                      ) {
                                                          $gradeTypeList = array();
                                                          foreach ($tblGradeTypeList as $tblGradeTypeItem) {
                  Severity: Major
                  Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if ($tblPeriodList) {
                                                    $tableHeaderList['Subject'] = 'Fach';
                                                    foreach ($tblPeriodList as $tblPeriod) {
                                                        $tableHeaderList['Period' . $tblPeriod->getId()] = new Bold($tblPeriod->getDisplayName());
                                                    }
                    Severity: Major
                    Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

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

                          public function updateScoreGroup(IFormInterface $Stage = null, $Id, $ScoreGroup)
                          {
                      
                              /**
                               * Skip to Frontend
                      Severity: Minor
                      Found in Application/Education/Graduation/Gradebook/ScoreRule/Service.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 ($tblGrade->getGrade() !== null && $tblGrade->getGrade() !== '' && is_numeric($tblGrade->getGrade())) {
                                                                  // für Teilnoten Extra-Liste
                                                                  if (($tblGradeType = $tblGrade->getTblGradeType())
                                                                      && $tblGradeType->isPartGrade()
                                                                  ) {
                      Severity: Major
                      Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if (count($columnList[$schoolTypeId]) == 4) {
                                                            $rowList[$schoolTypeId][] = new FormRow($columnList[$schoolTypeId]);
                                                            $columnList[$schoolTypeId] = array();
                                                        }
                        Severity: Major
                        Found in Application/Education/Graduation/Gradebook/ScoreRule/Frontend.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if (($tblPeriodList = Term::useService()->getPeriodAllByYear($tblYear, $isLevel12))) {
                                                              $firstPeriod = reset($tblPeriodList);
                                                              if ($period == TblScoreCondition::PERIOD_FIRST_PERIOD) {
                                                                  if ($tblPeriod && $firstPeriod->getId() == $tblPeriod->getId()) {
                          
                          
                          Severity: Major
                          Found in Application/Education/Graduation/Gradebook/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

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

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

                                  private function addTest(TblTest $tblTest,TblGrade $tblGrade = null, &$subTableHeaderList, &$subTableDataList, $hasScore, $showDivisionInToolTip)
                              Severity: Minor
                              Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

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

                                        $DivisionId,
                                        $GroupId,
                                        $PersonId,
                                        Stage $Stage,
                                        $Route,
                                Severity: Minor
                                Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                          if (($tblPersonItem = $tblGradeItem->getServiceTblPerson())
                                                                              && !isset($studentArray[$tblPersonItem->getId()])
                                                                          ) {
                                                                              $addStudentList[$tblPersonItem->getId()] = $tblPersonItem;
                                                                          }
                                  Severity: Major
                                  Found in Application/Education/Graduation/Gradebook/Frontend.php - About 45 mins to fix

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

                                            TblScoreCondition $tblScoreCondition,
                                            $Name,
                                            $Round,
                                            $Priority,
                                            $IsActive,
                                    Severity: Minor
                                    Found in Application/Education/Graduation/Gradebook/ScoreRule/Data.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language