DerDu/SPHERE-Framework

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

Summary

Maintainability
F
1 wk
Test Coverage

Method buildPages has 538 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function buildPages(TblPerson $tblPerson = null)
    {

        $personId = $tblPerson ? $tblPerson->getId() : 0;

    File GymAbgSekII.php has 942 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Created by PhpStorm.
     * User: Kauschke
     * Date: 18.05.2018

      Method setSubjectRow has 176 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function setSubjectRow($personId, $subjectName = '&nbsp;', $isForeignLanguage = false, $isLastRow = false)
          {
      
              $textSize = '13px';
              $colorPoints = '#BBB';

        Function setCourses has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
        Open

            private function setCourses(TblPerson $tblPerson = null)
            {
        
                $advancedCourses = array();
                if ($tblPerson && ($tblDivision = $this->getTblDivision())

        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 setSubjectRow has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
        Open

            private function setSubjectRow($personId, $subjectName = '&nbsp;', $isForeignLanguage = false, $isLastRow = false)
            {
        
                $textSize = '13px';
                $colorPoints = '#BBB';

        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 getSchoolName has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function getSchoolName($personId, $MarginTop = '20px')
            {
        
                if (($tblSetting = Consumer::useService()->getSetting(
                        'Education', 'Certificate', 'Prepare', 'IsSchoolExtendedNameDisplayed'))

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

            protected function getSchoolName($personId, $MarginTop = '20px')
            {
        
                if (($tblSetting = Consumer::useService()->getSetting(
                        'Education', 'Certificate', 'Prepare', 'IsSchoolExtendedNameDisplayed'))

          Method setPointsOverview has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function setPointsOverview($MarginTop = '25px')
              {
          
                  $textSize = '10px';
                  $slice = new Slice();

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

                private function setCourses(TblPerson $tblPerson = null)
                {
            
                    $advancedCourses = array();
                    if ($tblPerson && ($tblDivision = $this->getTblDivision())

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

                  public function buildPages(TblPerson $tblPerson = null)
                  {
              
                      $personId = $tblPerson ? $tblPerson->getId() : 0;
              
              

              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

              Avoid deeply nested control flow statements.
              Open

                                              if ($tblSubjectGroup->isAdvancedCourse()) {
                                                  if ($tblSubject->getName() == 'Deutsch' || $tblSubject->getName() == 'Mathematik') {
                                                      $advancedCourses[0] = $tblSubject->getName();
                                                  } else {
                                                      $advancedCourses[1] = $tblSubject->getName();

                Avoid deeply nested control flow statements.
                Open

                                        if (($tblCompany = $tblStudentTransfer->getServiceTblCompany())) {
                                            $name = $isSchoolExtendedNameDisplayed ? $tblCompany->getName() .
                                                ($separator ? ' ' . $separator . ' ' : ' ') . $tblCompany->getExtendedName() : $tblCompany->getName();
                
                                            if (($mainAddress = $tblCompany->fetchMainAddress())) {

                  Consider simplifying this complex logical expression.
                  Open

                              if ($tblPerson
                                  && ($tblStudent = $tblPerson->getStudent())
                                  && ($tblStudentSubjectType = Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'))
                                  && ($tblStudentSubjectRanking = Student::useService()->getStudentSubjectRankingByIdentifier('1'))
                                  && ($tblStudentSubject = Student::useService()->getStudentSubjectByStudentAndSubjectAndSubjectRanking($tblStudent,

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

                            Section $section,
                            $name,
                            $textSize,
                            $isBorderBottom = false,
                            $isBorderRight = false

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

                          private function setPointsOverview($MarginTop = '25px')
                          {
                      
                              $textSize = '10px';
                              $slice = new Slice();
                      Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php on lines 1462..1510
                      Application/Api/Education/Certificate/Generator/Repository/GymKurshalbjahreszeugnis.php on lines 480..528

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

                      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

                              $pageList[] = (new Page())
                                  ->addSlice(
                                      $Header
                                  )
                                  ->addSlice((new Slice())
                      Application/Api/Education/Certificate/Generator/Repository/GymAbgSekI.php on lines 46..73

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

                      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

                              $pageList[] = (new Page())
                                  ->addSlice((new Slice())
                                      ->addSection((new Section())
                                          ->addElementColumn((new Element())
                                              ->setContent('Vorname und Zuname')
                      Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php on lines 209..273

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

                      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

                          private function setColumnElement(
                              Section $section,
                              $name,
                              $textSize,
                              $isBorderBottom = false,
                      Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php on lines 1437..1455
                      Application/Api/Education/Certificate/Generator/Repository/GymKurshalbjahreszeugnis.php on lines 537..555

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

                      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

                          private function setInfoRow($i, $text)
                          {
                              $section = new Section();
                              $section
                                  ->addElementColumn((new Element())
                      Application/Api/Education/Certificate/Generator/Repository/GymAbitur.php on lines 2003..2019

                      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

                      There are no issues that match your filters.

                      Category
                      Status