Showing 170 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();
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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();
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File FileAdapterStrategy.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
The class Url has an overall complexity of 80 which is very high. The configured complexity threshold is 50. Open
class Url extends Uri implements UriInterface, SerializablePropertyInterface
{
/**
* Use PSR-7 method
*/
- Exclude checks
The class FileAdapterStrategy has an overall complexity of 67 which is very high. The configured complexity threshold is 50. Open
class FileAdapterStrategy extends AbstractAdapterStrategy
{
/**
* Adapter strategy type
*
- Exclude checks
Identical blocks of code found in 2 locations. Consider refactoring. Open
<?php
/**
* apparat/object
*
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
<?php
/**
* apparat/object
*
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
SystemProperties
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class SystemProperties extends AbstractProperties
{
/**
* Collection name
*
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
File ObjectProxyTrait.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
File RepositoryTest.php
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* apparat-object
*
RepositoryTest
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class RepositoryTest extends AbstractDisabledAutoconnectorTest
{
/**
* Temporary glob directory
*
Url
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Url extends Uri implements UriInterface, SerializablePropertyInterface
{
/**
* Use PSR-7 method
*/
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'])) {
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'])) {
- Read upRead up
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';
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,
- Read upRead up
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