Showing 66 of 66 total issues
Function dsn
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function dsn($withDatabase = true)
{
if($connection = $this->config->get('connection')) {
$dsn = $connection;
} else {
- 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 optimize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function optimize($groups)
{
$count = count($groups);
$remove = array();
for ($i = 0; $i < $count; $i++) {
- 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 addKeyValuesToArray
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addKeyValuesToArray($name, $args, $requireKeys = false, $firstParameterIsKey = true, $assertIsNumeric = false)
{
$array = $args[0];
if (!is_array($array)) {
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
Function parseLogicLevel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function parseLogicLevel($iterator, $level = 0)
{
$current = $iterator->current();
$res = $this->normalize($current);
- 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 parseCompare
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseCompare($field, $operator, $values)
{
$isColumn = false;
if (substr($operator, -1, 1) === '*') {
Function add
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function add($condition, $logic = 'and')
{
$isExpandedGroup = $condition instanceof ExpandedGroup;
if(!$isExpandedGroup && !(($condition instanceof \PHPixie\Database\Conditions\Condition\Field\Operator))) {
throw new \PHPixie\Database\Exception\Parser("You can only add ExpandedGroup and Operator conditions");
- 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run($connection)
{
$current = $connection->database();
foreach ($this->chain as $step) {
- 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 addContainerOperatorCondition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addContainerOperatorCondition($logic, $negate, $field, $operator, $values, $containerName = null)
Method addContainerOperatorCondition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addContainerOperatorCondition($logic, $negate, $field, $operator, $values, $containerName = null)
Function buildCondition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildCondition($logic, $negate, $args)
{
$count = count($args);
if ($count >= 2) {
$field = $args[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
Method addOperatorCondition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addOperatorCondition($logic, $negate, $field, $operator, $values, $containerName = null)
Function appendFields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function appendFields($query, $expr)
{
$fields = $query->getFields();
if (empty($fields)) {
- 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 addContainerInOperatorCondition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addContainerInOperatorCondition($field, $values, $logic, $negate, $containerName = null)
Method addSubdocumentPlaceholder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addSubdocumentPlaceholder($field, $logic = 'and', $negate = false, $allowEmpty = true, $containerName = null)
Method addSubarrayItemPlaceholder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addSubarrayItemPlaceholder($field, $logic = 'and', $negate = false, $allowEmpty = true, $containerName = null)
Method addContainerSubdocumentPlaceholder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function addContainerSubdocumentPlaceholder($field, $logic = 'and', $negate = false, $allowEmpty = true, $containerName = null)
Method parseGeneric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function parseGeneric($field, $operator, $value, $negated, $convertMongoId = false)
Method addOnOperatorCondition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addOnOperatorCondition($logic, $negate, $field, $operator, $values)