apparat/object

View on GitHub

Showing 60 of 170 total issues

Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
Open

        TypeServiceInterface $typeService,
        $year = self::WILDCARD,
        $month = self::WILDCARD,
        $day = self::WILDCARD,
        $hour = self::WILDCARD,
Severity: Major
Found in src/Object/Domain/Repository/Selector.php - About 1 hr to fix

    Method findRelations has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function findRelations(array $criteria)
        {
            // Validate the relation type (if given as a criteria)
            if (array_key_exists(RelationInterface::FILTER_TYPE, $criteria)) {
                RelationFactory::validateRelationType($criteria[RelationInterface::FILTER_TYPE]);
    Severity: Minor
    Found in src/Object/Domain/Model/Properties/Relations.php - About 1 hr to fix

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

          public function __construct($locator = null, $datePrecision = null, &$leader = '')
          {
              if (!empty($locator)) {
                  // If the local default date precision should be used
                  if ($datePrecision === null) {
      Severity: Minor
      Found in src/Object/Domain/Model/Uri/Locator.php - About 1 hr to fix

        Method testPSR7methods has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function testPSR7methods()
            {
                $url = new Url(self::REMOTE_URL);
                $this->assertEquals(self::REMOTE_REPOSITORY_AUTHORITY, $url->getAuthority());
                $this->assertEquals('apparat:tools', $url->getUserInfo());
        Severity: Minor
        Found in src/Object/Tests/UrlTest.php - About 1 hr to fix

          Method matches has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function matches(Url $url)
              {
          
                  // Test the scheme
                  $urlScheme = $url->getScheme();
          Severity: Minor
          Found in src/Object/Domain/Model/Uri/Url.php - About 1 hr to fix

            Method loadRevisionData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function loadRevisionData($payload = '', array $propertyData = [])
                {
                    $this->payload = $payload;
            
                    // Instantiate the system properties
            Severity: Minor
            Found in src/Object/Domain/Model/Object/AbstractObject.php - About 1 hr to fix

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

                  public function createObjectResource(\Closure $creator)
                  {
                      $sizeDescriptor = null;
              
                      try {
              Severity: Minor
              Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php - About 1 hr to fix

                Function __construct has a Cognitive Complexity of 10 (exceeds 5 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

                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 matches has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function matches(Url $url)
                    {
                        // If the standard URL components don't match
                        if (!parent::matches($url)) {
                            return false;
                Severity: Minor
                Found in src/Object/Domain/Model/Uri/ObjectUrl.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 matches has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function matches(Url $url)
                    {
                
                        // Test the scheme
                        $urlScheme = $url->getScheme();
                Severity: Minor
                Found in src/Object/Domain/Model/Uri/Url.php - About 55 mins 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 loadObjectResource has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function loadObjectResource(
                        RepositoryLocatorInterface &$currentLocator,
                        $visibility = SelectorInterface::ALL
                    ) {
                        // Validate the object visibility
                Severity: Minor
                Found in src/Object/Application/Model/Object/Manager.php - About 55 mins 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 normalizeRepositoryUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function normalizeRepositoryUrl($url)
                    {
                        // If it's an apparat URL
                        if ($url instanceof ApparatUrl) {
                            $url = $url->getNormalizedRepositoryUrl();
                Severity: Minor
                Found in src/Object/Domain/Repository/Service.php - About 45 mins 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 parseRelationUrl has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected static function parseRelationUrl($url, &$coupling, RepositoryInterface $contextRepository)
                    {
                        if (strlen($url)) {
                            // If the URL requires tight coupling
                            if (!strncmp('!', $url, 1)) {
                Severity: Minor
                Found in src/Object/Domain/Factory/RelationFactory.php - About 45 mins 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 filterSingleValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function filterSingleValue($value)
                    {
                        // If the value is empty
                        if (empty($value)) {
                            return null;
                Severity: Minor
                Found in src/Object/Application/Model/Properties/Domain/PropertyModel.php - About 45 mins 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 validateDateComponent has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $year = self::WILDCARD,
                        $month = self::WILDCARD,
                        $day = self::WILDCARD,
                        $hour = self::WILDCARD,
                        $minute = self::WILDCARD,
                Severity: Minor
                Found in src/Object/Domain/Repository/Selector.php - About 45 mins to fix

                  Function toSerializedArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function toSerializedArray($serialize, array $data)
                      {
                          // Filter all empty values
                          $data = array_filter($data);
                  
                  
                  Severity: Minor
                  Found in src/Object/Domain/Model/Properties/AbstractProperties.php - About 45 mins 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

                  Consider simplifying this complex logical expression.
                  Open

                          if (!($this->uid instanceof Id)
                              || !($this->type instanceof Type)
                              || !($this->revision instanceof Revision)
                              || !($this->created instanceof \DateTimeInterface)
                              || !($this->modified instanceof \DateTimeInterface)
                  Severity: Major
                  Found in src/Object/Domain/Model/Properties/SystemProperties.php - About 40 mins to fix

                    Method createObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            RepositoryInterface $repository,
                            Type $type,
                            $payload = '',
                            array $propertyData = [],
                            \DateTimeInterface $creationDate = null
                    Severity: Minor
                    Found in src/Object/Application/Model/Object/Manager.php - About 35 mins to fix

                      Method createObject has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              RepositoryInterface $repository,
                              Type $type,
                              $payload = '',
                              array $propertyData = [],
                              \DateTimeInterface $creationDate = null
                      Severity: Minor
                      Found in src/Object/Domain/Model/Object/ManagerInterface.php - About 35 mins to fix

                        Function __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function __construct($locator = null, $datePrecision = null, &$leader = '')
                            {
                                if (!empty($locator)) {
                                    // If the local default date precision should be used
                                    if ($datePrecision === null) {
                        Severity: Minor
                        Found in src/Object/Domain/Model/Uri/Locator.php - About 35 mins 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

                        Severity
                        Category
                        Status
                        Source
                        Language