DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

        TblBinary $tblBinary,
        TblDirectory $tblDirectory,
        TblFileType $tblFileType,
        $Name,
        $Description = '',
Severity: Minor
Found in Application/Document/Storage/Service/Data.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']['SchoolAddressCity'] = $tblCitySchool->getCode().' '.$tblCitySchool->getName();
    Severity: Major
    Found in Application/Document/Standard/AccidentReport/AccidentReport.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if ($isInPreparationDivisionForMigrants) {
                                  if (isset($countArray[$birthYear]['Migration'][$gender])) {
                                      $countArray[$birthYear]['Migration'][$gender]++;
                                  } else {
                                      $countArray[$birthYear]['Migration'][$gender] = 1;
      Severity: Major
      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) {
                                                            $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 (!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/Node6.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']['SchoolAddressCity'] = $tblCitySchool->getCode().' '.$tblCitySchool->getName();
            Severity: Major
            Found in Application/Document/Standard/SignOutCertificate/SignOutCertificate.php - About 45 mins to fix

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

                  final protected function getCachedEntityBy($__METHOD__, Manager $EntityManager, $EntityName, $Parameter)
                  {
              
                      // Only if NOT REMOVED
                      $Parameter['EntityRemove'] = null;
              Severity: Minor
              Found in System/Database/Fitting/Cacheable.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 (!empty($MatchList)) {
                                                              /** @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 getOtherDivisionsByStudent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getOtherDivisionsByStudent(
                        TblDivision $tblDivision,
                        TblPerson $tblPerson,
                        $withCurrentDivision = true
                    ) {
                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 ($tblSubjectTeacher->getServiceTblPerson()) {
                                                        (new Data($this->getBinding()))->addSubjectTeacher($tblDivisionSubjectCopy,
                                                            $tblSubjectTeacher->getServiceTblPerson());
                                                    }
                Severity: Major
                Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                                  if (($tblDivisionSubjectTemp = $tblSubjectStudent->getTblDivisionSubject())
                                                                      && ($tblSubjectTemp = $tblDivisionSubjectTemp->getServiceTblSubject())
                                                                      && ($tblPerson = $tblSubjectStudent->getServiceTblPerson())
                                                                  ) {
                                                                      if ($IsSekTwo) {
                  Severity: Major
                  Found in Application/Education/Lesson/Division/Frontend.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if ($StudentSubject->getServiceTblSubject()->getName() == $tblSubject->getName()) {
                                                        $tblPersonList[] = $tblPersonStudent;
                                                    }
                    Severity: Major
                    Found in Application/Education/Lesson/Subject/Frontend.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if (($tblBirthdates = $tblCommonCustody->getTblCommonBirthDates())) {
                                                      if (($tblGenderCustody = $tblBirthdates->getTblCommonGender())) {
                                                          if ($tblGenderCustody->getName() == 'Weiblich') {
                                                              if (!isset($Global->POST['Data']['Custody'])) {
                                                                  $tblAddressCustody = Address::useService()->getAddressByPerson($PersonCustody);
                      Severity: Major
                      Found in Application/Document/Standard/AccidentReport/AccidentReport.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/Node5.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if ($tblGender->getName() == 'Männlich') {
                                                          $maleList[] = $tblStudent;
                                                          continue;
                                                      } elseif ($tblGender->getName() == 'Weiblich') {
                                                          $femaleList[] = $tblStudent;
                          Severity: Major
                          Found in Application/Education/Lesson/Division/Service.php - About 45 mins to fix

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

                                    TblPeriod $tblPeriod,
                                    $Name,
                                    $Description,
                                    $From,
                                    $To,
                            Severity: Minor
                            Found in Application/Education/Lesson/Term/Service/Data.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if ($hasMigrationBackground) {
                                                              if (isset($Content['B01_1']['Leave']['L' . $certificate][$gender])) {
                                                                  $Content['B01_1']['Leave']['L' . $certificate][$gender]++;
                                                              } else {
                                                                  $Content['B01_1']['Leave']['L' . $certificate][$gender] = 1;
                              Severity: Major
                              Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                        if ($tblPrepareStudent->isPrinted()
                                                                            && ($tblPerson = $tblPrepareStudent->getServiceTblPerson())
                                                                            && ($tblCertificate = $tblPrepareStudent->getServiceTblCertificate())
                                                                        ) {
                                
                                
                                Severity: Major
                                Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                      if ($tblSubjectStudent->getServiceTblPerson()) {
                                                                          if (($tblPerson = $tblSubjectStudent->getServiceTblPerson())) {
                                  
                                                                              if ($tblSubject->getName() == 'Deutsch' || $tblSubject->getName() == 'Mathematik') {
                                                                                  $personAdvancedCourseList[$tblLevel->getName()][$tblPerson->getId()][0]
                                  Severity: Major
                                  Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if (($tblPerson = $tblSubjectStudent->getServiceTblPerson())
                                                                            && ($tblCommon = Common::useService()->getCommonByPerson($tblPerson))
                                                                            && ($tblCommonBirthDates = $tblCommon->getTblCommonBirthDates())
                                                                            && ($tblCommonGender = $tblCommonBirthDates->getTblCommonGender())
                                                                        ) {
                                    Severity: Major
                                    Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language