Showing 120 of 120 total issues
Proxy
has 72 functions (exceeds 20 allowed). Consider refactoring. Open
class Proxy implements \PHPixie\ORM\Conditions\Builder
{
protected $builder;
protected $aliases = array(
'and' => '_and',
Container
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
class Container extends \PHPixie\Database\Conditions\Builder\Container
implements \PHPixie\ORM\Conditions\Builder
{
protected $conditions;
protected $relationshipMap;
Similar blocks of code found in 2 locations. Consider refactoring. Open
<?php
namespace PHPixie\ORM\Relationships\Type\Embeds\Type;
class Many extends \PHPixie\ORM\Relationships\Type\Embeds
- 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 190.
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
<?php
namespace PHPixie\ORM\Relationships\Type\Embeds\Type;
class One extends \PHPixie\ORM\Relationships\Type\Embeds
- 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 190.
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
<?php
namespace PHPixie\ORM\Drivers\Driver;
class PDO extends \PHPixie\ORM\Drivers\Driver
- 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 174.
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
<?php
namespace PHPixie\ORM\Drivers\Driver;
class Mongo extends \PHPixie\ORM\Drivers\Driver
- 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 174.
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
Builder
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Builder
{
/**
* @type \PHPixie\Database
*/
Query
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Query extends \PHPixie\ORM\Conditions\Builder\Proxy
implements \PHPixie\ORM\Models\Type\Database\Query
{
/**
* @type \PHPixie\ORM\Values
File Proxy.php
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace PHPixie\ORM\Conditions\Builder;
class Proxy implements \PHPixie\ORM\Conditions\Builder
Function processItems
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function processItems($action, $config, $items, $owner = null, $processOldOwner = true)
{
if(!is_array($items))
$items = array($items);
- 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
Query
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Query extends \PHPixie\ORM\Conditions\Builder\Proxy
implements \PHPixie\ORM\Models\Type\Database\Query
{
/**
* @type \PHPixie\ORM\Drivers\Driver\PDO\Query|\PHPixie\ORM\Drivers\Driver\Mongo\Query
Function extractCollections
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function extractCollections($conditions, $parseLogic = false)
{
$extracted = array();
$count = count($conditions);
foreach($conditions as $key => $condition) {
- 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
File Container.php
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace PHPixie\ORM\Conditions\Builder;
class Container extends \PHPixie\Database\Conditions\Builder\Container
Function processProperties
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function processProperties($action, $owners, $ownerProperty, $items)
{
if (!is_array($owners))
$owners = array($owners);
- 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 execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$modelConfig = $this->repository->config();
$config = $this->config;
File Handler.php
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace PHPixie\ORM\Relationships\Type\ManyToMany;
class Handler extends \PHPixie\ORM\Relationships\Relationship\Implementation\Handler
Method mapDatabaseQuery
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapDatabaseQuery($query, $side, $collectionCondition, $plan)
{
$config = $side->config();
$itemRepository = $this->getRepository($config->itemModel);
$ownerRepository = $this->getRepository($config->ownerModel);
Method execute
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$modelConfig = $this->repository->config();
$config = $this->config;
Function objectDiff
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function objectDiff($new, $old)
{
$newData = get_object_vars($new);
$oldData = get_object_vars($old);
$unset = array_values(array_diff(array_keys($oldData), array_keys($newData)));
- 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
Function execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$modelConfig = $this->repository->config();
$config = $this->config;
- 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"