DerDu/SPHERE-Framework

View on GitHub
Application/Contact/Address/Service.php

Summary

Maintainability
F
1 wk
Test Coverage

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

<?php
namespace SPHERE\Application\Contact\Address;

use SPHERE\Application\Contact\Address\Service\Data;
use SPHERE\Application\Contact\Address\Service\Entity\TblAddress;
Severity: Major
Found in Application/Contact/Address/Service.php - About 1 day to fix

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

    class Service extends AbstractService
    {
    
        /**
         * @return false|ViewAddressToPerson[]
    Severity: Minor
    Found in Application/Contact/Address/Service.php - About 5 hrs to fix

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

          public function checkFormAddressToPerson(
              TblPerson $tblPerson,
              $Street,
              $City,
              $Type,
      Severity: Minor
      Found in Application/Contact/Address/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

      Function checkFormAddressToCompany has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          public function checkFormAddressToCompany(
              TblCompany $tblCompany,
              $Street,
              $City,
              $Type,
      Severity: Minor
      Found in Application/Contact/Address/Service.php - About 3 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 checkFormAddressToPerson has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function checkFormAddressToPerson(
              TblPerson $tblPerson,
              $Street,
              $City,
              $Type,
      Severity: Major
      Found in Application/Contact/Address/Service.php - About 2 hrs to fix

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

            public function createAddressToCompanyByApi(
                TblCompany $tblCompany,
                $Street = array(),
                $City = array(),
                $State,
        Severity: Minor
        Found in Application/Contact/Address/Service.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 createAddressToPersonByApi has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            public function createAddressToPersonByApi(
                TblPerson $tblPerson,
                $Street = array(),
                $City = array(),
                $State,
        Severity: Minor
        Found in Application/Contact/Address/Service.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

        Method checkFormAddressToCompany has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function checkFormAddressToCompany(
                TblCompany $tblCompany,
                $Street,
                $City,
                $Type,
        Severity: Minor
        Found in Application/Contact/Address/Service.php - About 1 hr to fix

          Method createAddressToCompanyByApi has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function createAddressToCompanyByApi(
                  TblCompany $tblCompany,
                  $Street = array(),
                  $City = array(),
                  $State,
          Severity: Minor
          Found in Application/Contact/Address/Service.php - About 1 hr to fix

            Method createAddressToPersonByApi has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createAddressToPersonByApi(
                    TblPerson $tblPerson,
                    $Street = array(),
                    $City = array(),
                    $State,
            Severity: Minor
            Found in Application/Contact/Address/Service.php - About 1 hr to fix

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

                      TblPerson $tblPerson,
                      $StreetName,
                      $StreetNumber,
                      $CityCode,
                      $CityName,
              Severity: Major
              Found in Application/Contact/Address/Service.php - About 1 hr to fix

                Method insertAddressToCompany has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        TblCompany $tblCompany,
                        $StreetName,
                        $StreetNumber,
                        $CityCode,
                        $CityName,
                Severity: Major
                Found in Application/Contact/Address/Service.php - About 1 hr to fix

                  Method updateAddressToPersonByApi has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function updateAddressToPersonByApi(
                          TblToPerson $tblToPerson,
                          $Street,
                          $City,
                          $State,
                  Severity: Minor
                  Found in Application/Contact/Address/Service.php - About 1 hr to fix

                    Method updateAddressToCompanyByApi has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function updateAddressToCompanyByApi(
                            TblToCompany $tblToCompany,
                            $Street,
                            $City,
                            $State,
                    Severity: Minor
                    Found in Application/Contact/Address/Service.php - About 1 hr to fix

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

                          public function updateAddressToCompanyByApi(
                              TblToCompany $tblToCompany,
                              $Street,
                              $City,
                              $State,
                      Severity: Minor
                      Found in Application/Contact/Address/Service.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

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

                          public function updateAddressToPersonByApi(
                              TblToPerson $tblToPerson,
                              $Street,
                              $City,
                              $State,
                      Severity: Minor
                      Found in Application/Contact/Address/Service.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

                      Method updateAddressToCompanyByApi has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              TblToCompany $tblToCompany,
                              $Street,
                              $City,
                              $State,
                              $Type,
                      Severity: Major
                      Found in Application/Contact/Address/Service.php - About 50 mins to fix

                        Method updateAddressToPersonByApi has 7 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                TblToPerson $tblToPerson,
                                $Street,
                                $City,
                                $State,
                                $Type,
                        Severity: Major
                        Found in Application/Contact/Address/Service.php - About 50 mins to fix

                          Method createAddressToPersonByApi has 7 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  TblPerson $tblPerson,
                                  $Street = array(),
                                  $City = array(),
                                  $State,
                                  $Type,
                          Severity: Major
                          Found in Application/Contact/Address/Service.php - About 50 mins to fix

                            Method createAddressToCompanyByApi has 7 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    TblCompany $tblCompany,
                                    $Street = array(),
                                    $City = array(),
                                    $State,
                                    $Type,
                            Severity: Major
                            Found in Application/Contact/Address/Service.php - About 50 mins to fix

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

                                      TblPerson $tblPerson,
                                      $Street,
                                      $City,
                                      $Type,
                                      TblToPerson $tblToPerson = null
                              Severity: Minor
                              Found in Application/Contact/Address/Service.php - About 35 mins to fix

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

                                        TblCompany $tblCompany,
                                        $Street,
                                        $City,
                                        $Type,
                                        TblToCompany $tblToCompany = null
                                Severity: Minor
                                Found in Application/Contact/Address/Service.php - About 35 mins to fix

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

                                      public function createAddressToCompanyByApi(
                                          TblCompany $tblCompany,
                                          $Street = array(),
                                          $City = array(),
                                          $State,
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 1 day to fix
                                  Application/Contact/Address/Service.php on lines 311..360

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

                                  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 createAddressToPersonByApi(
                                          TblPerson $tblPerson,
                                          $Street = array(),
                                          $City = array(),
                                          $State,
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 1 day to fix
                                  Application/Contact/Address/Service.php on lines 424..473

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

                                  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 updateAddressToCompanyByApi(
                                          TblToCompany $tblToCompany,
                                          $Street,
                                          $City,
                                          $State,
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 7 hrs to fix
                                  Application/Contact/Address/Service.php on lines 373..411

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

                                  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 updateAddressToPersonByApi(
                                          TblToPerson $tblToPerson,
                                          $Street,
                                          $City,
                                          $State,
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 7 hrs to fix
                                  Application/Contact/Address/Service.php on lines 486..524

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

                                  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 (!$tblType) {
                                              $form->setError('Type[Type]', 'Bitte geben Sie einen Typ ein');
                                              $error = true;
                                          } else {
                                              // control there is no other MainAddress
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 4 hrs to fix
                                  Application/Contact/Address/Service.php on lines 274..295

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

                                  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 (!($tblType = $this->getTypeById($Type['Type']))) {
                                              $form->setError('Type[Type]', 'Bitte geben Sie einen Typ ein');
                                              $error = true;
                                          } else {
                                              // control there is no other MainAddress
                                  Severity: Major
                                  Found in Application/Contact/Address/Service.php and 1 other location - About 4 hrs to fix
                                  Application/Contact/Address/Service.php on lines 204..225

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

                                  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