DerDu/SPHERE-Framework

View on GitHub
Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php

Summary

Maintainability
F
4 days
Test Coverage

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

<?php
namespace SPHERE\Application\Platform\Gatekeeper\Authorization\Access\Service;

use SPHERE\Application\Platform\Gatekeeper\Authorization\Access\Service\Entity\TblLevel;
use SPHERE\Application\Platform\Gatekeeper\Authorization\Access\Service\Entity\TblLevelPrivilege;
Severity: Minor
Found in Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php - About 5 hrs to fix

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

        public function setupDatabaseContent()
        {
    
            /**
             * CLOUD
    Severity: Major
    Found in Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php - About 5 hrs to fix

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

      class Data extends AbstractData
      {
      
          public function setupDatabaseContent()
          {
      Severity: Minor
      Found in Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php - About 3 hrs to fix

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

            public function addRoleLevel(TblRole $tblRole, TblLevel $tblLevel)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblRoleLevel')
        Application/Billing/Bookkeeping/Basket/Service/Data.php on lines 459..480
        Application/Billing/Inventory/Document/Service/Data.php on lines 166..184
        Application/Billing/Inventory/Item/Service/Data.php on lines 569..593
        Application/Corporation/Group/Service/Data.php on lines 286..303
        Application/Education/Certificate/Generator/Service/Data.php on lines 4382..4404
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 496..519
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 595..618
        Application/Education/Lesson/Division/Service/Data.php on lines 1095..1112
        Application/Education/Lesson/Division/Service/Data.php on lines 1120..1138
        Application/Education/Lesson/Subject/Service/Data.php on lines 221..238
        Application/Education/Lesson/Subject/Service/Data.php on lines 272..289
        Application/Education/Lesson/Term/Service/Data.php on lines 234..251
        Application/People/Group/Service/Data.php on lines 365..382
        Application/People/Meta/Student/Service/Data/Agreement.php on lines 182..205
        Application/People/Meta/Student/Service/Data/Integration.php on lines 321..344
        Application/People/Meta/Student/Service/Data/Liberation.php on lines 165..188
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 328..345
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 371..388
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 294..311
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 319..336
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1132..1149
        Application/Reporting/SerialLetter/Service/Data.php on lines 472..493

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

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

            public function addLevelPrivilege(TblLevel $tblLevel, TblPrivilege $tblPrivilege)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblLevelPrivilege')
        Application/Billing/Bookkeeping/Basket/Service/Data.php on lines 459..480
        Application/Billing/Inventory/Document/Service/Data.php on lines 166..184
        Application/Billing/Inventory/Item/Service/Data.php on lines 569..593
        Application/Corporation/Group/Service/Data.php on lines 286..303
        Application/Education/Certificate/Generator/Service/Data.php on lines 4382..4404
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 496..519
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 595..618
        Application/Education/Lesson/Division/Service/Data.php on lines 1095..1112
        Application/Education/Lesson/Division/Service/Data.php on lines 1120..1138
        Application/Education/Lesson/Subject/Service/Data.php on lines 221..238
        Application/Education/Lesson/Subject/Service/Data.php on lines 272..289
        Application/Education/Lesson/Term/Service/Data.php on lines 234..251
        Application/People/Group/Service/Data.php on lines 365..382
        Application/People/Meta/Student/Service/Data/Agreement.php on lines 182..205
        Application/People/Meta/Student/Service/Data/Integration.php on lines 321..344
        Application/People/Meta/Student/Service/Data/Liberation.php on lines 165..188
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 285..302
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 371..388
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 294..311
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 319..336
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1132..1149
        Application/Reporting/SerialLetter/Service/Data.php on lines 472..493

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

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

            public function addPrivilegeRight(TblPrivilege $tblPrivilege, TblRight $tblRight)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblPrivilegeRight')
        Application/Billing/Bookkeeping/Basket/Service/Data.php on lines 459..480
        Application/Billing/Inventory/Document/Service/Data.php on lines 166..184
        Application/Billing/Inventory/Item/Service/Data.php on lines 569..593
        Application/Corporation/Group/Service/Data.php on lines 286..303
        Application/Education/Certificate/Generator/Service/Data.php on lines 4382..4404
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 496..519
        Application/Education/Graduation/Gradebook/ScoreRule/Data.php on lines 595..618
        Application/Education/Lesson/Division/Service/Data.php on lines 1095..1112
        Application/Education/Lesson/Division/Service/Data.php on lines 1120..1138
        Application/Education/Lesson/Subject/Service/Data.php on lines 221..238
        Application/Education/Lesson/Subject/Service/Data.php on lines 272..289
        Application/Education/Lesson/Term/Service/Data.php on lines 234..251
        Application/People/Group/Service/Data.php on lines 365..382
        Application/People/Meta/Student/Service/Data/Agreement.php on lines 182..205
        Application/People/Meta/Student/Service/Data/Integration.php on lines 321..344
        Application/People/Meta/Student/Service/Data/Liberation.php on lines 165..188
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 285..302
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 328..345
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 294..311
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 319..336
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1132..1149
        Application/Reporting/SerialLetter/Service/Data.php on lines 472..493

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

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

            public function removeRoleLevel(TblRole $tblRole, TblLevel $tblLevel)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                /** @var TblRoleLevel $Entity */
        Application/Corporation/Group/Service/Data.php on lines 311..327
        Application/Education/Lesson/Subject/Service/Data.php on lines 460..476
        Application/Education/Lesson/Subject/Service/Data.php on lines 484..500
        Application/Education/Lesson/Term/Service/Data.php on lines 259..275
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 420..436
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 444..460
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 416..432
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 440..456
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1157..1173
        Application/Reporting/SerialLetter/Service/Data.php on lines 928..946

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

            public function removeLevelPrivilege(TblLevel $tblLevel, TblPrivilege $tblPrivilege)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                /** @var TblLevelPrivilege $Entity */
        Application/Corporation/Group/Service/Data.php on lines 311..327
        Application/Education/Lesson/Subject/Service/Data.php on lines 460..476
        Application/Education/Lesson/Subject/Service/Data.php on lines 484..500
        Application/Education/Lesson/Term/Service/Data.php on lines 259..275
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 396..412
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 420..436
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 416..432
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 440..456
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1157..1173
        Application/Reporting/SerialLetter/Service/Data.php on lines 928..946

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

            public function removePrivilegeRight(TblPrivilege $tblPrivilege, TblRight $tblRight)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                /** @var TblPrivilegeRight $Entity */
        Application/Corporation/Group/Service/Data.php on lines 311..327
        Application/Education/Lesson/Subject/Service/Data.php on lines 460..476
        Application/Education/Lesson/Subject/Service/Data.php on lines 484..500
        Application/Education/Lesson/Term/Service/Data.php on lines 259..275
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 396..412
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 444..460
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 416..432
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 440..456
        Application/Platform/Gatekeeper/Authorization/Account/Service/Data.php on lines 1157..1173
        Application/Reporting/SerialLetter/Service/Data.php on lines 928..946

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

            public function createLevel($Name)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblLevel')->findOneBy(array(TblLevel::ATTR_NAME => $Name));
        Application/Contact/Address/Service/Data.php on lines 108..121
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 309..320
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 352..363

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

        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

            public function createPrivilege($Name)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblPrivilege')->findOneBy(array(TblPrivilege::ATTR_NAME => $Name));
        Application/Contact/Address/Service/Data.php on lines 108..121
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 266..277
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 352..363

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

        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

            public function createRight($Route)
            {
        
                $Manager = $this->getConnection()->getEntityManager();
                $Entity = $Manager->getEntity('TblRight')->findOneBy(array(TblRight::ATTR_ROUTE => $Route));
        Application/Contact/Address/Service/Data.php on lines 108..121
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 266..277
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 309..320

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

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

            public function getPrivilegeAllByLevel(TblLevel $tblLevel)
            {
                /** @var TblLevelPrivilege[] $EntityList */
                $EntityList = $this->getCachedEntityListBy( __METHOD__,$this->getConnection()->getEntityManager(), 'TblLevelPrivilege',array(
                    TblLevelPrivilege::ATTR_TBL_LEVEL => $tblLevel->getId()
        Application/Education/Lesson/Subject/Service/Data.php on lines 575..592
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 597..612

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

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

            public function getRightAllByPrivilege(TblPrivilege $tblPrivilege)
            {
        
                /** @var TblPrivilegeRight[] $EntityList */
                $EntityList = $this->getCachedEntityListBy( __METHOD__,$this->getConnection()->getEntityManager(), 'TblPrivilegeRight',array(
        Application/Education/Lesson/Subject/Service/Data.php on lines 575..592
        Application/Platform/Gatekeeper/Authorization/Access/Service/Data.php on lines 576..589

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

        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