DerDu/SPHERE-Framework

View on GitHub
Application/People/Meta/Student/Service/Setup.php

Summary

Maintainability
F
4 days
Test Coverage

File Setup.php has 546 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace SPHERE\Application\People\Meta\Student\Service;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;
Severity: Major
Found in Application/People/Meta/Student/Service/Setup.php - About 1 day to fix

    Setup has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Setup extends AbstractSetup
    {
    
        /**
         * @param bool $Simulate
    Severity: Minor
    Found in Application/People/Meta/Student/Service/Setup.php - About 4 hrs to fix

      Method setupDatabaseSchema has 99 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setupDatabaseSchema($Simulate = true, $UTF8 = false)
          {
      
              /**
               * Table
      Severity: Major
      Found in Application/People/Meta/Student/Service/Setup.php - About 3 hrs to fix

        Method setTableStudentIntegration has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function setTableStudentIntegration(
                Schema &$Schema
            ) {
        
                $Table = $this->getConnection()->createTable($Schema, 'tblStudentIntegration');
        Severity: Minor
        Found in Application/People/Meta/Student/Service/Setup.php - About 1 hr to fix

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

              private function setTableStudent(
                  Schema &$Schema,
                  Table $tblStudentMedicalRecord,
                  Table $tblStudentTransport,
                  Table $tblStudentBilling,
          Severity: Minor
          Found in Application/People/Meta/Student/Service/Setup.php - About 1 hr to fix

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

                private function setTableStudentIntegration(
                    Schema &$Schema
                ) {
            
                    $Table = $this->getConnection()->createTable($Schema, 'tblStudentIntegration');
            Severity: Minor
            Found in Application/People/Meta/Student/Service/Setup.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 setTableStudent has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    Schema &$Schema,
                    Table $tblStudentMedicalRecord,
                    Table $tblStudentTransport,
                    Table $tblStudentBilling,
                    Table $tblStudentLocker,
            Severity: Major
            Found in Application/People/Meta/Student/Service/Setup.php - About 50 mins to fix

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

                  private function setTableStudentMedicalRecord(Schema &$Schema)
                  {
              
                      $Table = $this->getConnection()->createTable($Schema, 'tblStudentMedicalRecord');
                      if (!$this->getConnection()->hasColumn('tblStudentMedicalRecord', 'Disease')) {
              Severity: Minor
              Found in Application/People/Meta/Student/Service/Setup.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 5 locations. Consider refactoring.
              Open

                  private function setTableStudentTransport(Schema &$Schema)
                  {
              
                      $Table = $this->getConnection()->createTable($Schema, 'tblStudentTransport');
                      if (!$this->getConnection()->hasColumn('tblStudentTransport', 'Route')) {
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 4 other locations - About 3 hrs to fix
              Application/Document/Storage/Service/Setup.php on lines 52..69
              Application/Education/Lesson/Subject/Service/Setup.php on lines 56..73
              Application/Education/Lesson/Subject/Service/Setup.php on lines 80..97
              Application/People/Meta/Common/Service/Setup.php on lines 135..152

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

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

                  private function setTableStudentLocker(Schema &$Schema)
                  {
              
                      $Table = $this->getConnection()->createTable($Schema, 'tblStudentLocker');
                      if (!$this->getConnection()->hasColumn('tblStudentLocker', 'LockerNumber')) {
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 6 other locations - About 2 hrs to fix
              Application/Corporation/Company/Service/Setup.php on lines 54..68
              Application/Document/Storage/Service/Setup.php on lines 195..209
              Application/Education/Graduation/Gradebook/Service/Setup.php on lines 271..286
              Application/Education/Lesson/Term/Service/Setup.php on lines 64..78
              Application/People/Relationship/Service/Setup.php on lines 74..88
              Application/Setting/Consumer/School/Service/Setup.php on lines 48..63

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

                  private function setTableSpecial(Schema &$Schema)
                  {
              
                      $table = $this->createTable($Schema, 'tblSpecial');
                      $this->createColumn($table, 'serviceTblPerson', self::FIELD_TYPE_BIGINT);
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 1 other location - About 1 hr to fix
              Application/Billing/Accounting/Debtor/Service/Setup.php on lines 68..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 120.

              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

                  private function setTableStudentLiberationType(Schema &$Schema, Table $tblStudentLiberationCategory)
                  {
              
                      $Table = $this->getConnection()->createTable($Schema, 'tblStudentLiberationType');
                      if (!$this->getConnection()->hasColumn('tblStudentLiberationType', 'Name')) {
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 2 other locations - About 1 hr to fix
              Application/People/Meta/Student/Service/Setup.php on lines 456..468
              Application/Platform/Gatekeeper/Authorization/Account/Service/Setup.php on lines 239..251

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

              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

                  private function setTableStudentAgreementType(Schema &$Schema, Table $tblStudentAgreementCategory)
                  {
              
                      $Table = $this->getConnection()->createTable($Schema, 'tblStudentAgreementType');
                      if (!$this->getConnection()->hasColumn('tblStudentAgreementType', 'Name')) {
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 2 other locations - About 1 hr to fix
              Application/People/Meta/Student/Service/Setup.php on lines 513..525
              Application/Platform/Gatekeeper/Authorization/Account/Service/Setup.php on lines 239..251

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

              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

                      $this->getConnection()->createView(
                          ( new View($this->getConnection(), 'viewStudentAgreement') )
                              ->addLink(new TblStudentAgreement(), 'tblStudent', new TblStudent(), 'Id', View::JOIN)
                              ->addLink(new TblStudentAgreement(), 'tblStudentAgreementType', new TblStudentAgreementType(), 'Id', View::JOIN)
                              ->addLink(new TblStudentAgreementType(), 'tblStudentAgreementCategory', new TblStudentAgreementCategory(), 'Id', View::JOIN)
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 3 other locations - About 1 hr to fix
              Application/People/Meta/Common/Service/Setup.php on lines 50..55
              Application/People/Meta/Student/Service/Setup.php on lines 140..145
              Application/People/Meta/Student/Service/Setup.php on lines 154..159

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

              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

                      $this->getConnection()->createView(
                          ( new View($this->getConnection(), 'viewStudentLiberation') )
                              ->addLink(new TblStudentLiberation(), 'tblStudent', new TblStudent(), 'Id', View::JOIN)
                              ->addLink(new TblStudentLiberation(), 'tblStudentLiberationType', new TblStudentLiberationType(), 'Id', View::JOIN)
                              ->addLink(new TblStudentLiberationType(), 'tblStudentLiberationCategory', new TblStudentLiberationCategory(), 'Id', View::JOIN)
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 3 other locations - About 1 hr to fix
              Application/People/Meta/Common/Service/Setup.php on lines 50..55
              Application/People/Meta/Student/Service/Setup.php on lines 111..116
              Application/People/Meta/Student/Service/Setup.php on lines 154..159

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

              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

                      $this->getConnection()->createView(
                          ( new View($this->getConnection(), 'viewStudentSubject') )
                              ->addLink(new TblStudentSubject(), 'tblStudent', new TblStudent(), 'Id', View::JOIN)
                              ->addLink(new TblStudentSubject(), 'tblStudentSubjectRanking', new TblStudentSubjectRanking(), 'Id', View::JOIN)
                              ->addLink(new TblStudentSubject(), 'tblStudentSubjectType', new TblStudentSubjectType(), 'Id', View::JOIN)
              Severity: Major
              Found in Application/People/Meta/Student/Service/Setup.php and 3 other locations - About 1 hr to fix
              Application/People/Meta/Common/Service/Setup.php on lines 50..55
              Application/People/Meta/Student/Service/Setup.php on lines 111..116
              Application/People/Meta/Student/Service/Setup.php on lines 140..145

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

              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