DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

    private function getRealNameByViewType($ViewType = TblWorkSpace::VIEW_TYPE_ALL)
    {
        switch($ViewType){
            case TblWorkSpace::VIEW_TYPE_ALL :
                $Name = 'Allgemein';
Severity: Minor
Found in Application/Api/Reporting/Individual/ApiIndividual.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(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
                                        // Add AND Condition to Where (if filter is set)
                                        if($Behavior == 1){
                                            $Builder->andWhere(
                                                $Builder->expr()->eq($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
Severity: Major
Found in Application/Api/Reporting/Individual/ApiIndividual.php - About 45 mins to fix

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

        public function showDeleteBasketSelection($Identifier = '', $BasketVerificationId = '')
        {
    
            $tblBasketVerification = Basket::useService()->getBasketVerificationById($BasketVerificationId);
            if($tblBasketVerification){
    Severity: Minor
    Found in Application/Api/Billing/Bookkeeping/ApiBasketVerification.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(!isset($_POST['DebtorSelection']['BankReference'])){
                                $_POST['DebtorSelection']['BankReference'] = $tblBankReferenceList[0]->getId();
                            }
    Severity: Major
    Found in Application/Api/Billing/Bookkeeping/ApiBasketVerification.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

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

        Avoid deeply nested control flow statements.
        Open

                                            if(in_array($tblWorkSpace->getField(), $this->reducedSelectBoxList)) {
                                                // Add AND Condition to Where (if filter is set)
                                                if($Value === '' && $Behavior == 1){
                                                    $Builder->andWhere(
                                                        $Builder->expr()->like($tblWorkSpace->getView().'.'.$tblWorkSpace->getField(),
        Severity: Major
        Found in Application/Api/Reporting/Individual/ApiIndividual.php - About 45 mins to fix

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

              private function getPostForGender($genderSetting, $genderName)
              {
          
                  $post = null;
                  if ($genderName == 'Weiblich') {
          Severity: Minor
          Found in Application/Api/Contact/ApiRelationshipToPerson.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($tblBasket && new \DateTime($tblBankReference->getReferenceDate()) > new \DateTime($tblBasket->getTargetTime())){
                                          $form->setError('DebtorSelection[BankReference]', 'Die ausgewählte Mandatsreferenznummer 
                                          ist zum akuellen Fälligkeitsdatum ('.$tblBasket->getTargetTime().') noch nicht verfügbar.');
                                          $Error = true;
                                      }
          Severity: Major
          Found in Application/Api/Billing/Bookkeeping/ApiBasketVerification.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($tblStudentSubject && ($tblSubject = $tblStudentSubject->getServiceTblSubject())) {
                                            $DataPerson['Edit'] = new Muted('('.$tblSubject->getAcronym().') ').$tblSubject->getName();
                                        }
            Severity: Major
            Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($Label == $i . '. Arbeitsgemeinschaft'){
                                              $tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('TEAM');
                                              $tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier($i);
                                              $tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
                                                  $tblStudentSubjectType, $tblStudentSubjectRanking);
              Severity: Major
              Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                            if ($Label == new Muted(new Small($i . '. Fremdsprache von Klasse'))){
                                                $tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE');
                                                $tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier($i);
                                                $tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
                                                    $tblStudentSubjectType, $tblStudentSubjectRanking);
                Severity: Major
                Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                              if ($Label == new Muted(new Small($i . '. Fremdsprache bis Klasse'))){
                                                  $tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE');
                                                  $tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier($i);
                                                  $tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
                                                      $tblStudentSubjectType, $tblStudentSubjectRanking);
                  Severity: Major
                  Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if ($Label == $i . '. Fremdsprache'){
                                                    $tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE');
                                                    $tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier($i);
                                                    $tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,
                                                        $tblStudentSubjectType, $tblStudentSubjectRanking);
                    Severity: Major
                    Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                  if($tblItemCalculation){
                                                      $ItemPrice = $tblItemCalculation->getValue();
                                                  }
                      Severity: Major
                      Found in Application/Api/Billing/Accounting/ApiDebtorSelection.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if(($tblItem = $tblBasketVerification->getServiceTblItem())){
                                                        $ItemString = $tblItem->getName();
                                                    }
                        Severity: Major
                        Found in Application/Api/Billing/Accounting/ApiBankReference.php - About 45 mins to fix

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

                              public function changeSelectedGender()
                              {
                          
                                  $Global = $this->getGlobal();
                                  $Person = $Global->POST['Person'];
                          Severity: Minor
                          Found in Application/Api/People/Person/ApiPersonEdit.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 ($tblStudentTransfer) {
                                                          // Ersteinschulung
                                                          if (($tblCompany = $tblStudentTransfer->getServiceTblCompany()) && $Label == 'Schule'
                                                              && $tblStudentTransferType->getIdentifier() == 'ENROLLMENT'
                                                          ) {
                          Severity: Major
                          Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                        if ($tblStudentSubject && ($tblSubject = $tblStudentSubject->getServiceTblSubject())) {
                                                            $DataPerson['Edit'] = new Muted('('.$tblSubject->getAcronym().') ').$tblSubject->getName();
                                                        }
                            Severity: Major
                            Found in Application/Api/MassReplace/StudentFilter.php - About 45 mins to fix

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

                                      $modalField,
                                      $CloneField,
                                      $TypeId,
                                      $RankingId,
                                      $PersonIdArray = array(),
                              Severity: Minor
                              Found in Application/Api/People/Meta/Subject/MassReplaceSubject.php - About 45 mins to fix

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

                                        $modalField,
                                        $CloneField,
                                        $TypeId,
                                        $RankingId,
                                        $PersonIdArray = array(),
                                Severity: Minor
                                Found in Application/Api/People/Meta/Subject/MassReplaceSubject.php - About 45 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language