DerDu/SPHERE-Framework

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

Summary

Maintainability
F
4 days
Test Coverage

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

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

use SPHERE\Application\Corporation\Company\Service\Entity\TblCompany;
use SPHERE\Application\People\Person\Service\Entity\TblPerson;
Severity: Minor
Found in Application/People/Relationship/Service/Data.php - About 6 hrs to fix

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

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

      Method setupDatabaseContent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setupDatabaseContent()
          {
      
              $tblGroupPerson = $this->createGroup('PERSON', 'Personenbeziehung', 'Person zu Person');
              $tblGroupCompany = $this->createGroup('COMPANY', 'Institutionenbeziehungen', 'Person zu Institution');
      Severity: Minor
      Found in Application/People/Relationship/Service/Data.php - About 1 hr to fix

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

                TblPerson $tblPersonFrom,
                TblPerson $tblPersonTo,
                TblType $tblType,
                $Remark,
                $Ranking = null,
        Severity: Minor
        Found in Application/People/Relationship/Service/Data.php - About 45 mins to fix

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

              public function createType($Name, $Description = '', TblGroup $tblGroup = null, $IsLocked = false, $IsBidirectional = null)
          Severity: Minor
          Found in Application/People/Relationship/Service/Data.php - About 35 mins to fix

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

                public function getPersonRelationshipFromByPerson(TblPerson $tblPerson, TblType $tblType = null, $isForced = false)
                {
                    $Parameter = array(
                        TblToPerson::SERVICE_TBL_PERSON_FROM => $tblPerson->getId()
                    );
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 1 other location - About 3 hrs to fix
            Application/People/Relationship/Service/Data.php on lines 449..467

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

            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 getPersonRelationshipToByPerson(TblPerson $tblPerson, TblType $tblType = null, $isForced = false)
                {
                    $Parameter = array(
                        TblToPerson::SERVICE_TBL_PERSON_TO => $tblPerson->getId()
                    );
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 1 other location - About 3 hrs to fix
            Application/People/Relationship/Service/Data.php on lines 422..440

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

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

                public function updateType(TblType $tblType, $IsBidirectional = null)
                {
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblType $Entity */
                    $Entity = $Manager->getEntityById('TblType', $tblType->getId());
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 5 other locations - About 2 hrs to fix
            Application/Billing/Bookkeeping/Invoice/Service/Data.php on lines 494..511
            Application/Education/Certificate/Generate/Service/Data.php on lines 167..187
            Application/Transfer/Indiware/Import/Service/Data.php on lines 495..513
            Application/Transfer/Indiware/Import/Service/Data.php on lines 541..559
            Application/Transfer/Untis/Import/Service/Data.php on lines 145..161

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

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

                public function removePersonRelationshipToPerson(TblToPerson $tblToPerson, $IsSoftRemove = false)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblToPerson $Entity */
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 12 other locations - About 2 hrs to fix
            Application/Billing/Inventory/Document/Service/Data.php on lines 192..209
            Application/Contact/Address/Service/Data.php on lines 732..748
            Application/Contact/Mail/Service/Data.php on lines 232..248
            Application/Contact/Phone/Service/Data.php on lines 234..250
            Application/Contact/Web/Service/Data.php on lines 200..216
            Application/Education/ClassRegister/Absence/Service/Data.php on lines 195..216
            Application/People/Meta/Club/Service/Data.php on lines 126..142
            Application/People/Meta/Common/Service/Data.php on lines 330..346
            Application/People/Meta/Custody/Service/Data.php on lines 128..144
            Application/People/Meta/Prospect/Service/Data.php on lines 282..298
            Application/People/Meta/Teacher/Service/Data.php on lines 176..192
            Application/People/Relationship/Service/Data.php on lines 568..584

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

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

                public function removeCompanyRelationshipToPerson(TblToCompany $tblToCompany, $IsSoftRemove = false)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblToCompany $Entity */
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 12 other locations - About 2 hrs to fix
            Application/Billing/Inventory/Document/Service/Data.php on lines 192..209
            Application/Contact/Address/Service/Data.php on lines 732..748
            Application/Contact/Mail/Service/Data.php on lines 232..248
            Application/Contact/Phone/Service/Data.php on lines 234..250
            Application/Contact/Web/Service/Data.php on lines 200..216
            Application/Education/ClassRegister/Absence/Service/Data.php on lines 195..216
            Application/People/Meta/Club/Service/Data.php on lines 126..142
            Application/People/Meta/Common/Service/Data.php on lines 330..346
            Application/People/Meta/Custody/Service/Data.php on lines 128..144
            Application/People/Meta/Prospect/Service/Data.php on lines 282..298
            Application/People/Meta/Teacher/Service/Data.php on lines 176..192
            Application/People/Relationship/Service/Data.php on lines 544..560

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

            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 restoreToCompany(TblToCompany $tblToCompany)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblToCompany $Entity */
            Severity: Major
            Found in Application/People/Relationship/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/Person/Service/Data.php on lines 205..220
            Application/People/Relationship/Service/Data.php on lines 648..662

            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

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

                public function restoreToPerson(TblToPerson $tblToPerson)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    /** @var TblToPerson $Entity */
            Severity: Major
            Found in Application/People/Relationship/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/Person/Service/Data.php on lines 205..220
            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

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

                public function createSiblingRank($Name)
                {
            
                    $Manager = $this->getConnection()->getEntityManager();
                    $Entity = $Manager->getEntity('TblSiblingRank')->findOneBy(array(
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 7 other locations - About 1 hr to fix
            Application/Billing/Bookkeeping/Balance/Service/Data.php on lines 36..50
            Application/Billing/Inventory/Item/Service/Data.php on lines 444..462
            Application/Contact/Mail/Service/Data.php on lines 143..158
            Application/Contact/Phone/Service/Data.php on lines 139..153
            Application/Contact/Web/Service/Data.php on lines 119..134
            Application/People/Meta/Common/Service/Data.php on lines 65..77
            Application/Reporting/SerialLetter/Service/Data.php on lines 49..68

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

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

                public function getCompanyRelationshipAllByPerson(TblPerson $tblPerson, $isForced = false)
                {
            
                    if ($isForced) {
                        return $this->getForceEntityListBy(__METHOD__, $this->getConnection()->getEntityManager(), 'TblToCompany',
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 9 other locations - About 1 hr to fix
            Application/Contact/Mail/Service/Data.php on lines 166..180
            Application/People/Group/Service/Data.php on lines 229..242
            Application/People/Group/Service/Data.php on lines 340..357
            Application/People/Meta/Club/Service/Data.php on lines 40..52
            Application/People/Meta/Common/Service/Data.php on lines 45..58
            Application/People/Meta/Custody/Service/Data.php on lines 98..109
            Application/People/Meta/Prospect/Service/Data.php on lines 45..59
            Application/People/Meta/Student/Service/Data/Student.php on lines 354..366
            Application/People/Meta/Teacher/Service/Data.php on lines 67..79

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

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

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

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

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

            Refactorings

            Further Reading

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

                    if (null === $Entity) {
                        $Entity = new TblType();
                        $Entity->setName($Name);
                        $Entity->setDescription($Description);
                        $Entity->setLocked($IsLocked);
            Severity: Major
            Found in Application/People/Relationship/Service/Data.php and 3 other locations - About 55 mins to fix
            Application/Education/Certificate/Generator/Service/Data.php on lines 3879..3888
            Application/Education/Certificate/Generator/Service/Data.php on lines 4812..4822
            Application/Education/Certificate/Prepare/Service/Data.php on lines 1503..1513

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

            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