soliantconsulting/SimpleFM

View on GitHub
test/Repository/Builder/MetadataHydrationTest.php

Summary

Maintainability
F
4 days
Test Coverage

File MetadataHydrationTest.php has 468 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
declare(strict_types = 1);

namespace SoliantTest\SimpleFM\Repository\Builder;

Severity: Minor
Found in test/Repository/Builder/MetadataHydrationTest.php - About 7 hrs to fix

    The class MetadataHydrationTest has 15 public methods. Consider refactoring MetadataHydrationTest to keep number of public methods under 10.
    Open

    final class MetadataHydrationTest extends TestCase
    {
        public function testSimpleFieldHydration()
        {
            $entityPrototype = new class

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

    Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

    Method testOneToOneInverseHydrationWithEntity has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testOneToOneInverseHydrationWithEntity(bool $eagerHydration)
        {
            $entityPrototype = new class
            {
                public $baz;
    Severity: Minor
    Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

      Method testOneToOneOwningHydrationWithEntity has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testOneToOneOwningHydrationWithEntity(bool $eagerHydration)
          {
              $entityPrototype = new class
              {
                  public $baz;
      Severity: Minor
      Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

        Method testManyToOneHydrationWithChild has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testManyToOneHydrationWithChild(bool $eagerHydration)
            {
                $entityPrototype = new class
                {
                    public $baz;
        Severity: Minor
        Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

          The class MetadataHydrationTest has 18 fields. Consider redesigning MetadataHydrationTest to keep the number of fields under 15.
          Open

          final class MetadataHydrationTest extends TestCase
          {
              public function testSimpleFieldHydration()
              {
                  $entityPrototype = new class

          TooManyFields

          Since: 0.1

          Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

          Example

          class Person {
             protected $one;
             private $two;
             private $three;
             [... many more fields ...]
          }

          Source https://phpmd.org/rules/codesize.html#toomanyfields

          Method testOneToManyHydrationWithEntity has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function testOneToManyHydrationWithEntity(bool $eagerHydration)
              {
                  $entityPrototype = new class
                  {
                      public $bar;
          Severity: Minor
          Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

            Method testOneToOneOwningHydrationWithoutEntity has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function testOneToOneOwningHydrationWithoutEntity(bool $eagerHydration)
                {
                    $entityPrototype = new class
                    {
                        public $baz;
            Severity: Minor
            Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

              Method testOneToOneInverseHydrationWithoutEntity has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testOneToOneInverseHydrationWithoutEntity(bool $eagerHydration)
                  {
                      $entityPrototype = new class
                      {
                          public $baz;
              Severity: Minor
              Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

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

                    public function testManyToOneHydrationWithoutEntity(bool $eagerHydration)
                    {
                        $entityPrototype = new class
                        {
                            public $baz;
                Severity: Minor
                Found in test/Repository/Builder/MetadataHydrationTest.php - About 1 hr to fix

                  The class MetadataHydrationTest has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
                  Open

                  final class MetadataHydrationTest extends TestCase
                  {
                      public function testSimpleFieldHydration()
                      {
                          $entityPrototype = new class

                  CouplingBetweenObjects

                  Since: 1.1.0

                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                  Example

                  class Foo {
                      /**
                       * @var \foo\bar\X
                       */
                      private $x = null;
                  
                      /**
                       * @var \foo\bar\Y
                       */
                      private $y = null;
                  
                      /**
                       * @var \foo\bar\Z
                       */
                      private $z = null;
                  
                      public function setFoo(\Foo $foo) {}
                      public function setBar(\Bar $bar) {}
                      public function setBaz(\Baz $baz) {}
                  
                      /**
                       * @return \SplObjectStorage
                       * @throws \OutOfRangeException
                       * @throws \InvalidArgumentException
                       * @throws \ErrorException
                       */
                      public function process(\Iterator $it) {}
                  
                      // ...
                  }

                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                  Avoid using static access to class '\Prophecy\Argument' in method 'testManyToOneHydrationWithChild'.
                  Open

                              Argument::type('closure'),

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method testOneToOneOwningHydrationWithEntity uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->assertInstanceOf(ProxyInterface::class, $entity->baz);
                              $this->assertSame('child-entity', $entity->baz->__getRealEntity());
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\Prophecy\Argument' in method 'testOneToManyHydrationWithEntity'.
                  Open

                              $repository->findByQuery(Argument::any())->will(function (array $parameters) use ($testCase) {

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method testManyToOneHydrationWithChild uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->assertInstanceOf(ProxyInterface::class, $entity->baz);
                              $this->assertSame('child-entity', $entity->baz->__getRealEntity());
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method testOneToOneOwningHydrationWithEntity uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $repository->findOneBy(['ID' => '5'])->willReturn('child-entity');
                              $repository->quoteString('5')->willReturn('5');
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method testOneToOneInverseHydrationWithEntity uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $repository->findOneBy(['ID' => '5'])->willReturn('parent-entity');
                              $repository->quoteString('5')->willReturn('5');
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method testOneToOneInverseHydrationWithEntity uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $this->assertInstanceOf(ProxyInterface::class, $entity->baz);
                              $this->assertSame('parent-entity', $entity->baz->__getRealEntity());
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  The method testManyToOneHydrationWithChild uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $repository->findOneBy(['ID' => '5'])->willReturn('child-entity');
                              $repository->quoteString('5')->willReturn('5');
                          }

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                  Avoid using static access to class '\Prophecy\Argument' in method 'testOneToOneOwningHydrationWithEntity'.
                  Open

                              Argument::type('closure'),

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  Avoid using static access to class '\Prophecy\Argument' in method 'testOneToOneInverseHydrationWithEntity'.
                  Open

                              Argument::type('closure'),

                  StaticAccess

                  Since: 1.4.0

                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                  Example

                  class Foo
                  {
                      public function bar()
                      {
                          Bar::baz();
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                  The method testOneToManyHydrationWithEntity uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                  Open

                          } else {
                              $testCase = $this;
                              $repository->findByQuery(Argument::any())->will(function (array $parameters) use ($testCase) {
                                  $testCase->assertSame('5', $parameters[0]->toParameters()['-q1.value']);
                                  $testCase->assertSame('6', $parameters[0]->toParameters()['-q2.value']);

                  ElseExpression

                  Since: 1.4.0

                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                  Example

                  class Foo
                  {
                      public function bar($flag)
                      {
                          if ($flag) {
                              // one branch
                          } else {
                              // another branch
                          }
                      }
                  }

                  Source https://phpmd.org/rules/cleancode.html#elseexpression

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

                      public function testSimpleFieldHydration()
                      {
                          $entityPrototype = new class
                          {
                              public $baz;
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 4 hrs to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 89..107

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                      public function testReadOnlyFieldHydration()
                      {
                          $entityPrototype = new class
                          {
                              public $baz;
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 4 hrs to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 28..46

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [
                              new Embeddable('baz', '', new Entity('', get_class($embeddablePrototype), [
                                  new Field('fooField', 'foo', new StringType(), false, false),
                              ], [], [], [], [])),
                          ], [], [], []);
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 2 other locations - About 2 hrs to fix
                  test/Repository/Builder/MetadataExtractionTest.php on lines 134..138
                  test/Repository/Builder/MetadataHydrationTest.php on lines 165..169

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [
                              new Embeddable('baz', 'bazPrefix', new Entity('', get_class($embeddablePrototype), [
                                  new Field('fooField', 'foo', new StringType(), false, false),
                              ], [], [], [], [])),
                          ], [], [], []);
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 2 other locations - About 2 hrs to fix
                  test/Repository/Builder/MetadataExtractionTest.php on lines 134..138
                  test/Repository/Builder/MetadataHydrationTest.php on lines 138..142

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [], [
                              new OneToOne(
                                  'baz',
                                  'bar',
                                  'parent',
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 1 hr to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 397..410

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [], [
                              new OneToOne(
                                  'baz',
                                  'bar',
                                  'parent',
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 1 hr to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 458..471

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [], [
                              new OneToOne(
                                  'baz',
                                  'bar',
                                  'child',
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 1 hr to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 297..310

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [], [
                              new OneToOne(
                                  'baz',
                                  'bar',
                                  'child',
                  Severity: Major
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 1 hr to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 358..371

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

                  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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [
                              new ManyToOne(
                                  'bat',
                                  'baz',
                                  'bar',
                  Severity: Minor
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 45 mins to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 259..271

                  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

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

                          $entityMetadata = new Entity('foo', get_class($entityPrototype), [], [], [], [
                              new ManyToOne(
                                  'bat',
                                  'baz',
                                  'bar',
                  Severity: Minor
                  Found in test/Repository/Builder/MetadataHydrationTest.php and 1 other location - About 45 mins to fix
                  test/Repository/Builder/MetadataHydrationTest.php on lines 199..211

                  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