soliantconsulting/SimpleFM

View on GitHub

Showing 330 of 330 total issues

Method validXmlProvider has 275 lines of code (exceeds 25 allowed). Consider refactoring.
Open

public static function validXmlProvider() : array
{
return [
'project-sample-data' => [
'projectsampledata.xml',
Severity: Major
Found in test/Client/ResultSet/ResultSetClientTest.php - About 1 day to fix

    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

      File RepositoryTest.php has 454 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      declare(strict_types = 1);
       
      namespace SoliantTest\SimpleFM\Repository;
       
       
      Severity: Minor
      Found in test/Repository/RepositoryTest.php - About 6 hrs to fix

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

        <?php
        declare(strict_types = 1);
         
        namespace SoliantTest\SimpleFM\Repository\Builder\Type;
         
         
        Severity: Major
        Found in test/Repository/Builder/Type/TimeTypeTest.php and 1 other location - About 6 hrs to fix
        test/Repository/Builder/Type/DateTypeTest.php on lines 1..51

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

        <?php
        declare(strict_types = 1);
         
        namespace SoliantTest\SimpleFM\Repository\Builder\Type;
         
         
        Severity: Major
        Found in test/Repository/Builder/Type/DateTypeTest.php and 1 other location - About 6 hrs to fix
        test/Repository/Builder/Type/TimeTypeTest.php on lines 1..51

        File ResultSetClientTest.php has 428 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        declare(strict_types = 1);
         
        namespace SoliantTest\SimpleFM\Client\ResultSet;
         
         
        Severity: Minor
        Found in test/Client/ResultSet/ResultSetClientTest.php - About 6 hrs to fix

          File MetadataExtractionTest.php has 391 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/MetadataExtractionTest.php - About 5 hrs to fix

            Function hydrateWithMetadata has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
            Open

            private function hydrateWithMetadata(array $data, $entity, Entity $metadata)
            {
            Assertion::isInstanceOf($entity, $metadata->getClassName());
            $reflectionClass = new ReflectionClass($entity);
             
             
            Severity: Minor
            Found in src/Repository/Builder/MetadataHydration.php - About 5 hrs to fix

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

            public function testOneToOneOwningReadOnlyExtractionWithEntity()
            {
            $childEntity = new class implements EmptyProxyEntityInterface
            {
            private $id = 5;
            Severity: Major
            Found in test/Repository/Builder/MetadataExtractionTest.php and 1 other location - About 4 hrs to fix
            test/Repository/Builder/MetadataExtractionTest.php on lines 376..404

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

            public function testOneToOneInverseExtractionWithEntity()
            {
            $childEntity = new class implements EmptyProxyEntityInterface
            {
            private $id = 5;
            Severity: Major
            Found in test/Repository/Builder/MetadataExtractionTest.php and 1 other location - About 4 hrs to fix
            test/Repository/Builder/MetadataExtractionTest.php on lines 318..346

            Method buildMetadata has 115 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            private function buildMetadata(string $xmlPath) : Entity
            {
            $xml = $this->loadValidatedXml($xmlPath);
            $fields = [];
            $embeddables = [];
            Severity: Major
            Found in src/Repository/Builder/Metadata/MetadataBuilder.php - About 4 hrs to fix

              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

              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

              Method hydrateWithMetadata has 104 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              private function hydrateWithMetadata(array $data, $entity, Entity $metadata)
              {
              Assertion::isInstanceOf($entity, $metadata->getClassName());
              $reflectionClass = new ReflectionClass($entity);
               
               
              Severity: Major
              Found in src/Repository/Builder/MetadataHydration.php - About 4 hrs to fix

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

                public function testRequestWithUriAndCommandCredentials()
                {
                $identityHandler = $this->prophesize(IdentityHandlerInterface::class);
                $identityHandler->decryptPassword(Argument::any())->willReturn('bat2');
                 
                 
                Severity: Major
                Found in test/Connection/ConnectionTest.php and 1 other location - About 4 hrs to fix
                test/Connection/ConnectionTest.php on lines 110..127

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

                public function testRequestWithCommandIdentity()
                {
                $identityHandler = $this->prophesize(IdentityHandlerInterface::class);
                $identityHandler->decryptPassword(Argument::any())->willReturn('bat2');
                 
                 
                Severity: Major
                Found in test/Connection/ConnectionTest.php and 1 other location - About 4 hrs to fix
                test/Connection/ConnectionTest.php on lines 91..108

                File FileMakerException.php has 328 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                declare(strict_types = 1);
                 
                namespace Soliant\SimpleFM\Client\Exception;
                 
                 
                Severity: Minor
                Found in src/Client/Exception/FileMakerException.php - About 3 hrs to fix

                  RepositoryTest has 31 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  final class RepositoryTest extends TestCase
                  {
                  public function testQuoteStringUsesClientMethod()
                  {
                  $resultSetClient = $this->prophesize(ResultSetClientInterface::class);
                  Severity: Minor
                  Found in test/Repository/RepositoryTest.php - About 3 hrs to fix

                    Function buildMetadata has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                    Open

                    private function buildMetadata(string $xmlPath) : Entity
                    {
                    $xml = $this->loadValidatedXml($xmlPath);
                    $fields = [];
                    $embeddables = [];
                    Severity: Minor
                    Found in src/Repository/Builder/Metadata/MetadataBuilder.php - About 3 hrs to fix

                    The class MetadataBuilderTest has 27 public methods. Consider refactoring MetadataBuilderTest to keep number of public methods under 10.
                    Open

                    final class MetadataBuilderTest extends TestCase
                    {
                    public function testInvalidType()
                    {
                    $this->expectException(InvalidArgumentException::class);
                    Severity
                    Category
                    Status
                    Source
                    Language