DerDu/SPHERE-Framework

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

Summary

Maintainability
F
3 wks
Test Coverage

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

    public function createStudentsFromFile(
        IFormInterface $Form = null,
        UploadedFile $File = null,
        $TypeId = null,
        $YearId = null
Severity: Minor
Found in Application/Transfer/Import/FuxMedia/Service.php - About 6 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 481 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function createStudentsFromFile(
        IFormInterface $Form = null,
        UploadedFile $File = null,
        $TypeId = null,
        $YearId = null
Severity: Major
Found in Application/Transfer/Import/FuxMedia/Service.php - About 2 days to fix

    Function createDivisionsFromFile has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
    Open

        public function createDivisionsFromFile(
            IFormInterface $Form = null,
            UploadedFile $File = null,
            $TypeId = null,
            $YearId = null
    Severity: Minor
    Found in Application/Transfer/Import/FuxMedia/Service.php - About 2 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

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

    <?php
    
    
    namespace SPHERE\Application\Transfer\Import\FuxMedia;
    
    
    Severity: Major
    Found in Application/Transfer/Import/FuxMedia/Service.php - About 2 days to fix

      Function createTeachersFromFile has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
      Open

          public function createTeachersFromFile(
              IFormInterface $Form = null,
              UploadedFile $File = null
          ) {
      
      
      Severity: Minor
      Found in Application/Transfer/Import/FuxMedia/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 createTeachersFromFile has 135 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function createCompaniesFromFile has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

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

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method createDivisionsFromFile has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createDivisionsFromFile(
                IFormInterface $Form = null,
                UploadedFile $File = null,
                $TypeId = null,
                $YearId = null
        Severity: Major
        Found in Application/Transfer/Import/FuxMedia/Service.php - About 3 hrs to fix

          Method createCompaniesFromFile has 55 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/FuxMedia/Service.php - About 2 hrs to fix

            Avoid deeply nested control flow statements.
            Open

                                            if ($PhoneNumber != '') {
                                                Phone::useService()->insertPhoneToPerson($tblPerson, $PhoneNumber,
                                                    Phone::useService()->getTypeById(1), '');
                                            }
            Severity: Major
            Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                              if (( $company = Company::useService()->getCompanyByDescription(trim(
                                                  $Document->getValue($Document->getCell($Location['Schüler_aufnehmende_Schule_ID'],
                                                      $RunY)))) )
                                              ) {
                                                  $arriveSchool = $company;
              Severity: Major
              Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                for ($i = 1; $i < 3; $i++) {
                                                    $PhoneNumber = trim($Document->getValue($Document->getCell($Location['Telefon'.$i],
                                                        $RunY)));
                                                    if ($PhoneNumber != '') {
                                                        Phone::useService()->insertPhoneToPerson($tblPerson, $PhoneNumber,
                Severity: Major
                Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (trim($Document->getValue($Document->getCell($Location['Wohnort'],
                                                          $RunY))) != ''
                                                  ) {
                                                      $Street = trim($Document->getValue($Document->getCell($Location['Straße'],
                                                          $RunY)));
                  Severity: Major
                  Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if (preg_match_all('!\d+!', $Street, $matches)) {
                                                        $pos = strpos($Street, $matches[0][0]);
                                                        if ($pos !== null) {
                                                            $StreetName = trim(substr($Street, 0, $pos));
                                                            $StreetNumber = trim(substr($Street, $pos));
                    Severity: Major
                    Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      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/FuxMedia/Service.php - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if ($enrollmentDate !== '' && date_create($enrollmentDate) !== false) {
                                                            $tblStudentTransferType = Student::useService()->getStudentTransferTypeByIdentifier('Enrollment');
                                                            Student::useService()->insertStudentTransfer(
                                                                $tblStudent,
                                                                $tblStudentTransferType,
                        Severity: Major
                        Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                          for ($i = 1; $i < 5; $i++) {
                                                              $subjectLanguage = trim($Document->getValue($Document->getCell($Location['Fächer_Fremdsprache'.$i],
                                                                  $RunY)));
                                                              $tblSubject = false;
                                                              if ($subjectLanguage !== '') {
                          Severity: Major
                          Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if ($leaveDate !== '' && date_create($leaveDate) !== false) {
                                                                $tblStudentTransferType = Student::useService()->getStudentTransferTypeByIdentifier('Leave');
                                                                Student::useService()->insertStudentTransfer(
                                                                    $tblStudent,
                                                                    $tblStudentTransferType,
                            Severity: Major
                            Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                                  if (trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter1_Wohnort'],
                                                                          $RunY))) != ''
                                                                  ) {
                                                                      $Street = trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter1_Straße'],
                                                                          $RunY)));
                              Severity: Major
                              Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                                if (( $company = Company::useService()->getCompanyByDescription(trim(
                                                                    $Document->getValue($Document->getCell($Location['Schüler_abgebende_Schule_ID'],
                                                                        $RunY)))) )
                                                                ) {
                                                                    $leaveSchool = $company;
                                Severity: Major
                                Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                                  if ($tblLevel) {
                                                                      $Division = trim($Document->getValue($Document->getCell($Location['Schüler_Klasse'],
                                                                          $RunY)));
                                                                      if ($Division != '') {
                                                                          if (( $pos = strpos($Division, $Level) ) !== false) {
                                  Severity: Major
                                  Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                        if (trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter2_Wohnort'],
                                                                                $RunY))) != ''
                                                                        ) {
                                                                            $Street = trim($Document->getValue($Document->getCell($Location['Sorgeberechtigter2_Straße'],
                                                                                $RunY)));
                                    Severity: Major
                                    Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                      if ($arriveDate !== '' && date_create($arriveDate) !== false) {
                                                                          $tblStudentTransferType = Student::useService()->getStudentTransferTypeByIdentifier('Arrive');
                                                                          Student::useService()->insertStudentTransfer(
                                                                              $tblStudent,
                                                                              $tblStudentTransferType,
                                      Severity: Major
                                      Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                        if ($FaxNumber != '') {
                                                                            Phone::useService()->insertPhoneToPerson($tblPerson, $FaxNumber,
                                                                                Phone::useService()->getTypeById(7), '');
                                                                        }
                                        Severity: Major
                                        Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                          if ($Division != '') {
                                                                              if (( $pos = strpos($Division, $Level) ) !== false) {
                                                                                  if (strlen($Division) > ( ( $start = $pos + strlen($Level) ) )) {
                                                                                      $Division = substr($Division, $start);
                                                                                  }
                                          Severity: Major
                                          Found in Application/Transfer/Import/FuxMedia/Service.php - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            if ($MailAddress != '') {
                                                                                Mail::useService()->insertMailToPerson($tblPerson, $MailAddress,
                                                                                    Mail::useService()->getTypeById(1), '');
                                                                            }
                                            Severity: Major
                                            Found in Application/Transfer/Import/FuxMedia/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/FuxMedia/Service.php - About 30 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/FuxMedia/Service.php - About 30 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/FuxMedia/Service.php - About 30 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/FuxMedia/Service.php - About 30 mins to fix

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

                                                                                  if ($MotherLastName !== '') {
                                                                                      $tblPersonMotherExists = $this->usePeoplePerson()->getPersonExists(
                                                                                          $MotherFirstName,
                                                                                          $MotherLastName,
                                                                                          $CityCode
                                                      Severity: Major
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 2 days to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 480..547

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

                                                      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 = $this->usePeoplePerson()->getPersonExists(
                                                                                          $FatherFirstName,
                                                                                          $FatherLastName,
                                                                                          $CityCode
                                                      Severity: Major
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 2 days to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 557..624

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

                                                      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 (trim($Document->getValue($Document->getCell($Location['Schüler_Wohnort'],
                                                                                          $RunY))) != ''
                                                                                  ) {
                                                                                      $Street = trim($Document->getValue($Document->getCell($Location['Schüler_Straße'],
                                                                                          $RunY)));
                                                      Severity: Major
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 1 day to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 777..803

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

                                                      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 (trim($Document->getValue($Document->getCell($Location['Wohnort'],
                                                                                              $RunY))) != ''
                                                                                      ) {
                                                                                          $Street = trim($Document->getValue($Document->getCell($Location['Straße'],
                                                                                              $RunY)));
                                                      Severity: Major
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 1 day to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 232..258

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

                                                      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(
                                                                          'Lehrerkürzel' => null,
                                                                          'Name'         => null,
                                                                          'Vorname'      => null,
                                                                          'Anrede'       => null,
                                                      Severity: Major
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 2 other locations - About 3 hrs to fix
                                                      Application/Transfer/Import/Herrnhut/Service.php on lines 1388..1406
                                                      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 2 locations. Consider refactoring.
                                                      Open

                                                                                  for ($i = 1; $i < 7; $i++) {
                                                                                      $PhoneNumber = trim($Document->getValue($Document->getCell($Location['Kommunikation_Telefon'.$i],
                                                                                          $RunY)));
                                                                                      if ($PhoneNumber != '') {
                                                                                          Phone::useService()->insertPhoneToPerson($tblPerson, $PhoneNumber,
                                                      Severity: Minor
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 45 mins to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 806..813

                                                      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

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

                                                                                      for ($i = 1; $i < 3; $i++) {
                                                                                          $PhoneNumber = trim($Document->getValue($Document->getCell($Location['Telefon'.$i],
                                                                                              $RunY)));
                                                                                          if ($PhoneNumber != '') {
                                                                                              Phone::useService()->insertPhoneToPerson($tblPerson, $PhoneNumber,
                                                      Severity: Minor
                                                      Found in Application/Transfer/Import/FuxMedia/Service.php and 1 other location - About 45 mins to fix
                                                      Application/Transfer/Import/FuxMedia/Service.php on lines 261..268

                                                      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