DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                            if (($tblCourseTransfer = $tblStudentTransfer->getServiceTblCourse())) {
                                if($tblCourseTransfer->getName() == 'Hauptschule') {
                                    $identifier = 'SecondarySchoolHs';
                                } elseif ($tblCourseTransfer->getName() == 'Realschule') {
                                    $identifier = 'SecondarySchoolRs';
Severity: Major
Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                            if (!isset($SearchList[4]) || empty($SearchList[4])) {
                                                $Node4 = (new \ReflectionObject($ProbeList[4]->getEntity()))->newInstanceWithoutConstructor();
                                                $Node4->__set($this->getPath(4)[0], $Key);
                                                $MatchList = array(
                                                    $Node4
    Severity: Major
    Found in System/Database/Filter/Link/Repository/Node7.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                                  if (!empty($MatchList)) {
                                                      /** @var AbstractView $Node5 */
                                                      foreach ($MatchList as $Node5) {
                                                          $Key = $Node5->__get($this->getPath(5)[1]);
                                                          if (!($MatchList = $this->filterNodeList($Key, $List, 6))) {
      Severity: Major
      Found in System/Database/Filter/Link/Repository/Node7.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($tblYearList) {
                                    foreach ($tblYearList as $tblYear) {
                                        $tblDivision = Division::useService()->getDivisionByPersonAndYear($tblPerson, $tblYear);
                                        if ($tblDivision && $tblDivision->getTblLevel()) {
                                            $Global->POST['Data']['SchoolEntryDivision'] = $tblDivision->getTblLevel()->getName();
        Severity: Major
        Found in Application/Document/Standard/StudentTransfer/StudentTransfer.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                      if ($this->checkTimeout()) {
                                                          throw new NodeException();
                                                      }
          Severity: Major
          Found in System/Database/Filter/Link/Repository/Node5.php - About 45 mins to fix

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

                public function getDivisionByDivisionNameAndLevelAndYear($Name, TblLevel $tblLevel = null, TblYear $tblYear)
                {
            
                    if ($tblYear && $tblLevel && $Name != '') {
                        $tblDivisionList = array();
            Severity: Minor
            Found in Application/Education/Lesson/Division/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 ($SubjectTeacherList) {
                                                    $TeacherGroup[] = true;
                                                }
            Severity: Major
            Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if ((count($tblDivisionSubjectActiveList) - 1) == count($TeacherGroup)) {
                                                  $SubjectUsedCount--;
                                              }
              Severity: Major
              Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ($tblAddressCustody) {
                                                $Global->POST['Data']['CustodyAddress'] = $tblAddressCustody->getGuiString();
                                            }
                Severity: Major
                Found in Application/Document/Standard/AccidentReport/AccidentReport.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if ($tblYearList) {
                                              foreach ($tblYearList as $tblYear) {
                                                  $tblDivision = Division::useService()->getDivisionByPersonAndYear($tblPerson, $tblYear);
                                                  if ($tblDivision && $tblDivision->getTblLevel()) {
                                                      $Global->POST['Data']['SchoolEntryDivision'] = $tblDivision->getTblLevel()->getName();
                  Severity: Major
                  Found in Application/Document/Standard/SignOutCertificate/SignOutCertificate.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if ($LastDate && new \DateTime($LastDate) < new \DateTime($tblPeriod->getToDate())) {
                                                        $LastDate = $tblPeriod->getToDate();
                                                    } elseif (!$LastDate) {
                                                        $LastDate = $tblPeriod->getToDate();
                                                    }
                    Severity: Major
                    Found in Application/Document/Standard/SignOutCertificate/SignOutCertificate.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ($tblToPersonList) {
                                                  foreach ($tblToPersonList as $tblToPerson) {
                                                      if ($tblType = $tblToPerson->getTblType()) {
                                                          $TypeName = $tblType->getName();
                                                          $TypeDescription = $tblType->getDescription();
                      Severity: Major
                      Found in Application/Document/Standard/AccidentReport/AccidentReport.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if ($tblAddressSchool) {
                                                    $Global->POST['Data']['SchoolAddressStreet'] = $tblAddressSchool->getStreetName().' '.$tblAddressSchool->getStreetNumber();
                                                    $tblCitySchool = $tblAddressSchool->getTblCity();
                                                    if ($tblCitySchool) {
                                                        $Global->POST['Data']['SchoolAddressDistrict'] = $tblCitySchool->getDistrict();
                        Severity: Major
                        Found in Application/Document/Standard/EnrollmentDocument/EnrollmentDocument.php - About 45 mins to fix

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

                                  TblPerson $tblPerson,
                                  TblLevel $tblLevel,
                                  &$Content,
                                  $gender,
                                  $hasMigrationBackground,
                          Severity: Minor
                          Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

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

                                    &$countDivisionStudents,
                                    TblDivision $tblDivision,
                                    TblLevel $tblLevel,
                                    TblCourse $tblCourse = null,
                                    $gender,
                            Severity: Minor
                            Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                          if (($MatchList = $this->filterNodeList($Key, $List, 5))) {
                                                                              /** @var AbstractView $Node5 */
                                                                              foreach ($MatchList as $Node5) {
                                                                                  $Result[] = array(
                                                                                      $Node0,
                              Severity: Major
                              Found in System/Database/Filter/Link/Repository/Node6.php - About 45 mins to fix

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

                                    public function __construct(Identifier $Identifier)
                                    {
                                
                                        $this->Identifier = $Identifier;
                                        $Register = new Register();
                                Severity: Minor
                                Found in System/Database/Database.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 ($tblToPersonList) {
                                                            foreach ($tblToPersonList as $tblToPerson) {
                                                                if ($tblType = $tblToPerson->getTblType()) {
                                                                    $TypeName = $tblType->getName();
                                                                    $TypeDescription = $tblType->getDescription();
                                Severity: Major
                                Found in Application/Document/Standard/StudentTransfer/StudentTransfer.php - About 45 mins to fix

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

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

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

                                            $CountHit = -1,
                                            $CountMiss = -1,
                                            $SizeAvailable = -1,
                                            $SizeUsed = -1,
                                            $SizeFree = -1,
                                    Severity: Minor
                                    Found in System/Cache/CacheStatus.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language