DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                            if ($tblStudentSubject && ($tblSubject = $tblStudentSubject->getServiceTblSubject())) {
                                $DataPerson['Edit'] = new Muted('('.$tblSubject->getAcronym().') ').$tblSubject->getName();
                            }
Severity: Major
Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if ($Label == $i . '. Wahlfach'){
                                    $tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('ELECTIVE');
                                    $tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier($i);
                                    $tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
                                        $tblStudentSubjectType, $tblStudentSubjectRanking);
    Severity: Major
    Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

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

              $modalField,
              $CloneField,
              $TypeId,
              $RankingId,
              $PersonIdArray = array(),
      Severity: Minor
      Found in Application/Api/People/Meta/Subject/MassReplaceSubject.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 (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

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

                      $MarginTop = '10px',
                      $LineOne = '',
                      $LineTwo = '',
                      $LineThree = '',
                      $LineFour = '',
              Severity: Minor
              Found in Application/Api/Education/Certificate/Generator/Certificate.php - About 45 mins to fix

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

                    protected function getHeadSlice($IsSample, $picturePath = '', $with = '100%', $height = '100%')
                    {
                        if ($picturePath != '') {
                            if ($IsSample) {
                                $Header = (new Slice())
                Severity: Minor
                Found in Application/Api/Education/Certificate/Generator/Certificate.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 ($hasSecondLanguageSecondarySchool)  {
                                                    // SSW-484
                                                    $tillLevel = $tblStudentSubject->getServiceTblLevelTill();
                                                    $fromLevel = $tblStudentSubject->getServiceTblLevelFrom();
                                                    if (($tblDivision = $this->getTblDivision())
                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($Data['P' . $personId]['Grade'])) {
                                                  $Certificate->setGrade($Data['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 (($tblCompany = $tblStudentTransfer->getServiceTblCompany())) {
                                                $name = $isSchoolExtendedNameDisplayed ? $tblCompany->getName() .
                                                    ($separator ? ' ' . $separator . ' ' : ' ') . $tblCompany->getExtendedName() : $tblCompany->getName();
                                                if (strlen($name) > 60) {
                                                    $isLargeCompanyName = true;
                    Severity: Major
                    Found in Application/Api/Education/Certificate/Generator/Certificate.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                              if ($countMinimumGradeByPerson >= $minimumCount) {
                                                                  $countFulfil++;
                                                              }
                      Severity: Major
                      Found in Application/Api/Education/Graduation/Gradebook/ApiMinimumGradeCount.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 ($countPersons == 1) {
                                                                      $minimumPersonCount = $countMinimumGradeByPerson;
                                                                  } elseif ($countMinimumGradeByPerson < $minimumPersonCount) {
                                                                      $minimumPersonCount = $countMinimumGradeByPerson;
                                                                  }
                          Severity: Major
                          Found in Application/Api/Education/Graduation/Gradebook/ApiMinimumGradeCount.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if (class_exists($CertificateClass)) {
                            
                                                            /** @var \SPHERE\Application\Api\Education\Certificate\Generator\Certificate $Certificate */
                                                            $Certificate = new $CertificateClass($tblDivision, null, false);
                            
                            
                            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 (class_exists($CertificateClass)) {
                                
                                                                    /** @var \SPHERE\Application\Api\Education\Certificate\Generator\Certificate $Certificate */
                                                                    $Certificate = new $CertificateClass($tblDivision, $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 ($countMinimumGradeByPerson > $maximumPersonCount) {
                                                                              $maximumPersonCount = $countMinimumGradeByPerson;
                                                                          }
                                  Severity: Major
                                  Found in Application/Api/Education/Graduation/Gradebook/ApiMinimumGradeCount.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (($tblCompany = $tblStudentTransfer->getServiceTblCompany())) {
                                                                $place = '';
                                                                if (($tblAddress = $tblCompany->fetchMainAddress())
                                                                    && ($tblCity = $tblAddress->getTblCity())
                                                                ) {
                                    Severity: Major
                                    Found in Application/Api/Education/Certificate/Generator/Repository/GymAbitur.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)
                                                                  ) {
                                                                      Prepare::useService()->updatePrepareStudentSetPrinted($tblPrepareStudent);
                                      Severity: Major
                                      Found in Application/Api/Education/Certificate/Generator/Creator.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language