Function parseGeneric
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function parseGeneric($field, $operator, $value, $negated, $convertMongoId = false)
{
if (!is_array($value) || count($value) !== 1)
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
Method parseBetween
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function parseBetween($field, $operator, $range, $negated, $convertMongoId = false)
Method parseIn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function parseIn($field, $operator, $value, $negated, $convertMongoId = false)
Method parseGeneric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function parseGeneric($field, $operator, $value, $negated, $convertMongoId = false)
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"
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"