DerDu/SPHERE-Framework

View on GitHub
Application/Reporting/DeclarationBasis/Service.php

Summary

Maintainability
F
2 wks
Test Coverage

Function createDivisionReportExcel has a Cognitive Complexity of 364 (exceeds 5 allowed). Consider refactoring.
Open

    public function createDivisionReportExcel()
    {

        $tblYearList = false;
        $DataContent = array();
Severity: Minor
Found in Application/Reporting/DeclarationBasis/Service.php - About 1 wk 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 createDivisionReportExcel has 814 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createDivisionReportExcel()
    {

        $tblYearList = false;
        $DataContent = array();
Severity: Major
Found in Application/Reporting/DeclarationBasis/Service.php - About 4 days to fix

    File Service.php has 836 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace SPHERE\Application\Reporting\DeclarationBasis;
    
    use MOC\V\Component\Document\Component\Bridge\Repository\PhpExcel;
    Severity: Major
    Found in Application/Reporting/DeclarationBasis/Service.php - About 2 days to fix

      Avoid deeply nested control flow statements.
      Open

                                  if ($tblCity) {
                                      $AddressCompanyCodeCity = $tblCity->getCode().' '.$tblCity->getDisplayName();
                                  }
      Severity: Major
      Found in Application/Reporting/DeclarationBasis/Service.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                            if (($tblPerson = $tblDivisionStudent->getServiceTblPerson())
                                                && ($tblSupport = Student::useService()->getSupportForReportingByPerson($tblPerson))
                                                && ($tblSupportFocus = Student::useService()->getSupportPrimaryFocusBySupport($tblSupport))
                                                && ($tblSupportFocusType = $tblSupportFocus->getTblSupportFocusType())
                                            ) {
        Severity: Major
        Found in Application/Reporting/DeclarationBasis/Service.php - About 45 mins to fix

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

                                                  if ($tblSupportFocusType->getName() == 'Geistige Entwicklung') {
                                                      if (isset($DataMental[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataMental[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataMental[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Unterricht kranker Schüler') {
                                                      if (isset($DataSickStudent[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataSickStudent[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataSickStudent[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129

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

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

                                                  if ($tblSupportFocusType->getName() == 'Hören') {
                                                      if (isset($DataHear[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataHear[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataHear[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Körperlich-motorische Entwicklung') {
                                                      if (isset($DataPhysical[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataPhysical[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataPhysical[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Sprache') {
                                                      if (isset($DataLanguage[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataLanguage[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataLanguage[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Sozial-emotionale Entwicklung') {
                                                      if (isset($DataEducation[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataEducation[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataEducation[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Lernen') {
                                                      if (isset($DataLearn[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataLearn[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataLearn[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 74..81
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

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

                                                  if ($tblSupportFocusType->getName() == 'Sehen') {
                                                      if (isset($DataBlind[$DivisionTypeName][$tblLevel->getName()])) {
                                                          $DataBlind[$DivisionTypeName][$tblLevel->getName()] += 1;
                                                      } else {
                                                          $DataBlind[$DivisionTypeName][$tblLevel->getName()] = 1;
          Severity: Major
          Found in Application/Reporting/DeclarationBasis/Service.php and 7 other locations - About 55 mins to fix
          Application/Reporting/DeclarationBasis/Service.php on lines 82..89
          Application/Reporting/DeclarationBasis/Service.php on lines 90..97
          Application/Reporting/DeclarationBasis/Service.php on lines 98..105
          Application/Reporting/DeclarationBasis/Service.php on lines 106..113
          Application/Reporting/DeclarationBasis/Service.php on lines 114..121
          Application/Reporting/DeclarationBasis/Service.php on lines 122..129
          Application/Reporting/DeclarationBasis/Service.php on lines 130..137

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

          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