DerDu/SPHERE-Framework

View on GitHub
Application/Reporting/SerialLetter/Frontend.php

Summary

Maintainability
F
1 mo
Test Coverage

File Frontend.php has 2670 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace SPHERE\Application\Reporting\SerialLetter;

use SPHERE\Application\Api\Reporting\SerialLetter\ApiSerialLetter;
use SPHERE\Application\Contact\Address\Address;
Severity: Major
Found in Application/Reporting/SerialLetter/Frontend.php - About 1 wk to fix

    Function frontendSerialLetterPersonSelected has a Cognitive Complexity of 168 (exceeds 5 allowed). Consider refactoring.
    Open

        public function frontendSerialLetterPersonSelected(
            $Id = null,
            $FilterGroup = null,
            $FilterStudent = null,
            $FilterPerson = null,
    Severity: Minor
    Found in Application/Reporting/SerialLetter/Frontend.php - About 3 days 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 frontendSerialLetterPersonSelected has 658 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function frontendSerialLetterPersonSelected(
            $Id = null,
            $FilterGroup = null,
            $FilterStudent = null,
            $FilterPerson = null,
    Severity: Major
    Found in Application/Reporting/SerialLetter/Frontend.php - About 3 days to fix

      Function frontendPersonAddressEdit has a Cognitive Complexity of 156 (exceeds 5 allowed). Consider refactoring.
      Open

          public function frontendPersonAddressEdit($Id = null, $PersonId = null, $Route = '/Reporting/SerialLetter/Address', $Check = null)
          {
      
              $Stage = new Stage('Adresse(n)', 'Auswählen');
              $tblSerialLetter = ( $Id === null ? false : SerialLetter::useService()->getSerialLetterById($Id) );
      Severity: Minor
      Found in Application/Reporting/SerialLetter/Frontend.php - About 3 days 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 frontendSerialLetterExport has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
      Open

          public function frontendSerialLetterExport(
              $Id = null,
              $Control = false
          ) {
              $Stage = new Stage('Adresslisten für Serienbriefe', 'Person mit Adressen herunterladen');
      Severity: Minor
      Found in Application/Reporting/SerialLetter/Frontend.php - About 2 days 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 frontendSerialLetterEdit has 373 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function frontendSerialLetterEdit(
              $Id = null,
              $Control = false,
              $SerialLetter = null,
              $TabActive = null,
      Severity: Major
      Found in Application/Reporting/SerialLetter/Frontend.php - About 1 day to fix

        Method frontendSerialLetterExport has 350 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function frontendSerialLetterExport(
                $Id = null,
                $Control = false
            ) {
                $Stage = new Stage('Adresslisten für Serienbriefe', 'Person mit Adressen herunterladen');
        Severity: Major
        Found in Application/Reporting/SerialLetter/Frontend.php - About 1 day to fix

          Function frontendSerialLetterEdit has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
          Open

              public function frontendSerialLetterEdit(
                  $Id = null,
                  $Control = false,
                  $SerialLetter = null,
                  $TabActive = null,
          Severity: Minor
          Found in Application/Reporting/SerialLetter/Frontend.php - About 1 day 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 frontendPersonAddressEdit has 295 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function frontendPersonAddressEdit($Id = null, $PersonId = null, $Route = '/Reporting/SerialLetter/Address', $Check = null)
              {
          
                  $Stage = new Stage('Adresse(n)', 'Auswählen');
                  $tblSerialLetter = ( $Id === null ? false : SerialLetter::useService()->getSerialLetterById($Id) );
          Severity: Major
          Found in Application/Reporting/SerialLetter/Frontend.php - About 1 day to fix

            Method frontendPersonAddressContent has 249 lines of code (exceeds 25 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: Major
            Found in Application/Reporting/SerialLetter/Frontend.php - About 1 day to fix

              Method frontendSerialLetter has 178 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function frontendSerialLetter(
                      $SerialLetter = null,
                      $TabActive = 'STATIC',
                      $FilterGroup = null,
                      $FilterPerson = null,
              Severity: Major
              Found in Application/Reporting/SerialLetter/Frontend.php - About 7 hrs to fix

                Method frontendCompanyAddressContent has 116 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function frontendCompanyAddressContent($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: Major
                Found in Application/Reporting/SerialLetter/Frontend.php - About 4 hrs to fix

                  Method frontendCompanyExport has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function frontendCompanyExport(TblSerialLetter $tblSerialLetter)
                      {
                          $Stage = new Stage('Adresslisten für Serienbriefe', 'Institutionen mit Adressen uns Ansprechpartner herunterladen');
                          $Stage->addButton(new Standard('Zurück', '/Reporting/SerialLetter', new ChevronLeft()));
                          $Stage->addButton(new Standard('Bearbeiten', '/Reporting/SerialLetter/Edit', new Edit(),
                  Severity: Major
                  Found in Application/Reporting/SerialLetter/Frontend.php - About 3 hrs to fix

                    Method frontendAddressRemove has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function frontendAddressRemove($Id = null, $Confirm = false)
                        {
                    
                            $Stage = new Stage('Adresslisten für Serienbriefe', 'Löschen');
                            if ($Id) {
                    Severity: Major
                    Found in Application/Reporting/SerialLetter/Frontend.php - About 3 hrs to fix

                      Method frontendSerialLetterDestroy has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function frontendSerialLetterDestroy($Id = null, $Confirm = false)
                          {
                      
                              $Stage = new Stage('Adresslisten für Serienbriefe', 'Löschen');
                              if ($Id) {
                      Severity: Major
                      Found in Application/Reporting/SerialLetter/Frontend.php - About 2 hrs to fix

                        Function frontendPersonAddress has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function frontendPersonAddress(
                                $Id = null,
                                $Control = false
                            ) {
                                $Stage = new Stage('Adresslisten für Serienbriefe', 'Adressen auswählen');
                        Severity: Minor
                        Found in Application/Reporting/SerialLetter/Frontend.php - About 2 hrs 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 frontendAddressRemove has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function frontendAddressRemove($Id = null, $Confirm = false)
                            {
                        
                                $Stage = new Stage('Adresslisten für Serienbriefe', 'Löschen');
                                if ($Id) {
                        Severity: Minor
                        Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr 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

                        Consider simplifying this complex logical expression.
                        Open

                                if ($FilterGroup && isset($FilterGroup['TblGroup_Id']) && $FilterGroup['TblGroup_Id'] !== '0'
                                    || $FilterPerson && ( isset($FilterPerson['TblPerson_FirstName']) && !empty($FilterPerson['TblPerson_FirstName'])
                                        || $FilterPerson['TblPerson_LastName'] && !empty($FilterPerson['TblPerson_LastName']) )
                                    && $TabActive === 'PERSON'
                                ) {
                        Severity: Critical
                        Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr to fix

                          Method frontendPersonAddress has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function frontendPersonAddress(
                                  $Id = null,
                                  $Control = false
                              ) {
                                  $Stage = new Stage('Adresslisten für Serienbriefe', 'Adressen auswählen');
                          Severity: Minor
                          Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr to fix

                            Method frontendSerialLetterEdit has 10 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $Id = null,
                                    $Control = false,
                                    $SerialLetter = null,
                                    $TabActive = null,
                                    $FilterGroup = null,
                            Severity: Major
                            Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr to fix

                              Function frontendSerialLetter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function frontendSerialLetter(
                                      $SerialLetter = null,
                                      $TabActive = 'STATIC',
                                      $FilterGroup = null,
                                      $FilterPerson = null,
                              Severity: Minor
                              Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr 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 frontendSerialLetter has 9 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      $SerialLetter = null,
                                      $TabActive = 'STATIC',
                                      $FilterGroup = null,
                                      $FilterPerson = null,
                                      $FilterStudent = null,
                              Severity: Major
                              Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr to fix

                                Method frontendSerialLetterPersonSelected has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        $Id = null,
                                        $FilterGroup = null,
                                        $FilterStudent = null,
                                        $FilterPerson = null,
                                        $FilterYear = null,
                                Severity: Major
                                Found in Application/Reporting/SerialLetter/Frontend.php - About 1 hr to fix

                                  Function frontendSerialLetterDestroy has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function frontendSerialLetterDestroy($Id = null, $Confirm = false)
                                      {
                                  
                                          $Stage = new Stage('Adresslisten für Serienbriefe', 'Löschen');
                                          if ($Id) {
                                  Severity: Minor
                                  Found in Application/Reporting/SerialLetter/Frontend.php - About 55 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 ($tblToCompany->getServiceTblCompany()->getId() === $tblRelationship->getServiceTblCompany()->getId()) {
                                                                              $RelationShip = $tblType->getName();
                                                                              $subDataList[] = array(
                                                                                  'Salutation'   => $tblPerson->getSalutation(),
                                                                                  'Person'       => $tblPerson->getFullName(),
                                  Severity: Major
                                  Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if ($tblProspectReservation) {
                                                                        $DataPerson['ProspectYear'] = $tblProspectReservation->getReservationYear();
                                                                        $DataPerson['ProspectDivision'] = $tblProspectReservation->getReservationDivision();
                                                                    }
                                    Severity: Major
                                    Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                                      if ($tblProspect) {
                                                                                          $tblProspectReservation = $tblProspect->getTblProspectReservation();
                                                                                          $AddressList[$tblPerson->getId().$tblAddress->getId()]['ReservationDivision'] = $tblProspectReservation->getReservationDivision();
                                                                                          $AddressList[$tblPerson->getId().$tblAddress->getId()]['ReservationYear'] = $tblProspectReservation->getReservationYear();
                                                                                          if ($tblProspectReservation->getServiceTblTypeOptionA()) {
                                      Severity: Major
                                      Found in Application/Reporting/SerialLetter/Frontend.php - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                                        if ($Division === '') {
                                                                                            $Division = new Small(new Muted('-NA-'));
                                                                                        }
                                        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($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

                                                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 ($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

                                                  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

                                                    Consider simplifying this complex logical expression.
                                                    Open

                                                            if (
                                                                $FilterGroup === null
                                                                && $FilterStudent === null
                                                                && $FilterPerson === null
                                                                && $FilterYear === null
                                                    Severity: Major
                                                    Found in Application/Reporting/SerialLetter/Frontend.php - About 40 mins to fix

                                                      Consider simplifying this complex logical expression.
                                                      Open

                                                              if ($FilterGroup === null && $FilterStudent === null && $FilterYear === null
                                                                  && $FilterProspect === null && $FilterCompany === null && $FilterRelationship === null
                                                              ) {
                                                                  if ($tblFilterFieldList) {
                                                                      foreach ($tblFilterFieldList as $tblFilterField) {
                                                      Severity: Major
                                                      Found in Application/Reporting/SerialLetter/Frontend.php - About 40 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return $this->frontendPersonAddressContent($Id);
                                                        Severity: Major
                                                        Found in Application/Reporting/SerialLetter/Frontend.php - About 30 mins to fix

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              public function frontendSerialLetterDestroy($Id = null, $Confirm = false)
                                                              {
                                                          
                                                                  $Stage = new Stage('Adresslisten für Serienbriefe', 'Löschen');
                                                                  if ($Id) {
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 3 days to fix
                                                          Application/Reporting/CheckList/Frontend.php on lines 247..312

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 587.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          : new Layout(
                                                                              new LayoutGroup(
                                                                                  new LayoutRow(array(
                                                                                      new LayoutColumn(array(
                                                                                          new TableData($tblPersonList, null,
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 2 days to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1398..1475

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 479.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          new Layout(
                                                                              new LayoutGroup(
                                                                                  new LayoutRow(array(
                                                                                      new LayoutColumn(array(
                                                                                          new TableData($tblPersonList, null,
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 2 days to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1476..1549

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 479.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                                                  if (!isset($Data[$tblAddress->getId()]['Person'])) {
                                                                                                      $Data[$tblAddress->getId()]['Person'] =
                                                                                                          $PersonToAddress->getLastName().' '.$PersonToAddress->getFirstName();
                                                                                                      if ($PersonToAddress->getSalutation() === '') {
                                                                                                          $WarningList[] = $PersonToAddress->getLastName().' '.
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 4 hrs to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1829..1844

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 176.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                                      if (!isset($Data[$tblAddress->getId()]['Person'])) {
                                                                                          $Data[$tblAddress->getId()]['Person'] =
                                                                                              $tblPerson->getLastName().' '.$tblPerson->getFirstName();
                                                                                          if ($tblPerson->getSalutation() === '') {
                                                                                              $WarningList[] = $tblPerson->getLastName().' '.
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 4 hrs to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1868..1883

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 176.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              public function frontendSetAddressByPerson($Id = null)
                                                              {
                                                          
                                                                  $Stage = new Stage('Befüllen der Adressen', '');
                                                                  $tblSerialLetter = ( !$Id ? false : SerialLetter::useService()->getSerialLetterById($Id) );
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 3 hrs to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 2067..2083

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 155.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                              public function frontendSetAddressByPersonGuardian($Id = null)
                                                              {
                                                          
                                                                  $Stage = new Stage('Befüllen der Adressen', 'aus Sorgeberechtigten');
                                                                  $tblSerialLetter = ( !$Id ? false : SerialLetter::useService()->getSerialLetterById($Id) );
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 3 hrs to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 2044..2060

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 155.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                          if($tblSerialCompany->getisIgnore()){
                                                                              $Content = (new Standard('', ApiSerialLetter::getEndpoint(), new SuccessIcon(), array(), 'Exportieren'))
                                                                                  ->ajaxPipelineOnClick(ApiSerialLetter::pipelineCompanyChangeStatus($tblSerialCompany->getId()));
                                                                          } else {
                                                                              $Content = (new Standard('', ApiSerialLetter::getEndpoint(), new Disable(), array(), 'Nicht Exportieren'))
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 1 hr to fix
                                                          Application/Api/Reporting/SerialLetter/ApiSerialLetter.php on lines 93..99

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 113.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                          Open

                                                                      if ($FilterType) {
                                                                          array_walk($FilterType, function (&$Input) {
                                                          
                                                                              if (!empty($Input)) {
                                                                                  $Input = explode(' ', $Input);
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 3 other locations - About 1 hr to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 910..923
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 925..938
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 955..968

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 104.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                          Open

                                                                      if ($FilterYear) {
                                                                          array_walk($FilterYear, function (&$Input) {
                                                          
                                                                              if (!empty($Input)) {
                                                                                  $Input = explode(' ', $Input);
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 3 other locations - About 1 hr to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 910..923
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 940..953
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 955..968

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 104.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                          Open

                                                                      if ($FilterProspect) {
                                                                          array_walk($FilterProspect, function (&$Input) {
                                                          
                                                                              if (!empty($Input)) {
                                                                                  $Input = explode(' ', $Input);
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 3 other locations - About 1 hr to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 910..923
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 925..938
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 940..953

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 104.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 4 locations. Consider refactoring.
                                                          Open

                                                                      if ($FilterPerson) {
                                                                          array_walk($FilterPerson, function (&$Input) {
                                                          
                                                                              if (!empty($Input)) {
                                                                                  $Input = explode(' ', $Input);
                                                          Severity: Major
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 3 other locations - About 1 hr to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 925..938
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 940..953
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 955..968

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 104.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                  if ($FilterGroup) {
                                                                      foreach ($FilterGroup as $Field => $Value) {
                                                                          if ($Value) {
                                                                              $FormProspect->setSuccess('FilterGroup['.$Field.']', '', new Filter());
                                                                          }
                                                          Severity: Minor
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 30 mins to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1245..1258

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 90.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                          Open

                                                                  if ($FilterGroup) {
                                                                      foreach ($FilterGroup as $Field => $Value) {
                                                                          if ($Value) {
                                                                              $FormGroup->setSuccess('FilterGroup['.$Field.']', '', new Filter());
                                                                          }
                                                          Severity: Minor
                                                          Found in Application/Reporting/SerialLetter/Frontend.php and 1 other location - About 30 mins to fix
                                                          Application/Reporting/SerialLetter/Frontend.php on lines 1291..1304

                                                          Duplicated Code

                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                          Tuning

                                                          This issue has a mass of 90.

                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                          Refactorings

                                                          Further Reading

                                                          There are no issues that match your filters.

                                                          Category
                                                          Status