DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                        if (isset($Content['P' . $personId]['AdditionalGrade'])) {
                            $Certificate->setAdditionalGrade($Content['P' . $personId]['AdditionalGrade']);
                        }
Severity: Major
Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (isset($Content['P' . $personId]['Grade'])) {
                                $Certificate->setGrade($Content['P' . $personId]['Grade']);
                            }
    Severity: Major
    Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (isset($Content['P' . $personId]['AdditionalGrade'])) {
                                  $Certificate->setAdditionalGrade($Content['P' . $personId]['AdditionalGrade']);
                              }
      Severity: Major
      Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (($tblDivision = $tblPrepare->getServiceTblDivision()) && !$tblPrepareStudent->isPrinted()) {
                                        if (Storage::useService()->saveCertificateRevision($tblPerson, $tblDivision,
                                            $Certificate,
                                            $File, $tblPrepare)
                                        ) {
        Severity: Major
        Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      if (($tblDivision = $tblPrepare->getServiceTblDivision()) && !$tblPrepareStudent->isPrinted()) {
                                          if (Storage::useService()->saveCertificateRevision($tblPerson, $tblDivision,
                                              $Certificate,
                                              $File, $tblPrepare)
                                          ) {
          Severity: Major
          Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if (isset($Data['P' . $personId]['AdditionalGrade'])) {
                                            $Certificate->setAdditionalGrade($Data['P' . $personId]['AdditionalGrade']);
                                        }
            Severity: Major
            Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if ($tblStudentSubject->getTblStudentSubjectRanking()
                                                  && $tblStudentSubject->getTblStudentSubjectRanking()->getIdentifier() == '2'
                                                  && ($tblSubjectForeignLanguage = $tblStudentSubject->getServiceTblSubject())
                                              ) {
                                                  $tblSecondForeignLanguage = $tblSubjectForeignLanguage;
              Severity: Major
              Found in Application/Api/Education/Certificate/Generator/Certificate.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if ($hasSecondLanguageDiploma) {
                                                    $tblSecondForeignLanguageDiploma = $tblSubjectForeignLanguage;
                                                }
                Severity: Major
                Found in Application/Api/Education/Certificate/Generator/Certificate.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if (isset($Content['P' . $personId]['Grade'])) {
                                                  $Certificate->setGrade($Content['P' . $personId]['Grade']);
                                              }
                  Severity: Major
                  Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE'))
                                                && ($tblStudentSubjectList = Student::useService()->getStudentSubjectAllByStudentAndSubjectType($tblStudent,
                                                    $tblStudentSubjectType))
                                            ) {
                                                /** @var TblStudentSubject $tblStudentSubject */
                    Severity: Major
                    Found in Application/Api/Education/Certificate/Generator/Certificate.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if (Division::useService()->getSubjectStudentByDivisionSubjectAndPerson(
                                                          $tblDivisionSubjectItem, $tblPerson
                                                      )
                                                      ) {
                                                          $subjectList[$tblCertificateSubject->getRanking()] = $tblSubject;

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ($tblSubjectGroup->isAdvancedCourse()) {
                                                            if ($tblSubject->getName() == 'Deutsch' || $tblSubject->getName() == 'Mathematik') {
                                                                $advancedCourses[0] = $tblSubject->getName();
                                                            } else {
                                                                $advancedCourses[1] = $tblSubject->getName();

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

                                  $personId,
                                  $isSample,
                                  $title = 'Halbjahresinformation der Schule (Primarstufe)',
                                  $term,
                                  $gradeLanesSlice,

                            Avoid deeply nested control flow statements.
                            Open

                                                    if (($tblCompany = $tblStudentTransfer->getServiceTblCompany())) {
                                                        $name = $isSchoolExtendedNameDisplayed ? $tblCompany->getName() .
                                                            ($separator ? ' ' . $separator . ' ' : ' ') . $tblCompany->getExtendedName() : $tblCompany->getName();
                            
                                                        if (($mainAddress = $tblCompany->fetchMainAddress())) {

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

                                  public static function createMultiPasswordPdf($Data, $paperOrientation = Creator::PAPERORIENTATION_PORTRAIT)
                                  {
                              
                                      $multiPassword = new MultiPassword($Data);
                                      $pageList = $multiPassword->getPageList();
                              Severity: Minor
                              Found in Application/Api/Document/Creator.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 (($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())) {
                                                          $this->FieldValue['Gender'] = $tblCommonGender->getName();
                                                      }
                              Severity: Major
                              Found in Application/Api/Document/Custom/Zwickau/Repository/SchoolContract.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if($tblCommonGender->getName() == "Männlich"){
                                                            $this->FieldValue['Gender'] = 1;
                                                        }

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if ($isList) {
                                                                      $maxPdfPages = Balance::useFrontend()->getMaxPdfPages();
                                                                      if ($countPdfs > $maxPdfPages * $list && $countPdfs <= $maxPdfPages * ($list + 1)) {
                                                                          // werden hinzugefügt
                                                                      } else {
                                  Severity: Major
                                  Found in Application/Api/Document/Creator.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if($tblCommonGender->getName() == "Weiblich") {
                                                                $this->FieldValue['Gender'] = 2;
                                                            }

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

                                              $personId,
                                              $isSlice = true,
                                              $languagesWithStartLevel = array(),
                                              $isTitle = true,
                                              $showThirdForeignLanguage = false,
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language