DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

    protected function getFormFieldSelectBox( $Data, $PropertyName, $Label = null, $Icon = null, $doResetCount = false, $doKeyConvertToText = true) {
Severity: Minor
Found in System/Database/Binding/AbstractView.php - About 45 mins to fix

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

        final protected function createColumn(Table $Table, $Name, $Type = self::FIELD_TYPE_STRING, $IsNull = false, $Default = null)
        {
    
            if (!$this->getConnection()->hasColumn($Table->getName(), $Name)) {
                if( $Default === null ) {
    Severity: Minor
    Found in System/Database/Binding/AbstractSetup.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

    Consider simplifying this complex logical expression.
    Open

                    if (($tblType = $tblToPerson->getTblType())
                        && ($tblType->getName() == 'Sorgeberechtigt'
                            || $tblType->getName() == 'Bevollmächtigt'
                            || $tblType->getName() == 'Geschwisterkind'
                            || $tblType->getName() == 'Ehepartner'
    Severity: Major
    Found in Application/Contact/Address/Frontend.php - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                          if (($tblPrepareAdditionalGradeType = Prepare::useService()->getPrepareAdditionalGradeTypeByIdentifier('VERBAL_EXAM'))
                              && ($verbalExamGrade = Prepare::useService()->getPrepareAdditionalGradeByRanking(
                                  $this->getTblPrepareCertificate(),
                                  $tblPerson,
                                  $tblPrepareAdditionalGradeType,
      Severity: Major
      Found in Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                    if (($tblPerson = Person::useService()->getPersonById($personId))
                        && ($tblStudent = $tblPerson->getStudent())
                        && ($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'))
                        && ($tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier('1'))
                        && ($tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
        Severity: Major
        Found in Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                  if (($tblDivision = $this->getTblDivision())
                      && ($tblLevel = $tblDivision->getTblLevel())
                      && intval($tblLevel->getName()) > 6
                      && ($tblPerson = Person::useService()->getPersonById($personId))
                      && ($tblStudent = $tblPerson->getStudent())

            Consider simplifying this complex logical expression.
            Open

                        if ($tblPerson
                            && ($tblStudent = $tblPerson->getStudent())
                            && ($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'))
                            && ($tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier('1'))
                            && ($tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,

              Consider simplifying this complex logical expression.
              Open

                      if (
                          $FilterGroup === null
                          && $FilterStudent === null
                          && $FilterPerson === null
                          && $FilterYear === null
              Severity: Major
              Found in Application/Reporting/SerialLetter/Frontend.php - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                        if ($FilterGroup === null && $FilterStudent === null && $FilterYear === null
                            && $FilterProspect === null && $FilterCompany === null && $FilterRelationship === null
                        ) {
                            if ($tblFilterFieldList) {
                                foreach ($tblFilterFieldList as $tblFilterField) {
                Severity: Major
                Found in Application/Reporting/SerialLetter/Frontend.php - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                                                          if ($filterYear && $filterLevel && $filterSchoolOption) {
                                                              if ($hasYear && $hasLevel && $hasSchoolOption) {
                                                                  $resultList[$tblObjectType->getId()][$tblPerson->getId()]
                                                                      = $tblPerson->getLastFirstName();
                                                              }
                  Severity: Major
                  Found in Application/Reporting/CheckList/Service.php - About 40 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                                            if ((isset($Result['FileTeacher1']) && $Result['FileTeacher1'] == '')
                                                && (isset($Result['FileTeacher2']) && $Result['FileTeacher2'] == '')
                                                && (isset($Result['FileTeacher3']) && $Result['FileTeacher3'] == '')
                                            ) {
                                                $this->createIndiwareImportLectureship($Manager, $tblYear, $tblAccount, $Result, 1,
                    Severity: Major
                    Found in Application/Transfer/Indiware/Import/Service/Data.php - About 40 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                                                                  if($isCustody && preg_match('!^Klasse*!', $Group)){
                                                                      // don't insert group for Custody!
                                                                  } elseif($isCustody && $Group !== '') {
                                                                      $tblGroup = Group::useService()->createGroupFromImport($Group);
                                                                      Group::useService()->addGroupPerson($tblGroup, $tblPerson);
                      Severity: Major
                      Found in Application/Transfer/Import/Dresden/Service.php - About 40 mins to fix

                        Consider simplifying this complex logical expression.
                        Open

                                                                if ($isCustody && preg_match('!^Klasse*!', $Group)) {
                                                                    // don't insert group for Custody!
                                                                } elseif ($isCustody && $Group !== '') {
                                                                    $tblGroup = Group::useService()->createGroupFromImport($Group);
                                                                    Group::useService()->addGroupPerson($tblGroup, $tblPerson);
                        Severity: Major
                        Found in Application/Transfer/Import/Dresden/Service.php - About 40 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (isset($Data['PrimaryFocus'])
                                      && isset($Data['SupportType'])
                                      && ($tblSupportType = Student::useService()->getSupportTypeById($Data['SupportType']))
                                      && ($tblSupportType->getName() == 'Förderantrag' || $tblSupportType->getName() == 'Förderbescheid')
                                      && !($tblPrimaryFocusType = Student::useService()->getSupportFocusTypeById($Data['PrimaryFocus']))
                          Severity: Major
                          Found in Application/People/Meta/Student/Service/Service/Support.php - About 40 mins to fix

                            Consider simplifying this complex logical expression.
                            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 40 mins to fix

                              Consider simplifying this complex logical expression.
                              Open

                                              if (($tblTask = $tblTest->getTblTask())
                                                  && $tblTask->getFromDate()
                                                  && $tblTask->getToDate()
                                                  && ($fromDate = new \DateTime($tblTask->getFromDate()))
                                                  && $now < $fromDate
                              Severity: Major
                              Found in Application/Education/Graduation/Evaluation/Service.php - About 40 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if ($Identifier == 'PROFILE'
                                                || $Identifier == 'RELIGION'
                                                || $Identifier == 'ORIENTATION'
                                                || $Identifier == 'FOREIGN_LANGUAGE'
                                                || $Identifier == 'ELECTIVE'
                                Severity: Major
                                Found in Application/People/Person/Frontend/FrontendStudentSubject.php - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                                          if ($tblDivisionSubject && $tblDivisionSubject->getServiceTblSubject()
                                                              && $tblDivisionSubject->getTblDivision()
                                                              && ($tblDivisionSubject->getHasGrading() || (($tblSetting = Consumer::useService()->getSetting(
                                                                          'Education', 'Graduation', 'Evaluation', 'HasBehaviorGradesForSubjectsWithNoGrading'
                                                                      ))
                                  Severity: Major
                                  Found in Application/Education/Graduation/Evaluation/Frontend.php - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    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 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                      if ($filterYear && $filterLevel && $filterType) {
                                                          if ($hasYear && $hasLevel && $hasType) {
                                                              array_push($resultList, $tblDivisionSubject);
                                                          }
                                                      } elseif ($filterYear && $filterLevel) {
                                      Severity: Major
                                      Found in Application/Education/Graduation/Gradebook/Service.php - About 40 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language