DerDu/SPHERE-Framework

View on GitHub

Showing 5,014 of 7,620 total issues

Avoid deeply nested control flow statements.
Open

                                    if ($Key > 2) {
                                        break;
                                    }
Severity: Major
Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
                                            if (!isset($Data[$tblAddress->getId()]['Person'])) {
                                                $Data[$tblAddress->getId()]['Person'] =
                                                    $PersonToAddress->getLastName().' '.$PersonToAddress->getFirstName();
                                                if ($PersonToAddress->getSalutation() === '') {
    Severity: Major
    Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                              if ($tblToCompany->getServiceTblCompany()->getId() === $tblRelationship->getServiceTblCompany()->getId()) {
                                                  $RelationShip = $tblType->getName();
                                                  /** @var TblToPerson $tblRelationship */
                                                  $subDataList[] = array(
                                                      'Salutation'   => $tblPerson->getSalutation(),
      Severity: Major
      Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                                    if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
                                                        if (!isset($AddressList[$tblPerson->getId().$tblAddress->getId()]['PersonToWrite'])) {
                                                            $AddressList[$tblPerson->getId().$tblAddress->getId()]['PersonToWrite'] =
                                                                $PersonToAddress->getLastName().' '.$PersonToAddress->getFirstName();
                                                            $AddressList[$tblPerson->getId().$tblAddress->getId()]['SalutationList'] =
        Severity: Major
        Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                              if ($tblToPersonList) {
                                                  $tblType = Address::useService()->getTypeById(1);
                                                  $tblToPersonChoose = null;
                                                  // Ziehen der ersten Hauptadresse
                                                  /** @var TblToPerson $tblToPerson */
          Severity: Major
          Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (!empty($FilterProspect)) {
                                        foreach ($FilterProspect as $FieldName => $FilterNumberList) {
                                            foreach ($FilterNumberList as $FilterNumber => $FieldValue) {
                                                if ($FieldValue) {
                                                    ( new Data($this->getBinding()) )->createFilterField($tblSerialLetter, $tblFilterCategory,
            Severity: Major
            Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if ($tblToCompanyList) {
                                                  foreach ($tblToCompanyList as $tblToCompany) {
                                                      if ($tblToCompany->getTblType()->getId() === $tblType->getId()) {
              //                                            $tblSalutation = $tblPerson->getTblSalutation();
                                                          $PersonTo = $tblPerson;
              Severity: Major
              Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

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

                    private function frontendPersonAddressContent($Id = null)
                    {
                
                        $Stage = new Stage('Adresslisten für Serienbriefe', 'Person mit Adressen auswählen');
                        $Stage->addButton(new Standard('Zurück', '/Reporting/SerialLetter', new ChevronLeft()));
                Severity: Minor
                Found in Application/Reporting/SerialLetter/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 (( $PersonToAddress = $tblToPerson->getServiceTblPerson() )) {
                                                    if (( $tblAddress = $serviceTblPersonToAddress->getTblAddress() )) {
                                                        //Person SerialLetter
                                                        $AddressList[$tblPerson->getId().$tblAddress->getId()]['Salutation'] =
                                                            $tblPerson->getSalutation();
                Severity: Major
                Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if ($tblLevel && $tblYear) {
                                                      $VisitedDivisionList[] = new Small(new Muted('Aktuelle Klasse:')).new Container($tblDivision->getDisplayName());
                                                  }
                  Severity: Major
                  Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

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

                        public function getFormField( $PropertyName, $Placeholder = null, $Label = null, IIconInterface $Icon = null,
                            $doResetCount = false, $ViewType = TblWorkSpace::VIEW_TYPE_ALL  )
                    Severity: Minor
                    Found in Application/Reporting/Individual/Service/Entity/ViewPersonContact.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                                      if ($tblStudent) {
                                                                          if ($tblStudent->getIdentifierComplete() != '') {
                                                                              $StudentNumber = $tblStudent->getIdentifierComplete();
                                                                          }
                                                                      }
                      Severity: Major
                      Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ($tblObjectType->getIdentifier() === 'PERSON') {
                                                            $tblPerson = Person::useService()->getPersonById($objectId);
                                                            if ($tblPerson) {
                                                                $tblObject = $tblPerson;
                                                                $name = $tblPerson->getLastFirstName();
                        Severity: Major
                        Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          if ($tblProspect) {
                                                              $tblProspectReservation = $tblProspect->getTblProspectReservation();
                                                              if ($tblProspectReservation) {
                                                                  if ($filterYear) {
                                                                      $year = trim($tblProspectReservation->getReservationYear());
                          Severity: Major
                          Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                if ($tblPerson) {
                                                                    $tblGroupList = Group::useService()->getGroupAllByPerson($tblPerson);
                                                                    if ($tblGroupList) {
                                                                        foreach ($tblGroupList as $tblGroup) {
                                                                            $tblGroupCommon = Group::useService()->getGroupByMetaTable('COMMON');
                            Severity: Major
                            Found in Application/Reporting/CheckList/Frontend.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if ($tblListObjectElementList->getServiceTblObject()) {
                                                                          if (!isset($Data[$tblListObjectElementList->getTblObjectType()->getId()]
                                                                              [$tblListObjectElementList->getServiceTblObject()->getId()]
                                                                              [$tblListObjectElementList->getTblListElementList()->getId()])
                                                                          ) {
                              Severity: Major
                              Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if ($tblObject) {
                                                                      $tblListObjectElementList = $this->getListObjectElementListByListAndObjectTypeAndListElementListAndObject(
                                                                          $tblList, $tblObjectType, $tblObject
                                                                      );
                                                                      if ($tblListObjectElementList) {
                                  Severity: Major
                                  Found in Application/Reporting/CheckList/Service.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            if (!empty($FilterGroup)) {
                                                                foreach ($FilterGroup as $FieldName => $FilterList) {
                                                                    foreach ($FilterList as $FilterNumber => $FieldValue) {
                                                                        if ($FieldValue) {
                                                                            ( new Data($this->getBinding()) )->createFilterField($tblSerialLetter, $tblFilterCategory,
                                    Severity: Major
                                    Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                      if ($tblRelationship->getTblType()) {
                                                                          $Data['Type'] = $tblRelationship->getTblType()->getName();
                                                                      }
                                      Severity: Major
                                      Found in Application/Reporting/SerialLetter/SerialLetterFilter.php - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language