DerDu/SPHERE-Framework

View on GitHub
Application/People/Meta/Student/Frontend.php

Summary

Maintainability
F
6 days
Test Coverage

File Frontend.php has 528 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SPHERE\Application\People\Meta\Student;

use SPHERE\Application\Api\People\Meta\Support\ApiSupport;
Severity: Major
Found in Application/People/Meta/Student/Frontend.php - About 1 day to fix

    Method formHandyCap has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function formHandyCap($PersonId, $HandyCapId = null, $IsCanceled = false, $IsInit = false)
        {
    
            $Global = $this->getGlobal();
            if($HandyCapId != null && !isset($Global->POST['Data']['Date'])){
    Severity: Major
    Found in Application/People/Meta/Student/Frontend.php - About 3 hrs to fix

      Method formSupport has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function formSupport($PersonId, $SupportId = null)
          {
      
              $Global = $this->getGlobal();
              if($SupportId != null && !isset($Global->POST['Data']['Date'])){
      Severity: Major
      Found in Application/People/Meta/Student/Frontend.php - About 2 hrs to fix

        Method getSupportTable has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getSupportTable(TblPerson $tblPerson, $hasEdit = true)
            {
        
                $tblSupportList = Student::useService()->getSupportByPerson($tblPerson);
                $TableContent = array();
        Severity: Major
        Found in Application/People/Meta/Student/Frontend.php - About 2 hrs to fix

          Function formSpecial has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
          Open

              public function formSpecial($PersonId, $SpecialId = null, $IsCanceled = false, $IsInit = false)
              {
          
                  $Global = $this->getGlobal();
                  if($SpecialId != null && !isset($Global->POST['Data']['Date'])) {
          Severity: Minor
          Found in Application/People/Meta/Student/Frontend.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 formSpecial has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function formSpecial($PersonId, $SpecialId = null, $IsCanceled = false, $IsInit = false)
              {
          
                  $Global = $this->getGlobal();
                  if($SpecialId != null && !isset($Global->POST['Data']['Date'])) {
          Severity: Major
          Found in Application/People/Meta/Student/Frontend.php - About 2 hrs to fix

            Method getSpecialTable has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getSpecialTable(TblPerson $tblPerson, $hasEdit = true)
                {
            
                    $tblSpecialList = Student::useService()->getSpecialByPerson($tblPerson);
                    $TableContent = array();
            Severity: Major
            Found in Application/People/Meta/Student/Frontend.php - About 2 hrs to fix

              Function formHandyCap has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function formHandyCap($PersonId, $HandyCapId = null, $IsCanceled = false, $IsInit = false)
                  {
              
                      $Global = $this->getGlobal();
                      if($HandyCapId != null && !isset($Global->POST['Data']['Date'])){
              Severity: Minor
              Found in Application/People/Meta/Student/Frontend.php - About 1 hr 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 getHandyCapTable has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getHandyCapTable(TblPerson $tblPerson, $hasEdit = true)
                  {
              
                      $tblSpecialList = Student::useService()->getHandyCapByPerson($tblPerson);
                      $TableContent = array();
              Severity: Minor
              Found in Application/People/Meta/Student/Frontend.php - About 1 hr to fix

                Method frontendIntegration has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function frontendIntegration(TblPerson $tblPerson = null)
                    {
                
                        $Stage = new Stage();
                
                
                Severity: Minor
                Found in Application/People/Meta/Student/Frontend.php - About 1 hr to fix

                  Function formSupport has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function formSupport($PersonId, $SupportId = null)
                      {
                  
                          $Global = $this->getGlobal();
                          if($SupportId != null && !isset($Global->POST['Data']['Date'])){
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php - About 1 hr 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 fillGlobalSupport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function fillGlobalSupport(TblSupport $tblSupport, SuperGlobal $Global, $IsEdit = true)
                      {
                          // fill only update Form's
                          if($IsEdit){
                              $Global->POST['Data']['Date'] = $tblSupport->getDate();
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php - About 35 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

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

                              ApiSupport::pipelineLoadTable($tblPerson->getId())
                              .new Layout(array(
                                  new LayoutGroup(
                                      new LayoutRow(
                                          new LayoutColumn(
                  Severity: Major
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 6 hrs to fix
                  Application/People/Person/Frontend/FrontendStudentIntegration.php on lines 122..153

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

                  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($SpecialId === null){
                              // create
                              $SaveButton = (new PrimaryLink('Speichern', ApiSupport::getEndpoint(), new Save()))
                                  ->ajaxPipelineOnClick(ApiSupport::pipelineCreateSpecialSave($PersonId));
                              $cancelCheckbox = (new CheckBox('Data[IsCanceled]', new Bold('Aufhebung'), '1'))->ajaxPipelineOnClick(ApiSupport::pipelineOpenCreateSpecialModal($PersonId));
                  Severity: Major
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 5 hrs to fix
                  Application/People/Meta/Student/Frontend.php on lines 367..379

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

                  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($HandyCapId === null){
                              // create
                              $SaveButton = (new PrimaryLink('Speichern', ApiSupport::getEndpoint(), new Save()))
                                  ->ajaxPipelineOnClick(ApiSupport::pipelineCreateHandyCapSave($PersonId));
                  
                  
                  Severity: Major
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 5 hrs to fix
                  Application/People/Meta/Student/Frontend.php on lines 274..284

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

                  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 ($hasEdit) {
                                      $Item['Option'] = (new Standard('', '#', new Edit()))
                                              ->ajaxPipelineOnClick(ApiSupport::pipelineOpenEditHandyCapModal($tblPerson->getId(),
                                                  $tblHandyCap->getId(), true))
                                          . (new Standard('', '#', new Remove()))
                  Severity: Major
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 1 hr to fix
                  Application/People/Meta/Student/Frontend.php on lines 551..558

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

                  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 ($hasEdit) {
                                      $Item['Option'] = (new Standard('', '#', new Edit()))
                                              ->ajaxPipelineOnClick(ApiSupport::pipelineOpenEditSpecialModal($tblPerson->getId(),
                                                  $tblSpecial->getId(), true))
                                          . (new Standard('', '#', new Remove()))
                  Severity: Major
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 1 hr to fix
                  Application/People/Meta/Student/Frontend.php on lines 623..630

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

                  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 (($tblSpecial = Student::useService()->getSpecialById($SpecialId))) {
                                  if ($IsInit) {
                                      if ($tblSpecial->isCanceled()) {
                                         $Global->POST['Data']['IsCanceled'] = $tblSpecial->isCanceled() ? '1' : '0';
                                      }
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 30 mins to fix
                  Application/People/Meta/Student/Frontend.php on lines 127..139

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

                  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($SupportId != null && !isset($Global->POST['Data']['Date'])){
                              if(($tblSupport = Student::useService()->getSupportById($SupportId))){
                                  $Global = $this->fillGlobalSupport($tblSupport, $Global);
                                  $Global->savePost();
                              }
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php and 1 other location - About 30 mins to fix
                  Application/People/Meta/Student/Frontend.php on lines 246..263

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

                  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

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

                          return new TableData($TableContent, null, $columns,
                              array(
                                  'order' => array(
                                      array(0, 'desc'),
                                  ),
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php and 2 other locations - About 30 mins to fix
                  Application/People/Meta/Student/Frontend.php on lines 518..531
                  Application/People/Meta/Student/Frontend.php on lines 588..601

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

                  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

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

                          return new TableData($TableContent, null, $columns,
                              array(
                                  'order' => array(
                                      array(0, 'desc'),
                                  ),
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php and 2 other locations - About 30 mins to fix
                  Application/People/Meta/Student/Frontend.php on lines 518..531
                  Application/People/Meta/Student/Frontend.php on lines 651..664

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

                  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

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

                          return new TableData($TableContent, null, $columns,
                              array(
                                  'order' => array(
                                      array(0, 'desc'),
                                  ),
                  Severity: Minor
                  Found in Application/People/Meta/Student/Frontend.php and 2 other locations - About 30 mins to fix
                  Application/People/Meta/Student/Frontend.php on lines 588..601
                  Application/People/Meta/Student/Frontend.php on lines 651..664

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

                  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