DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                    if ($tblProspectReservation) {
                                        $level = $tblProspectReservation->getReservationDivision();
                                        $year = $tblProspectReservation->getReservationYear();
                                        $optionA = $tblProspectReservation->getServiceTblTypeOptionA();
                                        $optionB = $tblProspectReservation->getServiceTblTypeOptionB();
Severity: Major
Found in Application/People/Search/Group/Frontend.php - About 45 mins to fix

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

        public function getGenderNameFromGenderOrSalutation()
        {
            $genderString = $this->getGenderString();
            if ($genderString == '') {
                // Anrede prüfen
    Severity: Minor
    Found in Application/People/Person/Service/Entity/TblPerson.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

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

            $titleName,
            $content,
            $linkList = array(),
            $titleDescription = '',
            IIconInterface $titleIcon = null,
    Severity: Minor
    Found in Application/People/Person/TemplateReadOnly.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                      if (isset( $Meta['SubjectLevelFrom'] ) && isset( $Meta['SubjectLevelFrom'][$Category][$Ranking] )) {
                                          if ($Meta['SubjectLevelFrom'][$Category][$Ranking]) {
                                              $tblLevelFrom = Division::useService()->getLevelById($Meta['SubjectLevelFrom'][$Category][$Ranking]);
                                          }
                                      }
      Severity: Major
      Found in Application/People/Meta/Student/Service.php - About 45 mins to fix

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

                TblStudent $tblStudent,
                $Prefix = '',
                $Identifier = '',
                $SchoolAttendanceStartDate = '',
                $HasMigrationBackground = false,
        Severity: Minor
        Found in Application/People/Meta/Student/Service/Data/Student.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                          if ($divisionYear && $divisionYear->getId() == $tblYear->getId()) {
                                              $tblDivisionList[] = $tblDivisionStudent->getTblDivision();
                                          }
          Severity: Major
          Found in Application/People/Meta/Student/Service.php - About 45 mins to fix

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

                    TblPerson $tblPersonFrom,
                    TblPerson $tblPersonTo,
                    TblType $tblType,
                    $Remark,
                    $Ranking = null,
            Severity: Minor
            Found in Application/People/Relationship/Service/Data.php - About 45 mins to fix

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

                      TblStudent $tblStudent,
                      TblStudentSubjectType $tblStudentSubjectType,
                      TblStudentSubjectRanking $tblStudentSubjectRanking,
                      TblSubject $tblSubject,
                      TblLevel $tblLevelFrom = null,
              Severity: Minor
              Found in Application/People/Meta/Student/Service/Data/Subject.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if ($divisionYear && $divisionYear->getId() == $tblYear->getId()) {
                                                    if(($tblDivision = $tblDivisionStudent->getTblDivision())){
                                                        if (($tblLevel = $tblDivision->getTblLevel())
                                                            && !$tblLevel->getIsChecked()
                                                        ) {
                Severity: Major
                Found in Application/People/Meta/Student/Service.php - About 45 mins to fix

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

                      public function formRelationshipToCompany($PersonId, $ToCompanyId = null, $setPost = false, $Search = '', IMessageInterface $message = null)
                      {
                          if (!($tblPerson = Person::useService()->getPersonById($PersonId))) {
                              return false;
                          }
                  Severity: Minor
                  Found in Application/People/Relationship/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

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

                          TblPerson $tblPerson,
                          $Prefix = '',
                          $Identifier = '',
                          $SchoolAttendanceStartDate = '',
                          $HasMigrationBackground = false,
                  Severity: Minor
                  Found in Application/People/Meta/Student/Service/Data/Student.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if ($tblDivisionTeacher && $tblDivisionTeacher->getDescription() != '') {
                                                        $TeacherString .= ' ('.$tblDivisionTeacher->getDescription().')';
                                                    }
                    Severity: Major
                    Found in Application/People/Person/Frontend/FrontendStudentProcess.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if ($tblDivisionStudent->getId() !== $tblDivisionStudentTemp->getId()
                                                          && $tblDivisionStudentTemp->getTblDivision()
                                                          && (
                                                              $tblDivisionStudentTemp->getTblDivision()->getTblLevel()
                                                              && $tblDivisionStudent->getTblDivision()->getTblLevel()->getId()
                      Severity: Major
                      Found in Application/People/Person/Frontend/FrontendStudentProcess.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ($tblPersonList) {
                                                            foreach ($tblPersonList as $tblPerson) {
                                                                $TeacherAcronym = new ToolTip(new Small(new NotAvailable())
                                                                    ,
                                                                    'Lehrer ' . $tblPerson->getLastFirstName() . ' besitzt kein Lehrerkürzel');
                        Severity: Major
                        Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

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

                              public function isAfterEditPeriod()
                              {
                          
                                  if ($this->getFromDate()){
                                      $toDate = $this->ToDate;
                          Severity: Minor
                          Found in Application/Education/Graduation/Evaluation/Service/Entity/TblTask.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 ($tblPeriod->getId() == $tblPeriodOrigin->getId()) {
                                                              if (isset($tblPeriodLinkList[$periodPosition])) {
                                                                  $tblPeriodLink = $tblPeriodLinkList[$periodPosition];
                                                              }
                                                              break;
                          Severity: Major
                          Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (!$this->existsTestByTask($tblTask, $tblDivision,
                                                                $tblDivisionSubject->getServiceTblSubject())
                                                            ) {
                                                                (new Data($this->getBinding()))->createTest(
                                                                    $tblDivision,
                            Severity: Major
                            Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (($tblDivision = $tblDivisionSubject->getTblDivision())
                                                              && $tblDivision->getServiceTblYear()
                                                              && $tblYear->getId() == $tblDivision->getServiceTblYear()
                                                              && ($tblSubject = $tblDivisionSubject->getServiceTblSubject())
                                                              && ($tblDivisionSubjectSelected->getServiceTblSubject())
                              Severity: Major
                              Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if ($TeacherString !== ' | ') {
                                                                    $TeacherString .= ', ';
                                                                }
                                Severity: Major
                                Found in Application/People/Person/Frontend/FrontendStudentProcess.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if ($now > $taskFromDate
                                                                      && $now < ($taskToDate->add(new \DateInterval('P1D')))
                                                                  ) {
                                                                      $countGrades = 0;
                                                                      if (($tblGradeList = Gradebook::useService()->getProposalBehaviorGradeAllBy($tblDivisionItem, $tblTask))) {
                                  Severity: Major
                                  Found in Application/Education/Graduation/Evaluation/Service.php - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language