Showing 108 of 120 total issues
Method extractCollections
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function extractCollections($conditions, $parseLogic = false)
{
$extracted = array();
$count = count($conditions);
foreach($conditions as $key => $condition) {
Function execute
has a Cognitive Complexity of 13 (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
Function loadProperty
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function loadProperty($property)
{
$this->ensureMapped();
$entity = $property->entity();
$type = $property->side()->type();
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
$fields = array(
$leftKey = $this->config->leftKey,
$rightKey = $this->config->rightKey,
- 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 mapDatabaseQuery
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapDatabaseQuery($builder, $side, $group, $plan)
{
$config = $side->config();
$repository = $this->repository($config);
Function mapTree
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function mapTree($data)
{
$sideConfig = $this->side->config();
$idField = $this->modelConfig->idField;
- 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 findMergeTarget
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function findMergeTarget($conditionList, $newCondition)
{
$isNextFree = true;
$newPrecedance = $this->logicPrecedance[$newCondition->logic()];
- 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 normalizeIn
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function normalizeIn($inCondition)
{
$modelName = $inCondition->modelName();
$items = $inCondition->items();
$idField = $this->models->database()->config($modelName)->idField;
- 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 normalizeIn
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalizeIn($inCondition)
{
$modelName = $inCondition->modelName();
$items = $inCondition->items();
$idField = $this->models->database()->config($modelName)->idField;
Method mapPreload
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapPreload($side, $property, $result, $plan, $relatedLoader)
{
$config = $side->config();
$repository = $this->repository($config);
Method execute
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute()
{
$fields = array(
$rootIdKey = $this->config->rootIdKey,
$leftKey = $this->config->leftKey,
Method mapItems
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function mapItems()
{
$sideConfig = $this->side->config();
$fields = array(
Method unlinkPlan
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unlinkPlan($side, $items)
{
$config = $side->config();
$repository = $this->repository($config);
Function processProperty
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function processProperty($type, $config, $entity, $action, $value = null, $unsetRelated = true)
{
if(!$this->isEntityValue($entity))
return;
- 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 add
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function add($items)
{
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
Function mapDatabaseQuery
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function mapDatabaseQuery($query, $side, $collectionCondition, $plan)
{
$config = $side->config();
$itemRepository = $this->getRepository($config->itemModel);
$ownerRepository = $this->getRepository($config->ownerModel);
- 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 map
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function map($updateDatabaseQuery, $update)
{
$set = array();
$remove = array();
$increments = array();
- 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 handleDelete
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleDelete($side, $reusableResult, $plan, $sidePath)
{
$config = $side->config();
$itemKey = $config->ownerKey;
$itemModel = $config->itemModel;
Method mapTree
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function mapTree($data)
{
$sideConfig = $this->side->config();
$idField = $this->modelConfig->idField;
Method mapDatabaseQuery
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapDatabaseQuery($query, $side, $collectionCondition, $plan)
{
$dependencies = $this->getMappingDependencies($side);
$config = $dependencies['config'];
$sideRepository = $dependencies['sideRepository'];