DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

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

    public function getServiceTblObject()
    {

        if (null === $this->serviceTblObject) {
            return false;
Severity: Minor
Found in Application/Reporting/CheckList/Service/Entity/TblListObjectList.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 ($tblProspectReservation->getServiceTblTypeOptionB()) {
                                $DataPerson['ReservationOptionB'] = $tblProspectReservation->getServiceTblTypeOptionB()->getName();
                            }
Severity: Major
Found in Application/Reporting/SerialLetter/SerialLetterFilter.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                if ($tblObjectType->getIdentifier() === 'PERSON') {
                                    foreach ($objects as $objectId => $value) {
                                        $countTotalPerson++;
                                        $tblPerson = Person::useService()->getPersonById($objectId);
                                        if ($tblPerson) {
    Severity: Major
    Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                                  if ($tblListObjectElementList->getValue() == 1) {
                                                      $list[$count]['Field'.$tblListElementList->getId()] = new Center(new SuccessIcon());
                                                  }
      Severity: Major
      Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if ($tblProspectReservation) {
                                    $filterLevel = trim($tblProspectReservation->getReservationDivision());
                                }
        Severity: Major
        Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                                      if ($tblProspectReservation) {
                                                          $level = $tblProspectReservation->getReservationDivision();
                                                          $year = $tblProspectReservation->getReservationYear();
                                                          $optionA = $tblProspectReservation->getServiceTblTypeOptionA();
                                                          $optionB = $tblProspectReservation->getServiceTblTypeOptionB();
          Severity: Major
          Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                        if (( $tblAddress = Address::useService()->getAddressByPerson($tblPerson) )) {
                                                            $Address = $tblAddress->getGuiTwoRowString();
                                                        }
            Severity: Major
            Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                          if ($tblProspectReservation->getServiceTblTypeOptionA()) {
                                              $DataPerson['ReservationOptionA'] = $tblProspectReservation->getServiceTblTypeOptionA()->getName();
                                          }
              Severity: Major
              Found in Application/Reporting/SerialLetter/SerialLetterFilter.php - About 45 mins to fix

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

                    public function updateListElementList(IFormInterface $Stage = null, TblList $tblList, TblListElementList $tblListElementList, $ElementName)
                    {
                
                        /**
                         * Skip to Frontend
                Severity: Minor
                Found in Application/Reporting/CheckList/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 ($tblGroupList) {
                                                        foreach ($tblGroupList as $tblGroup) {
                                                            $tblGroupCommon = CompanyGroup::useService()->getGroupByMetaTable('COMMON');
                                                            if ($tblGroupCommon->getId() != $tblGroup->getId()) {
                                                                $groups[] = $tblGroup->getName();
                Severity: Major
                Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                              if(($tblToPhoneList = Phone::useService()->getPhoneAllByPerson($tblPerson))) {
                                                                  $ProspectPhoneList = array();
                                                                  foreach ($tblToPhoneList as $tblToPhone) {
                                                                      if (($tblPhone = $tblToPhone->getTblPhone())) {
                                                                          $ProspectPhoneList[] = $tblPhone->getNumber()
                  Severity: Major
                  Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                                if ($guardianList) {
                                                                    foreach ($guardianList as $guardian) {
                                                                        $tblPersonGuardian = $guardian->getServiceTblPersonFrom();
                                                                        if ($tblPersonGuardian && $guardian->getTblType()->getId() == 1) {
                                                                            // get PhoneNumber by Guardian
                    Severity: Major
                    Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                                  if ($tblListObjectElementList->getValue() === "0") {
                                                                      $list[$count]['Field'.$tblListElementList->getId()] = ' '.$tblListObjectElementList->getValue();
                                                                  }
                      Severity: Major
                      Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                                if (!$hasFilter) {
                                                                    $filterPersonObjectList[$tblPerson->getId()] = $tblPerson;
                                                                }
                        Severity: Major
                        Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      if (!empty($objects)) {
                                                          foreach ($objects as $objectId => $value) {
                                                              if ($tblObjectType->getIdentifier() === 'PERSON') {
                                                                  $tblPerson = Person::useService()->getPersonById($objectId);
                                                                  $prospectGroup = Group::useService()->getGroupByMetaTable('PROSPECT');
                          Severity: Major
                          Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

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

                                public function addElementToList(IFormInterface $Stage = null, $Id, $Element)
                                {
                            
                                    /**
                                     * Skip to Frontend
                            Severity: Minor
                            Found in Application/Reporting/CheckList/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

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

                                    $Id = null,
                                    $Filter = null,
                            //        $Data = null,
                            //        $HasData = null,
                                    $YearPersonId = null,
                            Severity: Minor
                            Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

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

                                  public function frontendSetup($Simulation = true, $Heal = false)
                                  {
                              
                                      $ClassList = get_declared_classes();
                                      self::$ServiceRegister = array_merge(
                              Severity: Minor
                              Found in Application/Platform/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

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

                                  public function uploadNow(IFormInterface &$Stage = null, $FileUpload)
                                  {
                              
                                      /**
                                       * Skip to Frontend
                              Severity: Minor
                              Found in Application/Platform/System/Test/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 ($num_files < $cache_lo_water_mark) {
                                                              break;
                                                          }
                              Severity: Major
                              Found in Application/Platform/System/Protocol/Difference/viewdiff.php - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language