DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                    if (($tblSubject = $tblTest->getServiceTblSubject())
                                        && ($tblGrade = Gradebook::useService()->getGradeByTestAndStudent($tblTest,
                                            $tblPerson))
                                    ) {
                                        $subjectGradeList[$tblSubject->getAcronym()] = $tblGrade;
Severity: Major
Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if ($tblStudentTransfer) {
                                $tblCourse = $tblStudentTransfer->getServiceTblCourse();
                            }
    Severity: Major
    Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if (($tblTransferType = Student::useService()->getStudentTransferTypeByIdentifier('PROCESS'))
                                          && ($tblStudent = Student::useService()->getStudentByPerson($tblPerson))
                                      ) {
                                          $tblStudentTransfer = Student::useService()->getStudentTransferByType($tblStudent,
                                              $tblTransferType);
      Severity: Major
      Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if ($tblCurrentSubject->getId() != $tblSubjectItem->getId()) {
                                        $tblNextSubject = $tblSubjectItem;
                                    }
        Severity: Major
        Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if ($tblLeaveStudent->isApproved()) {
                                          $selectBox->setDisabled();
                                      }
          Severity: Major
          Found in Application/Education/Certificate/Prepare/Abitur/LeavePoints.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (($tblGradeTypeItem = $tblTest->getServiceTblGradeType())) {
                                            if (!isset($tblGradeTypeList[$tblGradeTypeItem->getId()])) {
                                                $tblGradeTypeList[$tblGradeTypeItem->getId()] = $tblGradeTypeItem;
                                                if ($tblCurrentGradeType && !$tblNextGradeType) {
                                                    $tblNextGradeType = $tblGradeTypeItem;
            Severity: Major
            Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (isset($Identifier[0])) {
                                                  unset($Identifier[0]);
                                              }
              Severity: Major
              Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if ($tblCourse && $tblCourse->getName() == 'Hauptschule') {
                                                    $isMuted = false;
                
                                                    // SSW-640 Hinweistext keine Zeugnisvorlage ausgewählt
                                                    if (!$tblPrepareStudent
                Severity: Major
                Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

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

                      public function editCertificateTemplates(
                          IFormInterface $Form = null,
                          TblPrepareCertificate $tblPrepare,
                          $Data = null
                      ) {
                  Severity: Minor
                  Found in Application/Education/Certificate/Generate/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 (!$tblCurrentGradeType && !empty($tblGradeTypeList)) {
                                              $tblCurrentGradeType = current($tblGradeTypeList);
                                              if (count($tblGradeTypeList) > 1) {
                                                  $tblNextGradeType = next($tblGradeTypeList);
                                              }
                  Severity: Major
                  Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (!$hasRemarkText
                                                && ($Certificate->getCertificateEntity()->getCertificate() == 'MsHjRs')
                                            ) {
                                                if (($tblDroppedSubjectList = Prepare::useService()->getAutoDroppedSubjects($tblPerson, $tblDivision))) {
                                                    $countDroppedSubjects = count($tblDroppedSubjectList);
                    Severity: Major
                    Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if (isset($Identifier[0])) {
                                                          unset($Identifier[0]);
                                                      }
                      Severity: Major
                      Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                    if ($tblGradeTextList) {
                                                                        $studentTable[$tblPerson->getId()]['Text'] = (new SelectBox('Data[' . $tblPrepareStudent->getId() . '][Text]',
                                                                            '',
                                                                            array(TblGradeText::ATTR_NAME => $tblGradeTextList)))->setDisabled();
                                                                    }
                        Severity: Major
                        Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (($tblGradeList = Gradebook::useService()->getGradesByStudent(
                                                          $tblPerson,
                                                          $tblDivisionItem,
                                                          $tblSubjectItem,
                                                          $tblTestType,
                          Severity: Major
                          Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if ($tblType && !$this->checkAutoSelect($tblPerson, $tblType)) {
                                                                continue;
                                                            }
                            Severity: Major
                            Found in Application/Education/Certificate/Generate/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if ($fromDate <= $now && $now <= $toDate) {
                                                              $tblCurrentPeriod = $tblPeriod;
                                                              break;
                                                          }
                              Severity: Major
                              Found in Application/Education/Certificate/Generate/Frontend.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if (!isset($columnTable['Support'])) {
                                                            $columnTable['Support'] = 'Inklusive Unterrichtung';
                                                        }
                                Severity: Major
                                Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                              if ($tblGradeTextList) {
                                                                                  $studentTable[$tblPerson->getId()]['Text'] = (new SelectBox('Data[' . $tblPrepareStudent->getId() . '][Text]',
                                                                                      '',
                                                                                      array(TblGradeText::ATTR_NAME => $tblGradeTextList)))->setTabIndex($tabIndex++);
                                                                              }
                                  Severity: Major
                                  Found in Application/Education/Certificate/Prepare/Frontend.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if (($tblPerson = $tblPrepareStudent->getServiceTblPerson())
                                                                            && ($tblPrepare = $tblPrepareStudent->getTblPrepareCertificate())
                                                                            && $tblPrepareStudent->getServiceTblCertificate()
                                                                            && !$tblPrepareStudent->isPrinted()
                                                                            && ($tblDivisionItem = $tblPrepare->getServiceTblDivision())
                                    Severity: Major
                                    Found in Application/Education/Certificate/PrintCertificate/Frontend.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                          if ($type->getName() == 'Gymnasium'
                                                                              && (($tblLevel = $tblDivision->getTblLevel()))
                                                                              && $tblLevel->getName() == '12'
                                                                          ) {
                                                                              $schoolTypeList[$type->getId()][$tblDivision->getId()] = $tblDivision->getDisplayName();
                                      Severity: Major
                                      Found in Application/Education/Certificate/Generate/Frontend.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language