DerDu/SPHERE-Framework

View on GitHub
Application/Transfer/Import/Herrnhut/Service.php

Summary

Maintainability
F
1 mo
Test Coverage

Function createStudentsFromFile has a Cognitive Complexity of 687 (exceeds 5 allowed). Consider refactoring.
Open

    public function createStudentsFromFile(
        IFormInterface $Form = null,
        UploadedFile $File = null,
        $isFormerStudent = false
    ) {
Severity: Minor
Found in Application/Transfer/Import/Herrnhut/Service.php - About 2 wks 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 createCompaniesFromFile has a Cognitive Complexity of 222 (exceeds 5 allowed). Consider refactoring.
Open

    public function createCompaniesFromFile(
        IFormInterface $Form = null,
        UploadedFile $File = null
    ) {

Severity: Minor
Found in Application/Transfer/Import/Herrnhut/Service.php - About 4 days 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 createStudentsFromFile has 727 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createStudentsFromFile(
        IFormInterface $Form = null,
        UploadedFile $File = null,
        $isFormerStudent = false
    ) {
Severity: Major
Found in Application/Transfer/Import/Herrnhut/Service.php - About 3 days to fix

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

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

      Function createPersonsFromFile has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createPersonsFromFile(
              IFormInterface $Form = null,
              UploadedFile $File = null
          ) {
      
      
      Severity: Minor
      Found in Application/Transfer/Import/Herrnhut/Service.php - About 1 day 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 createCompaniesFromFile has 233 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function createCompaniesFromFile(
              IFormInterface $Form = null,
              UploadedFile $File = null
          ) {
      
      
      Severity: Major
      Found in Application/Transfer/Import/Herrnhut/Service.php - About 1 day to fix

        Method createPersonsFromFile has 140 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createPersonsFromFile(
                IFormInterface $Form = null,
                UploadedFile $File = null
            ) {
        
        
        Severity: Major
        Found in Application/Transfer/Import/Herrnhut/Service.php - About 5 hrs to fix

          Avoid deeply nested control flow statements.
          Open

                                                  if (0 === strpos($phoneNumber, '01')) {
                                                      if ($i !== 3 && $i !== 4) {
                                                          $tblType = Phone::useService()->getTypeById(2);
                                                      } else {
                                                          $tblType = Phone::useService()->getTypeById(4);
          Severity: Major
          Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($tblCompany && $isNew) {
                                            $streetName = '';
                                            $streetNumber = '';
                                            $street = trim($Document->getValue($Document->getCell($Location['Straße'], $RunY)));
                                            if (preg_match_all('!\d+!', $street, $matches)) {
            Severity: Major
            Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                      if ($tblSubject) {
                                                          Student::useService()->addStudentSubject(
                                                              $tblStudent,
                                                              Student::useService()->getStudentSubjectTypeByIdentifier('PROFILE'),
                                                              Student::useService()->getStudentSubjectRankingByIdentifier('1'),
              Severity: Major
              Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                        if ($subjectLanguage !== '') {
                                                            if ($subjectLanguage === 'EN') {
                                                                $tblSubject = Subject::useService()->getSubjectByAcronym('EN');
                                                            } elseif ($subjectLanguage === 'FR') {
                                                                $tblSubject = Subject::useService()->getSubjectByAcronym('FR');
                Severity: Major
                Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                          if ($tblSubject) {
                                                              Student::useService()->addStudentSubject(
                                                                  $tblStudent,
                                                                  Student::useService()->getStudentSubjectTypeByIdentifier('RELIGION'),
                                                                  Student::useService()->getStudentSubjectRankingByIdentifier('1'),
                  Severity: Major
                  Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                            if ($subjectProfile === 'P/gw-WED') {
                                                                $tblSubject = Subject::useService()->getSubjectByAcronym('WED');
                                                                if (!$tblSubject) {
                                                                    $tblSubject = Subject::useService()->insertSubject('WED',
                                                                        'gesellschaftswissenschaftliches Profil / Wirtschaftsethik und Diakonie');
                    Severity: Major
                    Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                          if ($pos !== null) {
                                                              $streetName = trim(substr($street, 0, $pos));
                                                              $streetNumber = trim(substr($street, $pos));
                                                          }
                      Severity: Major
                      Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if (!$tblSalutation) {
                                                            $errorList[] = array(
                                                                'RowCount' => $rowCount,
                                                                'Message' => 'Die Anrede: ' . $salutation . ' konnte nicht gefunden werden.',
                                                                'Result' => 'Die Person wird ohne Anrede angelegt.'
                        Severity: Major
                        Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                                      if (!$tblPeriodList) {
                                                                          // firstTerm
                                                                          $tblPeriod = Term::useService()->insertPeriod(
                                                                              '1. Halbjahr',
                                                                              '01.08.20' . $year,
                          Severity: Major
                          Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                                        if ($tblPersonFather) {
                                                                            Phone::useService()->insertPhoneToPerson(
                                                                                $tblPersonFather,
                                                                                $phoneNumber,
                                                                                $tblType,
                            Severity: Major
                            Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                      if ($pos !== null) {
                                                                          $streetName = trim(substr($street, 0, $pos));
                                                                          $streetNumber = trim(substr($street, $pos));
                                                                      }
                              Severity: Major
                              Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if ($tblCompany && ($firstName != '' || $lastName != '')) {
                                                                if ($personId != '') {
                                                                    if (($tblPerson = Person::useService()->getPersonById($personId))) {
                                                                        if ($tblPerson->getFirstName() != $firstName) {
                                                                            $errorList[] = array(
                                Severity: Major
                                Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                          if ($pos !== null) {
                                                                              $streetName = trim(substr($street, 0, $pos));
                                                                              $streetNumber = trim(substr($street, $pos));
                                                                          }
                                  Severity: Major
                                  Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                                if ($tblSchoolType) {
                                                                                    if (($pos = stripos($division, '-'))) {
                                                                                        $level = substr($division, 0, $pos);
                                                                                        $division = substr($division, $pos + 1);
                                                                                        $tblGroup = Group::useService()->insertGroup((2020 - $level) . '-' . $division);
                                    Severity: Major
                                    Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                              if ($subjectReligion === 'ETH') {
                                                                                  $tblSubject = Subject::useService()->getSubjectByAcronym('ETH');
                                                                              } elseif ($subjectReligion === 'RE/e') {
                                                                                  $tblSubject = Subject::useService()->getSubjectByAcronym('REV');
                                                                              }
                                      Severity: Major
                                      Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                                    if ($tblPersonMother) {
                                                                                        Phone::useService()->insertPhoneToPerson(
                                                                                            $tblPersonMother,
                                                                                            $phoneNumber,
                                                                                            $tblType,
                                        Severity: Major
                                        Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                                  if ($integration === 'Diskalkulie') {
                                                                                      $tblStudentDisorderType = Student::useService()->getStudentDisorderTypeByName('Dyskalkulie');
                                                                                      Student::useService()->addStudentDisorder($tblStudent,
                                                                                          $tblStudentDisorderType);
                                                                                  } elseif ($integration === 'LRS') {
                                          Severity: Major
                                          Found in Application/Transfer/Import/Herrnhut/Service.php - About 45 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                    return new Danger('File nicht gefunden');
                                            Severity: Major
                                            Found in Application/Transfer/Import/Herrnhut/Service.php - About 30 mins to fix

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

                                                                              if ($tblPersonMother !== null) {
                                                                                  $streetName = '';
                                                                                  $streetNumber = '';
                                                                                  $street = trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter1_Straße'],
                                                                                      $RunY)));
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 3 other locations - About 1 day to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 485..511
                                              Application/Transfer/Import/Muldental/Service.php on lines 820..846
                                              Application/Transfer/Import/Muldental/Service.php on lines 847..873

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

                                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                              Refactorings

                                              Further Reading

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

                                                                              if ($tblPersonFather !== null) {
                                                                                  $streetName = '';
                                                                                  $streetNumber = '';
                                                                                  $street = trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter2_Straße'],
                                                                                      $RunY)));
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 3 other locations - About 1 day to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 512..538
                                              Application/Transfer/Import/Muldental/Service.php on lines 820..846
                                              Application/Transfer/Import/Muldental/Service.php on lines 847..873

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

                                              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 ($motherLastName != '') {
                                              
                                                                                  $tblPersonMotherExists = Person::useService()->existsPerson(
                                                                                      $motherFirstName,
                                                                                      $motherLastName,
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 1 other location - About 7 hrs to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 333..389

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

                                              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 ($fatherLastName != '') {
                                              
                                                                                  $tblPersonFatherExists = Person::useService()->existsPerson(
                                                                                      $fatherFirstName,
                                                                                      $fatherLastName,
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 1 other location - About 7 hrs to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 405..461

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

                                              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 ($streetName != '' && $streetNumber != '' && $city != '' && $cityCode != '') {
                                                                                  Address::useService()->insertAddressToPerson(
                                                                                      $tblPerson,
                                                                                      $streetName,
                                                                                      $streetNumber,
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 1 other location - About 4 hrs to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 1493..1511

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

                                              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 ($streetName != '' && $streetNumber != '' && $city != '' && $cityCode != '') {
                                                                                  Address::useService()->insertAddressToCompany(
                                                                                      $tblCompany,
                                                                                      $streetName,
                                                                                      $streetNumber,
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 1 other location - About 4 hrs to fix
                                              Application/Transfer/Import/Herrnhut/Service.php on lines 1290..1308

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

                                              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

                                                                              Common::useService()->insertMeta(
                                                                                  $tblPerson,
                                                                                  trim($Document->getValue($Document->getCell($Location['Schüler_Geburtsdatum'],
                                                                                      $RunY))),
                                                                                  trim($Document->getValue($Document->getCell($Location['Schüler_Geburtsort'],
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 2 other locations - About 3 hrs to fix
                                              Application/Transfer/Import/Annaberg/Service.php on lines 720..734
                                              Application/Transfer/Import/Muldental/Service.php on lines 519..533

                                              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

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

                                                              $Location = array(
                                                                  'Name der Institution' => null,
                                                                  'Zusatz der Institution' => null,
                                                                  'Straße' => null,
                                                                  'PLZ' => null,
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 2 other locations - About 3 hrs to fix
                                              Application/Transfer/Import/FuxMedia/Service.php on lines 704..722
                                              Application/Transfer/Import/Schneeberg/Service.php on lines 1691..1709

                                              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

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

                                                                                  if ($subjectReligion !== '') {
                                                                                      if ($subjectReligion === 'ETH') {
                                                                                          $tblSubject = Subject::useService()->getSubjectByAcronym('ETH');
                                                                                      } elseif ($subjectReligion === 'RE/e') {
                                                                                          $tblSubject = Subject::useService()->getSubjectByAcronym('REV');
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 5 other locations - About 1 hr to fix
                                              Application/Transfer/Import/BadDueben/Service.php on lines 1676..1690
                                              Application/Transfer/Import/Muldental/Service.php on lines 1081..1095
                                              Application/Transfer/Import/Radebeul/Service.php on lines 1022..1036
                                              Application/Transfer/Import/Schneeberg/Service.php on lines 1521..1535
                                              Application/Transfer/Import/Zwickau/Service.php on lines 1110..1124

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

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

                                                                  return
                                                                      new Success('Es wurden ' . $countStudent . ' Schüler erfolgreich angelegt.') .
                                                                      new Success('Es wurden ' . $countFather . ' Väter erfolgreich angelegt.') .
                                                                      ($countFatherExists > 0 ?
                                                                          new Warning($countFatherExists . ' Väter exisistieren bereits.') : '') .
                                              Severity: Major
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 4 other locations - About 1 hr to fix
                                              Application/Transfer/Import/Chemnitz/Service.php on lines 337..344
                                              Application/Transfer/Import/Chemnitz/Service.php on lines 1132..1139
                                              Application/Transfer/Import/Hormersdorf/Service.php on lines 350..357
                                              Application/Transfer/Import/Hormersdorf/Service.php on lines 1151..1158

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

                                              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 ($i == 3) {
                                                                                          if ($tblPersonMother) {
                                                                                              Phone::useService()->insertPhoneToPerson(
                                                                                                  $tblPersonMother,
                                                                                                  $phoneNumber,
                                              Severity: Minor
                                              Found in Application/Transfer/Import/Herrnhut/Service.php and 1 other location - About 45 mins to fix
                                              Application/Transfer/Import/Muldental/Service.php on lines 891..916

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

                                              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