DerDu/SPHERE-Framework

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

Summary

Maintainability
F
1 mo
Test Coverage

Function createSerialLetterExcel has a Cognitive Complexity of 365 (exceeds 5 allowed). Consider refactoring.
Open

    public function createSerialLetterExcel(TblSerialLetter $tblSerialLetter)
    {

        $tblPersonList = $this->getPersonAllBySerialLetter($tblSerialLetter);
        $ExportData = array();
Severity: Minor
Found in Application/Reporting/SerialLetter/Service.php - About 1 wk 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 updateSerialLetter has a Cognitive Complexity of 274 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateSerialLetter(
        IFormInterface $Stage = null,
        TblSerialLetter $tblSerialLetter,
        $SerialLetter = null,
        $FilterGroup = null,
Severity: Minor
Found in Application/Reporting/SerialLetter/Service.php - About 5 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

File Service.php has 1300 lines of code (exceeds 250 allowed). Consider refactoring.
Open

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

use MOC\V\Component\Document\Component\Bridge\Repository\PhpExcel;
use MOC\V\Component\Document\Component\Parameter\Repository\FileParameter;
Severity: Major
Found in Application/Reporting/SerialLetter/Service.php - About 3 days to fix

    Function createSerialLetter has a Cognitive Complexity of 163 (exceeds 5 allowed). Consider refactoring.
    Open

        public function createSerialLetter(
            IFormInterface $Stage = null,
            $SerialLetter,
            $FilterGroup = null,
            $FilterPerson = null,
    Severity: Minor
    Found in Application/Reporting/SerialLetter/Service.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 createAddressPersonGuardian has a Cognitive Complexity of 103 (exceeds 5 allowed). Consider refactoring.
    Open

        public function createAddressPersonGuardian(TblSerialLetter $tblSerialLetter)
        {
            $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
            if ($tblSerialPersonList) {
                $CreateArray = array();
    Severity: Minor
    Found in Application/Reporting/SerialLetter/Service.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 createSerialLetterExcel has 291 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function createSerialLetterExcel(TblSerialLetter $tblSerialLetter)
        {
    
            $tblPersonList = $this->getPersonAllBySerialLetter($tblSerialLetter);
            $ExportData = array();
    Severity: Major
    Found in Application/Reporting/SerialLetter/Service.php - About 1 day to fix

      Function setPersonAddressSelection has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setPersonAddressSelection(
              IFormInterface $Form,
              TblSerialLetter $tblSerialLetter,
              TblPerson $tblPerson,
              $Check,
      Severity: Minor
      Found in Application/Reporting/SerialLetter/Service.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

      Function createAddressPersonCompany has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createAddressPersonCompany(TblSerialLetter $tblSerialLetter)
          {
      
              $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
              $tblType = Address::useService()->getTypeById(1);
      Severity: Minor
      Found in Application/Reporting/SerialLetter/Service.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

      Service has 48 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Service extends AbstractService
      {
      
          /**
           * @param bool $doSimulation
      Severity: Minor
      Found in Application/Reporting/SerialLetter/Service.php - About 6 hrs to fix

        Function getAddressPersonAllByPerson has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAddressPersonAllByPerson(
                TblSerialLetter $tblSerialLetter,
                TblPerson $tblPerson
            ) {
        
        
        Severity: Minor
        Found in Application/Reporting/SerialLetter/Service.php - About 6 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

        Method updateSerialLetter has 144 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function updateSerialLetter(
                IFormInterface $Stage = null,
                TblSerialLetter $tblSerialLetter,
                $SerialLetter = null,
                $FilterGroup = null,
        Severity: Major
        Found in Application/Reporting/SerialLetter/Service.php - About 5 hrs to fix

          Function createAddressPersonSelf has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createAddressPersonSelf(TblSerialLetter $tblSerialLetter)
              {
                  $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
                  if ($tblSerialPersonList) {
                      $CreateArray = array();
          Severity: Minor
          Found in Application/Reporting/SerialLetter/Service.php - About 5 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

          Method createSerialLetter has 143 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function createSerialLetter(
                  IFormInterface $Stage = null,
                  $SerialLetter,
                  $FilterGroup = null,
                  $FilterPerson = null,
          Severity: Major
          Found in Application/Reporting/SerialLetter/Service.php - About 5 hrs to fix

            Function updateDynamicSerialCompany has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updateDynamicSerialCompany(TblSerialLetter $tblSerialLetter, $tblCompanySearchList)
                {
            
                    if (!empty($tblCompanySearchList)) {
            
            
            Severity: Minor
            Found in Application/Reporting/SerialLetter/Service.php - About 5 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

            Method createSerialLetterCompanyExcel has 118 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createSerialLetterCompanyExcel(TblSerialLetter $tblSerialLetter)
                {
            
                    $ExportData = array();
                    $tblSerialCompanyList = $this->getSerialCompanyBySerialLetter($tblSerialLetter, false);
            Severity: Major
            Found in Application/Reporting/SerialLetter/Service.php - About 4 hrs to fix

              Function getSerialLetterCount has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getSerialLetterCount(TblSerialLetter $tblSerialLetter)
                  {
              
                      $result = 0;
                      $tblSerialLetterPersonList = SerialLetter::useService()->getPersonAllBySerialLetter($tblSerialLetter);
              Severity: Minor
              Found in Application/Reporting/SerialLetter/Service.php - About 4 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

              Method createAddressPersonGuardian has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function createAddressPersonGuardian(TblSerialLetter $tblSerialLetter)
                  {
                      $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
                      if ($tblSerialPersonList) {
                          $CreateArray = array();
              Severity: Major
              Found in Application/Reporting/SerialLetter/Service.php - About 2 hrs to fix

                Method setPersonAddressSelection has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function setPersonAddressSelection(
                        IFormInterface $Form,
                        TblSerialLetter $tblSerialLetter,
                        TblPerson $tblPerson,
                        $Check,
                Severity: Major
                Found in Application/Reporting/SerialLetter/Service.php - About 2 hrs to fix

                  Method updateDynamicSerialCompany has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function updateDynamicSerialCompany(TblSerialLetter $tblSerialLetter, $tblCompanySearchList)
                      {
                  
                          if (!empty($tblCompanySearchList)) {
                  
                  
                  Severity: Minor
                  Found in Application/Reporting/SerialLetter/Service.php - About 1 hr to fix

                    Method getAddressPersonAllByPerson has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getAddressPersonAllByPerson(
                            TblSerialLetter $tblSerialLetter,
                            TblPerson $tblPerson
                        ) {
                    
                    
                    Severity: Minor
                    Found in Application/Reporting/SerialLetter/Service.php - About 1 hr to fix

                      Method createAddressPersonCompany has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function createAddressPersonCompany(TblSerialLetter $tblSerialLetter)
                          {
                      
                              $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
                              $tblType = Address::useService()->getTypeById(1);
                      Severity: Minor
                      Found in Application/Reporting/SerialLetter/Service.php - About 1 hr to fix

                        Method createAddressPersonSelf has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function createAddressPersonSelf(TblSerialLetter $tblSerialLetter)
                            {
                                $tblSerialPersonList = SerialLetter::useService()->getSerialPersonBySerialLetter($tblSerialLetter);
                                if ($tblSerialPersonList) {
                                    $CreateArray = array();
                        Severity: Minor
                        Found in Application/Reporting/SerialLetter/Service.php - About 1 hr to fix

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

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

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

                                public function updateDynamicSerialPerson(TblSerialLetter $tblSerialLetter, $tblPersonSearchList)
                                {
                            
                                    if ($tblPersonSearchList) {
                            
                            
                            Severity: Minor
                            Found in Application/Reporting/SerialLetter/Service.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 updateSerialLetter has 9 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    IFormInterface $Stage = null,
                                    TblSerialLetter $tblSerialLetter,
                                    $SerialLetter = null,
                                    $FilterGroup = null,
                                    $FilterStudent = null,
                            Severity: Major
                            Found in Application/Reporting/SerialLetter/Service.php - About 1 hr 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 ($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 (!empty($FilterYear)) {
                                                              foreach ($FilterYear 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 (!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 ($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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                if (!empty($FilterGroup)) {
                                                                    foreach ($FilterGroup as $FieldName => $FilterList) {
                                                                        foreach ($FilterList as $FilterNumber => $FieldValue) {
                                                                            if ($FieldValue) {
                                                                                if ($SaveFilterField) {
                                        Severity: Major
                                        Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if (!empty($FilterCompany)) {
                                                                      foreach ($FilterCompany 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 ($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 ($Salutation === 'Herr' || $Salutation === 'Frau') {
                                                                                          $isReady = false;
                                                                                      }
                                              Severity: Major
                                              Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if (!empty($FilterRelationship)) {
                                                                            foreach ($FilterRelationship 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 (!empty($FilterStudent)) {
                                                                              foreach ($FilterStudent 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 ($tblPerson->getId() !== $tblGuardian->getServiceTblPersonFrom()->getId()) {
                                                                                            $GuardianList[] = $tblGuardian->getServiceTblPersonFrom();
                                                                                        }
                                                    Severity: Major
                                                    Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                      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 (!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 (!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 (!in_array($tblAddress->getId(), $Address)) {
                                                                                                $result++;
                                                                                            }
                                                            Severity: Major
                                                            Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                              Avoid deeply nested control flow statements.
                                                              Open

                                                                                                      if ($Salutation !== 'Herr' && $Salutation !== 'Frau') {
                                                                                                          $isReady = false;
                                                                                                      }
                                                              Severity: Major
                                                              Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                                Avoid deeply nested control flow statements.
                                                                Open

                                                                                                if (isset($Address['PersonLastName']) && !empty($Address['PersonLastName'])) {
                                                                                                    if (isset($Address['PersonSalutation'])
                                                                                                        && count($Address['PersonLastName']) > 1
                                                                                                    ) {
                                                                                                        // Personen mit gleichem Nachnamen
                                                                Severity: Major
                                                                Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                                  Avoid deeply nested control flow statements.
                                                                  Open

                                                                                                  if (!empty($ToPersonChooseList)) {
                                                                  
                                                                                                      $count = 0;
                                                                                                      foreach ($ToPersonChooseList as $ToPersonChoose) {
                                                                  
                                                                  
                                                                  Severity: Major
                                                                  Found in Application/Reporting/SerialLetter/Service.php - About 45 mins to fix

                                                                    Method setPersonAddressSelection has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                    Open

                                                                            IFormInterface $Form,
                                                                            TblSerialLetter $tblSerialLetter,
                                                                            TblPerson $tblPerson,
                                                                            $Check,
                                                                            $Route = '/Reporting/SerialLetter/Address'
                                                                    Severity: Minor
                                                                    Found in Application/Reporting/SerialLetter/Service.php - About 35 mins to fix

                                                                      Method createAddressPerson has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                      Open

                                                                              TblSerialLetter $tblSerialLetter,
                                                                              TblPerson $tblPerson,
                                                                              TblPerson $tblPersonToAddress,
                                                                              TblToPerson $tblToPerson = null,
                                                                              TblToCompany $tblToCompany = null
                                                                      Severity: Minor
                                                                      Found in Application/Reporting/SerialLetter/Service.php - About 35 mins to fix

                                                                        Function getSerialLetterCompanyCount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                        Open

                                                                            public function getSerialLetterCompanyCount(TblSerialLetter $tblSerialLetter)
                                                                            {
                                                                        
                                                                                $result = 0;
                                                                                if(($tblSerialCompanyList = SerialLetter::useService()->getSerialCompanyBySerialLetter($tblSerialLetter))){
                                                                        Severity: Minor
                                                                        Found in Application/Reporting/SerialLetter/Service.php - About 25 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

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

                                                                                                                            if ($Address['PersonSalutation'][$Key] == 'Herr') {
                                                                                                                                $firstLetter .= ', sehr geehrter '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                                $secondLetter .= ', lieber '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                            } elseif ($Address['PersonSalutation'][$Key] == 'Frau') {
                                                                                                                                $firstLetter .= ', sehr geehrte '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 988..994

                                                                        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 141.

                                                                        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 ($Address['PersonSalutation'][$Key] == 'Herr') {
                                                                                                                                $firstLetter .= ', sehr geehrter '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                                $secondLetter .= ', lieber '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                            } elseif ($Address['PersonSalutation'][$Key] == 'Frau') {
                                                                                                                                $firstLetter .= ', sehr geehrte '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 1016..1022

                                                                        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 141.

                                                                        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 ($Address['PersonSalutation'][$Key] == 'Herr') {
                                                                                                                                $firstLetter = 'Sehr geehrter '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                                $secondLetter = 'Lieber '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                            } elseif ($Address['PersonSalutation'][$Key] == 'Frau') {
                                                                                                                                $firstLetter = 'Sehr geehrte '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 1005..1011

                                                                        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 141.

                                                                        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 ($Address['PersonSalutation'][$Key] == 'Herr') {
                                                                                                                                $firstLetter = 'Sehr geehrter '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                                $secondLetter = 'Lieber '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                                                                            } elseif ($Address['PersonSalutation'][$Key] == 'Frau') {
                                                                                                                                $firstLetter = 'Sehr geehrte '.$Address['PersonSalutation'][$Key].' '.$LastName;
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 977..983

                                                                        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 141.

                                                                        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($Item['Salutation']){
                                                                                            if($Item['Salutation'] == 'Herr'){
                                                                                                $Item['FirstLetter'] = 'Sehr geehrter '.$Item['Salutation'].' '.($Item['Title'] ? $Item['Title'].' ': '').$Item['LastName'];
                                                                                            } elseif($Item['Salutation'] == 'Frau'){
                                                                                                $Item['FirstLetter'] = 'Sehr geehrte '.$Item['Salutation'].' '.($Item['Title'] ? $Item['Title'].' ': '').$Item['LastName'];
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 1280..1286

                                                                        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 140.

                                                                        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($Item['Salutation']){
                                                                                            if($Item['Salutation'] == 'Herr'){
                                                                                                $Item['SecondLetter'] = 'Lieber '.$Item['Salutation'].' '.($Item['Title'] ? $Item['Title'].' ': '').$Item['LastName'];
                                                                                            } elseif($Item['Salutation'] == 'Frau'){
                                                                                                $Item['SecondLetter'] = 'Liebe '.$Item['Salutation'].' '.($Item['Title'] ? $Item['Title'].' ': '').$Item['LastName'];
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 2 hrs to fix
                                                                        Application/Reporting/SerialLetter/Service.php on lines 1272..1278

                                                                        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 140.

                                                                        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($SerialLetter['Name']) && empty($SerialLetter['Name'])) {
                                                                                    $Stage->setError('SerialLetter[Name]', 'Bitte geben Sie einen Namen an');
                                                                                    $Error = true;
                                                                                } else {
                                                                                    if (( $tblSerialLetterByName = SerialLetter::useService()->getSerialLetterByName($SerialLetter['Name']) )) {
                                                                        Severity: Major
                                                                        Found in Application/Reporting/SerialLetter/Service.php and 1 other location - About 1 hr to fix
                                                                        Application/Education/Lesson/Term/Service.php on lines 509..519

                                                                        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 106.

                                                                        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