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.php - About 45 mins to fix

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

        protected function sanitizeNumber( $Value ) {
    
            if( is_numeric( $Value ) ) {
                return (float)$Value;
            } else {
    Severity: Minor
    Found in System/Database/Fitting/Element.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 ($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/AccidentReport/AccidentReport.php - About 45 mins to fix

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

          final protected function getCachedCountBy($__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 (!($MatchList = $this->filterNodeList($Key, $List, 5))) {
                                                      if (!isset($SearchList[5]) || empty($SearchList[5])) {
                                                          $Node5 = (new \ReflectionObject($ProbeList[5]->getEntity()))->newInstanceWithoutConstructor();
                                                          $Node5->__set($this->getPath(5)[0], $Key);
                                                          $MatchList = array(
      Severity: Major
      Found in System/Database/Filter/Link/Repository/Node7.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($tblAddressSchool) {
                                    $Global->POST['Data']['AddressStreet'] = $tblAddressSchool->getStreetName().' '.$tblAddressSchool->getStreetNumber();
                                    $tblCitySchool = $tblAddressSchool->getTblCity();
                                    if ($tblCitySchool) {
                                        $Global->POST['Data']['AddressCity'] = $tblCitySchool->getCode().', '.$tblCitySchool->getName();
        Severity: Major
        Found in Application/Document/Standard/StudentTransfer/StudentTransfer.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                  if ($tblPrepareStudent->isPrinted()
                                                      && ($tblPerson = $tblPrepareStudent->getServiceTblPerson())
                                                      && ((($tblPrepareInformationTransfer = Prepare::useService()->getPrepareInformationBy(
                                                                  $tblPrepare, $tblPerson, 'Transfer'
                                                              ))
          Severity: Major
          Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                            if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
                                                foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
                                                    if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
                                                        && Subject::useService()->isOrientation($tblSubjectTemp)
                                                    ) {
            Severity: Major
            Found in Application/Document/Generator/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (($tblDivisionSubjectList = Division::useService()->getDivisionSubjectAllByPersonAndYear($tblPerson, $tblYear))) {
                                                  foreach ($tblDivisionSubjectList as $tblDivisionSubject) {
                                                      if (($tblSubjectTemp = $tblDivisionSubject->getServiceTblSubject())
                                                          && Subject::useService()->isProfile($tblSubjectTemp)
                                                      ) {
              Severity: Major
              Found in Application/Document/Generator/Service.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if ($value == 'nicht erteilt') {
                                                    $value = 'ne';
                                                } elseif ($value == 'teilgenommen') {
                                                    $value = 't';
                                                } elseif ($value == 'Keine Benotung') {
                Severity: Major
                Found in Application/Document/Generator/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

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

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

                            TblPartition $tblPartition,
                            $Name,
                            $Description,
                            TblDirectory $tblDirectory = null,
                            $IsLocked = false,
                    Severity: Minor
                    Found in Application/Document/Storage/Service/Data.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if ($tblSchoolEnrollmentType->getIdentifier() == 'PREMATURE') {
                                                  if (isset($Content['D01']['Premature'][$gender])) {
                                                      $Content['D01']['Premature'][$gender]++;
                                                  } else {
                                                      $Content['D01']['Premature'][$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 ($this->checkTimeout()) {
                                                                        throw new NodeException();
                                                                    }
                        Severity: Major
                        Found in System/Database/Filter/Link/Repository/Node5.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if(($tblSchoolList = School::useService()->getSchoolByType($tblType))){
                                                      // bei einer Schule kann diese genommen werden. (Normalfall)
                                                      if(count($tblSchoolList) == 1){
                                                          $tblSchool = current($tblSchoolList);
                                                          // Übernahme nur, wenn eine Unternehmensnummer hinterlegt ist
                          Severity: Major
                          Found in Application/Document/Standard/AccidentReport/AccidentReport.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ($MaxDate > new \DateTime($transferDate)) {
                                                        $DateString = $transferDate;
                                                        // correct leaveDate if necessary
                                                        $Global->POST['Data']['LeaveDate'] = $DateString;
                                                    }
                            Severity: Major
                            Found in Application/Document/Standard/EnrollmentDocument/EnrollmentDocument.php - About 45 mins to fix

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

                                  public function frontendDivisionChange($Id = null, $Division = null)
                                  {
                              
                                      $Stage = new Stage('Klasse', 'Bearbeiten');
                                      $Stage->addButton(new Standard('Zurück', '/Education/Lesson/Division', new ChevronLeft()));
                              Severity: Minor
                              Found in Application/Education/Lesson/Division/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 createDirectory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      TblPartition $tblPartition,
                                      $Name,
                                      $Description,
                                      TblDirectory $tblDirectory = null,
                                      $IsLocked = false,
                              Severity: Minor
                              Found in Application/Document/Storage/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                        if ($hasMigrationBackground) {
                                                            if (isset($countMigrantsArray[$birthYear][$tblLevel->getName()][$gender])) {
                                                                $countMigrantsArray[$birthYear][$tblLevel->getName()][$gender]++;
                                                            } else {
                                                                $countMigrantsArray[$birthYear][$tblLevel->getName()][$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 ($birthYear) {
                                                                  if (isset($countArray[$birthYear]['Leave'][$gender])) {
                                                                      $countArray[$birthYear]['Leave'][$gender]++;
                                                                  } else {
                                                                      $countArray[$birthYear]['Leave'][$gender] = 1;
                                  Severity: Major
                                  Found in Application/Document/Generator/Service/Kamenz/KamenzReportService.php - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language