apparat/object

View on GitHub

Showing 11 of 170 total issues

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

    protected function deleteObject(ObjectInterface $object)
    {
        // Hide object directory
        $objContainerDir = dirname(dirname($this->getAbsoluteResourcePath($object->getRepositoryLocator())));
        $objContainerName = $object->getId()->getId().'-'.$object->getObjectType()->getType();
Severity: Major
Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php and 1 other location - About 5 hrs to fix
src/Object/Infrastructure/Repository/FileAdapterStrategy.php on lines 516..540

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

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

    protected function undeleteObject(ObjectInterface $object)
    {
        // Hide object directory
        $objContainerDir = dirname(dirname($this->getAbsoluteResourcePath($object->getRepositoryLocator())));
        $objContainerName = $object->getId()->getId().'-'.$object->getObjectType()->getType();
Severity: Major
Found in src/Object/Infrastructure/Repository/FileAdapterStrategy.php and 1 other location - About 5 hrs to fix
src/Object/Infrastructure/Repository/FileAdapterStrategy.php on lines 445..469

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

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 static $proxyRelationTypes = [
        ContributesRelation::TYPE => ContributesProxyRelation::class,
        ContributedByRelation::TYPE => ContributedByProxyRelation::class,
        EmbedsRelation::TYPE => EmbedsProxyRelation::class,
        EmbeddedByRelation::TYPE => EmbeddedByProxyRelation::class,
Severity: Major
Found in src/Object/Domain/Factory/RelationFactory.php and 1 other location - About 3 hrs to fix
src/Object/Domain/Factory/RelationFactory.php on lines 113..128

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

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 static $relationTypes = [
        ContributesRelation::TYPE => ContributesRelation::class,
        ContributedByRelation::TYPE => ContributedByRelation::class,
        EmbedsRelation::TYPE => EmbedsRelation::class,
        EmbeddedByRelation::TYPE => EmbeddedByRelation::class,
Severity: Major
Found in src/Object/Domain/Factory/RelationFactory.php and 1 other location - About 3 hrs to fix
src/Object/Domain/Factory/RelationFactory.php on lines 134..149

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

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

<?php

/**
 * apparat/object
 *
Severity: Major
Found in src/Object/Application/Contract/ObjectTypesInterface.php and 1 other location - About 2 hrs to fix
src/Object/Domain/Contract/ObjectTypesInterface.php on lines 1..173

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

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

<?php

/**
 * apparat/object
 *
Severity: Major
Found in src/Object/Domain/Contract/ObjectTypesInterface.php and 1 other location - About 2 hrs to fix
src/Object/Application/Contract/ObjectTypesInterface.php on lines 1..173

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

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 5 locations. Consider refactoring.
Open

    protected function setMetaProperties(MetaProperties $metaProperties, $overwrite = false)
    {
        $this->metaProperties = $metaProperties;
        $metaPropertiesState = spl_object_hash($this->metaProperties);

src/Object/Domain/Model/Object/Traits/DomainPropertiesTrait.php on lines 97..112
src/Object/Domain/Model/Object/Traits/ProcessingInstructionsTrait.php on lines 89..104
src/Object/Domain/Model/Object/Traits/RelationsTrait.php on lines 101..116
src/Object/Domain/Model/Object/Traits/SystemPropertiesTrait.php on lines 212..227

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

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

    protected function setSystemProperties(SystemProperties $systemProperties, $overwrite = false)
    {
        $this->systemProperties = $systemProperties;
        $systemPropsState = spl_object_hash($this->systemProperties);

src/Object/Domain/Model/Object/Traits/DomainPropertiesTrait.php on lines 97..112
src/Object/Domain/Model/Object/Traits/MetaPropertiesTrait.php on lines 86..101
src/Object/Domain/Model/Object/Traits/ProcessingInstructionsTrait.php on lines 89..104
src/Object/Domain/Model/Object/Traits/RelationsTrait.php on lines 101..116

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

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

    protected function setProcessingInstructions(GenericPropertiesInterface $procInstructions, $overwrite = false)
    {
        $this->processingInstructions = $procInstructions;
        $procInstState = spl_object_hash($this->processingInstructions);

src/Object/Domain/Model/Object/Traits/DomainPropertiesTrait.php on lines 97..112
src/Object/Domain/Model/Object/Traits/MetaPropertiesTrait.php on lines 86..101
src/Object/Domain/Model/Object/Traits/RelationsTrait.php on lines 101..116
src/Object/Domain/Model/Object/Traits/SystemPropertiesTrait.php on lines 212..227

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

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

    protected function setDomainProperties(GenericPropertiesInterface $domainProperties, $overwrite = false)
    {
        $this->domainProperties = $domainProperties;
        $domainPropsState = spl_object_hash($this->domainProperties);

src/Object/Domain/Model/Object/Traits/MetaPropertiesTrait.php on lines 86..101
src/Object/Domain/Model/Object/Traits/ProcessingInstructionsTrait.php on lines 89..104
src/Object/Domain/Model/Object/Traits/RelationsTrait.php on lines 101..116
src/Object/Domain/Model/Object/Traits/SystemPropertiesTrait.php on lines 212..227

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

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

    protected function setRelations(Relations $relations, $overwrite = false)
    {
        $this->relations = $relations;
        $relationsState = spl_object_hash($this->relations);

Severity: Major
Found in src/Object/Domain/Model/Object/Traits/RelationsTrait.php and 4 other locations - About 1 hr to fix
src/Object/Domain/Model/Object/Traits/DomainPropertiesTrait.php on lines 97..112
src/Object/Domain/Model/Object/Traits/MetaPropertiesTrait.php on lines 86..101
src/Object/Domain/Model/Object/Traits/ProcessingInstructionsTrait.php on lines 89..104
src/Object/Domain/Model/Object/Traits/SystemPropertiesTrait.php on lines 212..227

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

Severity
Category
Status
Source
Language