DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                            if ($value && ($tblCommonGender = Common::useService()->getCommonGenderById($value))) {
                                $value = $tblCommonGender->getName();
                            }
Severity: Major
Found in Application/Setting/Consumer/Setting/Frontend.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if ($tblGender) {
                                    $item['Gender'] = substr($tblGender->getName(), 0, 1);
                                }
    Severity: Major
    Found in Application/Setting/User/Account/Service.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if ($tblTransferType) {
                                      $tblStudentTransfer = Student::useService()->getStudentTransferByType($tblStudent,
                                          $tblTransferType);
                                      if ($tblStudentTransfer && ($tblCourse = $tblStudentTransfer->getServiceTblCourse())) {
                                          $DataPerson['Course'] = $tblCourse->getName();
      Severity: Major
      Found in Application/Setting/User/Account/Frontend.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        if(($tblSchoolCompany = School::useService()->getSchoolByType($tblSchoolType))){
                                            $tblSchoolCompany = current($tblSchoolCompany);
                                            $tblCompany = $tblSchoolCompany->getServiceTblCompany();
                                        }
        Severity: Major
        Found in Application/Setting/User/Account/Service.php - About 45 mins to fix

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

              private function getStudentFilterResult($Person, $Year, $Division)
              {
          
                  $Pile = new Pile(Pile::JOIN_TYPE_INNER);
                  $Pile->addPile((new ViewPeopleGroupMember())->getViewService(), new ViewPeopleGroupMember(),
          Severity: Minor
          Found in Application/Setting/User/Account/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

          Avoid deeply nested control flow statements.
          Open

                                          if ($tblPersonStudent && $tblPersonStudent->getId() != $tblPerson->getId()) {
                                              $StudentList[] = new Container($tblPersonStudent->getLastFirstName());
                                          }
          Severity: Major
          Found in Application/Setting/User/Account/Frontend.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($value === '0') {
                                            $value = new Unchecked();
                                        } elseif ($value === '1') {
                                            $value = new Check();
                                        }
            Severity: Major
            Found in Application/Setting/Consumer/Setting/Frontend.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($value == TblAddress::VALUE_PLZ_ORT_OT_STR_NR) {
                                              $value = 'PLZ_ORT_OT_STR_NR';
                                          } elseif ($value == TblAddress::VALUE_OT_STR_NR_PLZ_ORT) {
                                              $value = 'OT_STR_NR_PLZ_ORT';
                                          }
              Severity: Major
              Found in Application/Setting/Consumer/Setting/Frontend.php - About 45 mins to fix

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

                        TblAccount $tblAccount,
                        TblPerson $tblPerson,
                        \DateTime $TimeStamp,
                        $userPassword,
                        $Type,
                Severity: Minor
                Found in Application/Setting/User/Account/Service.php - About 45 mins to fix

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

                          TblAccount $tblAccount,
                          TblPerson $tblPerson,
                          \DateTime $TimeStamp,
                          $userPassword,
                          $Type = 'STUDENT',
                  Severity: Minor
                  Found in Application/Setting/User/Account/Service/Data.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if(($tblType = $tblLevel->getServiceTblType()) && !in_array($tblType->getId(), $tblSchoolTypeList)){
                                                    // Schüler Überspringen
                                                    continue;
                                                }
                    Severity: Major
                    Found in Application/Setting/User/Account/Frontend.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if (!array_key_exists($tblPerson->getId(), $SearchResult)){
                                                              if ($countRow >= $MaxResult){
                                                                  break;
                                                              }
                                                              $countRow++;
                      Severity: Major
                      Found in Application/Setting/User/Account/Frontend.php - About 45 mins to fix

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

                            public function getAddressByPerson(TblPerson $tblPerson, $isForced = false)
                            {
                        
                                $Type = $this->getTypeByName(TblType::META_MAIN_ADDRESS);
                                $Parameter = array(
                        Severity: Minor
                        Found in Application/Contact/Address/Service/Data.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

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

                            public function getInvoiceAddressByPerson(TblPerson $tblPerson, $isForced = false)
                            {
                        
                                $Type = $this->getTypeByName(TblType::META_INVOICE_ADDRESS);
                                $Parameter = array(
                        Severity: Minor
                        Found in Application/Contact/Address/Service/Data.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

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

                            public function openModal($PersonId)
                            {
                        
                                $tblPerson = Person::useService()->getPersonById($PersonId);
                                if (!$tblPerson) {
                        Severity: Minor
                        Found in Application/Api/Contact/ApiContactAddress.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

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

                            public function openAccountModalResult($result = array(), $Type = 'S')
                            {
                        
                                $Content = '';
                                $Time = false;
                        Severity: Minor
                        Found in Application/Api/Setting/UserAccount/ApiUserAccount.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

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

                            public function frontendDestroyGroup($Id, $Confirm = false)
                            {
                        
                                $Stage = new Stage('Gruppe', 'Löschen');
                                if ($Id) {
                        Severity: Minor
                        Found in Application/Corporation/Group/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

                        Avoid deeply nested control flow statements.
                        Open

                                                                if($Behavior == 1){
                                                                    $OrExp->add( $Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
                                                                        $Parameter));
                                                                } elseif($Behavior == 2) {
                                                                    $OrExp->add( $Builder->expr()->neq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
                        Severity: Major
                        Found in Application/Api/Reporting/Individual/ApiIndividual.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if(($YearList = Term::useService()->getYearByNow())){
                                                          $tblYear = current($YearList);
                                                          // Speichern im Post
                                                          $PostArray['TblYear_Year[1]'] = $tblYear->getName();
                                                      }
                          Severity: Major
                          Found in Application/Api/Reporting/Individual/ApiIndividual.php - About 45 mins to fix

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

                                public function pieceEditGroup($Id, $Group, $receiverGroupList, $receiverModalCreate, $receiverModalEdit, $receiverModalDestroy)
                            Severity: Minor
                            Found in Application/Api/Platform/Gatekeeper/ApiUserGroup.php - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language