soliantconsulting/SimpleFM

View on GitHub

Showing 44 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

        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

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

              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

                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

                    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 buildProxyClass has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function buildProxyClass(
                            string $entityInterfaceName,
                            string $proxyNamespace,
                            string $proxyClassName
                        ) : string {
                    Severity: Major
                    Found in src/Repository/Builder/Proxy/ProxyBuilder.php - About 3 hrs to fix

                      MetadataBuilderTest has 27 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      final class MetadataBuilderTest extends TestCase
                      {
                          public function testInvalidType()
                          {
                              $this->expectException(InvalidArgumentException::class);
                      Severity: Minor
                      Found in test/Repository/Builder/Metadata/MetadataBuilderTest.php - About 3 hrs to fix

                        Function extractWithMetadata has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function extractWithMetadata($entity, Entity $metadata) : array
                            {
                                if ($entity instanceof ProxyInterface) {
                                    $entity = $entity->__getRealEntity();
                                }
                        Severity: Minor
                        Found in src/Repository/Builder/MetadataExtraction.php - About 3 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 extractWithMetadata has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function extractWithMetadata($entity, Entity $metadata) : array
                            {
                                if ($entity instanceof ProxyInterface) {
                                    $entity = $entity->__getRealEntity();
                                }
                        Severity: Major
                        Found in src/Repository/Builder/MetadataExtraction.php - About 3 hrs to fix

                          Function arrayToParagraphs has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function arrayToParagraphs($value)
                          {
                              $count = count($value);
                              if ($count) {
                                  $collapsedValue = '';
                          Severity: Minor
                          Found in doc/filemaker/simplefm_example.php - About 2 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

                          File MetadataBuilderTest.php has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language