Showing 66 of 66 total issues
Avoid too many return
statements within this method. Open
return $this->deleteQuery($query, $runner);
Function parseIn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function parseIn($field, $operator, $values)
{
$value = $this->singleValue($values, $operator);
if(is_array($value) && count($value) === 0) {
- 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 selectQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function selectQuery($query, $runner)
{
$this->chainCollection($query, $runner);
$conditions = $this->conditionsParser->parse($query->getWhereConditions());
- 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 parseIn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function parseIn($field, $operator, $value, $negated, $convertMongoId = false)
{
if (count($value)!==1 && !is_array($value[0]))
throw new \PHPixie\Database\Exception\Parser("The '$operator' operator requires a single array parameter to be passed");
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function parse($query)
{
$expr = $this->database->sqlExpression();
$type = $query->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 parseBetween
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function parseBetween($field, $operator, $range, $negated, $convertMongoId = false)
{
if (!is_array($range) || count($range) !== 2)
throw new \PHPixie\Database\Exception\Parser("The '$operator' operator requires two parameters to be passed");
if($operator === 'not between')
- 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"