DerDu/SPHERE-Framework

View on GitHub
Application/People/Person/Service/Data.php

Summary

Maintainability
D
1 day
Test Coverage

File Data.php has 281 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace SPHERE\Application\People\Person\Service;

use SPHERE\Application\Contact\Address\Address;
use SPHERE\Application\Contact\Mail\Mail;
Severity: Minor
Found in Application/People/Person/Service/Data.php - About 2 hrs to fix

    Data has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Data extends AbstractData
    {
    
        /**
         * @return false|ViewPerson[]
    Severity: Minor
    Found in Application/People/Person/Service/Data.php - About 2 hrs to fix

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

          public function softRemovePersonReferences(TblPerson $tblPerson)
          {
      
              $IsSoftRemove = true;
      
      
      Severity: Minor
      Found in Application/People/Person/Service/Data.php - About 1 hr to fix

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

                TblPerson $tblPerson,
                $Salutation,
                $Title,
                $FirstName,
                $SecondName,
        Severity: Major
        Found in Application/People/Person/Service/Data.php - About 1 hr to fix

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

              public function createPerson($Salutation, $Title, $FirstName, $SecondName, $CallName, $LastName, $BirthName = '', $ImportId = '')
          Severity: Major
          Found in Application/People/Person/Service/Data.php - About 1 hr to fix

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

                public function updatePersonAnonymousBulk(
                    $ProcessList = array()
                ) {
            
                    $Manager = $this->getConnection()->getEntityManager();
            Severity: Minor
            Found in Application/People/Person/Service/Data.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

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

                public function getPersonAllBySoftRemove()
                {
                    // direkt über DB ermitteln
            //        return $this->getForceEntityListBy(__METHOD__, $this->getEntityManager(false), 'TblPerson', array(Element::ENTITY_REMOVE => !null));
                    $resultList = array();
            Severity: Minor
            Found in Application/People/Person/Service/Data.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

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

                public function softRemovePersonReferences(TblPerson $tblPerson)
                {
            
                    $IsSoftRemove = true;
            
            
            Severity: Minor
            Found in Application/People/Person/Service/Data.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

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

                public function updateSalutation(TblPerson $tblPerson, TblSalutation $tblSalutation)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblPerson $Entity */
            Severity: Major
            Found in Application/People/Person/Service/Data.php and 2 other locations - About 2 hrs to fix
            Application/Education/Certificate/Generator/Service/Data.php on lines 3840..3854
            Application/Education/Certificate/Prepare/Service/Data.php on lines 1555..1575

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

            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 15 locations. Consider refactoring.
            Open

                public function restorePerson(
                    TblPerson $tblPerson
                ) {
            
                    $Manager = $this->getConnection()->getEntityManager();
            Severity: Major
            Found in Application/People/Person/Service/Data.php and 14 other locations - About 2 hrs to fix
            Application/Contact/Address/Service/Data.php on lines 863..877
            Application/Contact/Mail/Service/Data.php on lines 304..318
            Application/Contact/Phone/Service/Data.php on lines 336..350
            Application/Education/ClassRegister/Absence/Service/Data.php on lines 223..237
            Application/Education/Lesson/Division/Service/Data.php on lines 2521..2535
            Application/People/Group/Service/Data.php on lines 541..555
            Application/People/Meta/Club/Service/Data.php on lines 149..163
            Application/People/Meta/Common/Service/Data.php on lines 366..380
            Application/People/Meta/Custody/Service/Data.php on lines 151..165
            Application/People/Meta/Prospect/Service/Data.php on lines 305..319
            Application/People/Meta/Student/Service/Data/Student.php on lines 470..484
            Application/People/Meta/Teacher/Service/Data.php on lines 199..213
            Application/People/Relationship/Service/Data.php on lines 648..662
            Application/People/Relationship/Service/Data.php on lines 669..683

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

            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