Function parseGraph
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function parseGraph(array $graph = array(), array &$values, &$currentKey)
{
$type = key($graph);
$parsed = [];
$joins = [];
- 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 tokenize
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function tokenize(array $expressions)
{
$tokens = array();
foreach ($expressions as $expr) {
- 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 Resolver.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Ctrl\Common\Criteria;
use Ctrl\Common\Tools\StringHelper;
Function getFieldConfig
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function getFieldConfig($expr, $root)
{
if (strpos($expr, ' ') === false) {
$field = $expr;
$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
Method getFieldConfig
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getFieldConfig($expr, $root)
{
if (strpos($expr, ' ') === false) {
$field = $expr;
$condition = '=';
Function resolveCriteria
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function resolveCriteria($criteria, $type = self::T_AND)
{
if (!is_array($criteria)) {
$criteria = array($criteria);
}
- 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 parseGraph
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseGraph(array $graph = array(), array &$values, &$currentKey)
{
$type = key($graph);
$parsed = [];
$joins = [];
Method resolveCriteria
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveCriteria($criteria, $type = self::T_AND)
{
if (!is_array($criteria)) {
$criteria = array($criteria);
}
Function createGraph
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function createGraph($tokens)
{
if (is_string($tokens)) {
$tokens = $this->tokenize(StringHelper::bracesToArray($tokens));
}
- 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 tokenize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tokenize(array $expressions)
{
$tokens = array();
foreach ($expressions as $expr) {