DerDu/SPHERE-Framework

View on GitHub
Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php

Summary

Maintainability
F
2 wks
Test Coverage

File EzshStyle.php has 1235 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace SPHERE\Application\Api\Education\Certificate\Generator\Repository\EZSH;

use SPHERE\Application\Api\Education\Certificate\Generator\Certificate;

    Function getEZSHSubjectLanes has a Cognitive Complexity of 117 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getEZSHSubjectLanes(
            $personId,
            $isSlice = true,
            $languagesWithStartLevel = array(),
            $isTitle = true,

    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 getEZSHObligation has 399 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getEZSHObligation($personId, $TextSize = '14px', $isProfile = false)
        {
    
            $tblPerson = Person::useService()->getPersonById($personId);
    
    

      Function getEZSHObligation has a Cognitive Complexity of 71 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getEZSHObligation($personId, $TextSize = '14px', $isProfile = false)
          {
      
              $tblPerson = Person::useService()->getPersonById($personId);
      
      

      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 getEZSHSubjectLanes has 257 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getEZSHSubjectLanes(
              $personId,
              $isSlice = true,
              $languagesWithStartLevel = array(),
              $isTitle = true,

        Function getEZSHHeadGrade has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function getEZSHHeadGrade($personId)
            {
        
                $GradeSlice = (new Slice());
        
        

        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 getEZSHHeadGrade has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getEZSHHeadGrade($personId)
            {
        
                $GradeSlice = (new Slice());
        
        

          Method getEZSHDateSign has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getEZSHDateSign($personId)
              {
          
                  $SectionList = array();
                  $Section = new Section();

            Method getEZSHPerformanceGroup has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getEZSHPerformanceGroup($personId)
                {
            
                    $SectionList = array();
                    $Section = new Section();

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

                  public function getEZSHMissing($personId)
                  {
              
                      $SectionList = array();
                      $Section = new Section();

                Method getEZSHDivisionAndYear has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getEZSHDivisionAndYear($personId, $YearString = 'Schuljahr')
                    {
                
                        $Section = (new Section());
                        $Section

                  Method getEZSHCustody has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getEZSHCustody()
                      {
                  
                          $SectionList = array();
                          $SectionList[] = (new Section())->addElementColumn((new Element())

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

                        public function getEZSHArrangement($personId, $Height = '100px')
                        {
                            $SectionList = array();
                            $Section = new Section();
                            $Section->addElementColumn(((new Element())

                      Avoid deeply nested control flow statements.
                      Open

                                              if (($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('FOREIGN_LANGUAGE'))
                                                  && ($tblStudentSubjectList = Student::useService()->getStudentSubjectAllByStudentAndSubjectType($tblStudent,
                                                      $tblStudentSubjectType))
                                              ) {
                      
                      

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

                                $personId,
                                $isSlice = true,
                                $languagesWithStartLevel = array(),
                                $isTitle = true,
                                $showThirdForeignLanguage = false,

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

                              public function getEZSHTransfer($personId, $height = '60px')
                              {
                                  $SectionList = array();
                                  $Section = new Section();
                                  $Section->addElementColumn((new Element())
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 1208..1235

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

                          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 getEZSHRating($personId, $Height = '570px')
                              {
                                  $SectionList = array();
                                  $Section = new Section();
                                  $Section->addElementColumn(((new Element())
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 1338..1367

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

                          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

                                              $SubjectSection->addElementColumn((new Element())
                                                  ->setContent('{% if(Content.P' . $personId . '.Grade.Data["' . $Subject['SubjectAcronym'] . '"] is not empty) %}
                                                                       {{ Content.P' . $personId . '.Grade.Data["' . $Subject['SubjectAcronym'] . '"] }}
                                                                   {% else %}
                                                                       &ndash;
                          Application/Api/Education/Certificate/Generator/Repository/CMS/CmsStyle.php on lines 389..424

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

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

                                      foreach ($tblCertificateSubjectAll as $tblCertificateSubject) {
                                          $tblSubject = $tblCertificateSubject->getServiceTblSubject();
                                          if ($tblSubject) {
                                              // Grade Exists? => Add Subject to Certificate
                                              if (isset($tblGradeList['Data'][$tblSubject->getAcronym()])) {
                          Application/Api/Education/Certificate/Generator/Certificate.php on lines 552..571
                          Application/Api/Education/Certificate/Generator/Certificate.php on lines 950..970
                          Application/Api/Education/Certificate/Generator/Certificate.php on lines 2904..2923
                          Application/Api/Education/Certificate/Generator/Repository/CMS/CmsStyle.php on lines 314..333
                          Application/Api/Education/Certificate/Generator/Repository/ESRL/EsrlStyle.php on lines 241..260
                          Application/Api/Education/Certificate/Generator/Repository/ESS/EssStyle.php on lines 131..150

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

                          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($isProfile){
                                          $section
                                              ->addElementColumn((new Element())
                                                  ->setContent('Wahlpflichtbereich mit informatorischer Bildung ab Klasse 8:')
                                                  ->styleTextBold()
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 871..891

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

                                      if($isProfile){
                                          $section
                                              ->addElementColumn((new Element())
                                                  ->setContent('Schulspezifisches Profil ab Klasse 8:')
                                                  ->styleTextBold()
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 1059..1079

                          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

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

                                          if($isProfile) {
                                              $section
                                                  ->addElementColumn((new Element())
                                                      ->styleBorderTop('1px', '#BBB')
                                                      ->stylePaddingTop()
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 904..942

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

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

                                          if($isProfile) {
                                              $section
                                                  ->addElementColumn((new Element())
                                                      ->styleBorderTop('1px', '#BBB')
                                                      ->stylePaddingTop()
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 953..995

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

                          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

                                                      $elementForeignLanguageName
                                                          ->setContent('
                                                      {% if(Content.P' . $personId . '.Student.ForeignLanguage["' . $tblSubject->getAcronym() . '"] is not empty) %}
                                                           {{ Content.P' . $personId . '.Student.ForeignLanguage["' . $tblSubject->getAcronym() . '"].Name' . ' }}
                                                      {% else %}
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 674..686

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

                          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

                                                  $elementObligationName
                                                      ->setContent('
                                                      {% if(Content.P' . $personId . '.Student.ProfileEZSH["' . $tblSubject->getAcronym() . '"] is not empty) %}
                                                           {{ Content.P' . $personId . '.Student.ProfileEZSH["' . $tblSubject->getAcronym() . '"].Name' . ' }}
                                                      {% else %}
                          Application/Api/Education/Certificate/Generator/Repository/EZSH/EzshStyle.php on lines 815..827

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

                          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