Showing 108 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;
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"
Further reading
Method mapPreload
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapPreload($side, $preloadProperty, $reusableResult, $plan, $relatedLoader)
{
$config = $side->config();
$itemRepository = $this->getRepository($config->itemModel);
Method link
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function link($pivot, $firstSide, $secondSide, $plan)
{
$pivotTable = $pivot->source();
$sides = array(
Method execute
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$fields = array(
$leftKey = $this->config->leftKey,
$rightKey = $this->config->rightKey,
Method mapPreload
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapPreload($side, $preloadProperty, $result, $plan, $relatedLoader)
{
$dependencies = $this->getMappingDependencies($side);
$config = $dependencies['config'];