apparat/object

View on GitHub

Showing 60 of 170 total issues

File FileAdapterStrategy.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * apparat-object
 *
Severity: Minor
Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php - About 3 hrs to fix

    SystemProperties has 24 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class SystemProperties extends AbstractProperties
    {
        /**
         * Collection name
         *
    Severity: Minor
    Found in src/Object/Domain/Model/Properties/SystemProperties.php - About 2 hrs to fix

      Method findObjectResourceLocators has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function findObjectResourceLocators(SelectorInterface $selector, RepositoryInterface $repository)
          {
              chdir($this->root);
      
              // Build a glob string from the selector
      Severity: Major
      Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php - About 2 hrs to fix

        File ObjectProxyTrait.php has 268 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /**
         * apparat-object
         *
        Severity: Minor
        Found in src/Object/Domain/Model/Object/Traits/ObjectProxyTrait.php - About 2 hrs to fix

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

          <?php
          
          /**
           * apparat-object
           *
          Severity: Minor
          Found in src/Object/Tests/RepositoryTest.php - About 2 hrs to fix

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

            class RepositoryTest extends AbstractDisabledAutoconnectorTest
            {
                /**
                 * Temporary glob directory
                 *
            Severity: Minor
            Found in src/Object/Tests/RepositoryTest.php - About 2 hrs to fix

              Url has 22 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Url extends Uri implements UriInterface, SerializablePropertyInterface
              {
                  /**
                   * Use PSR-7 method
                   */
              Severity: Minor
              Found in src/Object/Domain/Model/Uri/Url.php - About 2 hrs to fix

                Method getUrlInternal has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getUrlInternal(array &$override = [])
                    {
                        // Prepare the URL scheme
                        $scheme = !empty($this->urlParts['scheme']) ? $this->getScheme().'://' : '';
                        if (isset($override['scheme'])) {
                Severity: Major
                Found in src/Object/Domain/Model/Uri/Url.php - About 2 hrs to fix

                  Function getUrlInternal has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getUrlInternal(array &$override = [])
                      {
                          // Prepare the URL scheme
                          $scheme = !empty($this->urlParts['scheme']) ? $this->getScheme().'://' : '';
                          if (isset($override['scheme'])) {
                  Severity: Minor
                  Found in src/Object/Domain/Model/Uri/Url.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

                  Method setUpBeforeClass has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function setUpBeforeClass()
                      {
                          parent::setUpBeforeClass();
                          self::$globDirs[] =
                          self::$globBase = sys_get_temp_dir().DIRECTORY_SEPARATOR.'glob';
                  Severity: Minor
                  Found in src/Object/Tests/RepositoryTest.php - About 1 hr to fix

                    Function parseRelationString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected static function parseRelationString($relation, RepositoryInterface $contextRepository)
                        {
                            $parsed = [
                                self::PARSE_URL => null,
                                self::PARSE_LABEL => null,
                    Severity: Minor
                    Found in src/Object/Domain/Factory/RelationFactory.php - About 1 hr 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 configureDependencyInjection has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function configureDependencyInjection(DependencyInjectionContainerInterface $diContainer)
                        {
                            parent::configureDependencyInjection($diContainer);
                    
                            // Configure the repository service
                    Severity: Minor
                    Found in src/Object/Module.php - About 1 hr to fix

                      Method createFromParams has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function createFromParams(array $params)
                          {
                              $datePrecision = intval(getenv('OBJECT_DATE_PRECISION'));
                      
                              // Object visibility
                      Severity: Minor
                      Found in src/Object/Ports/Factory/SelectorFactory.php - About 1 hr to fix

                        Method parseRelationString has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected static function parseRelationString($relation, RepositoryInterface $contextRepository)
                            {
                                $parsed = [
                                    self::PARSE_URL => null,
                                    self::PARSE_LABEL => null,
                        Severity: Minor
                        Found in src/Object/Domain/Factory/RelationFactory.php - About 1 hr to fix

                          Method __construct has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function __construct(array $data, ObjectInterface $object)
                              {
                                  parent::__construct($data, $object);
                          
                                  // Initialize the object ID
                          Severity: Minor
                          Found in src/Object/Domain/Model/Properties/SystemProperties.php - About 1 hr to fix

                            Method testObjectUrlComparison has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function testObjectUrlComparison()
                                {
                                    $this->assertFalse(
                                        (
                                        new ObjectUrl(
                            Severity: Minor
                            Found in src/Object/Tests/ObjectUrlTest.php - About 1 hr to fix

                              Function findObjectResourceLocators has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function findObjectResourceLocators(SelectorInterface $selector, RepositoryInterface $repository)
                                  {
                                      chdir($this->root);
                              
                                      // Build a glob string from the selector
                              Severity: Minor
                              Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php - About 1 hr to fix

                              Cognitive Complexity

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

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

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

                              Further reading

                              Function setUpBeforeClass has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function setUpBeforeClass()
                                  {
                                      parent::setUpBeforeClass();
                                      self::$globDirs[] =
                                      self::$globBase = sys_get_temp_dir().DIRECTORY_SEPARATOR.'glob';
                              Severity: Minor
                              Found in src/Object/Tests/RepositoryTest.php - About 1 hr 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 testCreateAndPublishArticleObject has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      public function testCreateAndPublishArticleObject()
                                      {
                                          putenv('OBJECT_DEFAULT_PRIVACY=public');
                              
                                          // Create a temporary repository & article
                              Severity: Minor
                              Found in src/Object/Tests/ArticleObjectTest.php - About 1 hr to fix

                                Method getSelector has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getSelector()
                                    {
                                        $wlc = SelectorInterface::WILDCARD;
                                        $vsb = SelectorInterface::VISIBLE;
                                        $pub = SelectorInterface::PUBLISHED;
                                Severity: Minor
                                Found in src/Object/Tests/SelectorTest.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language