Function toQueryArguments
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function toQueryArguments(): array
{
$field = $this->field;
$operator = $this->operator;
$value = $this->value;
- Read upRead up
- Create a ticketCreate a ticket
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 Condition.php
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Model\Scope;
- Create a ticketCreate a ticket
Function valueToWords
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function valueToWords(Model $model, $value): string
{
if ($value === null) {
return $this->operator
? 'empty'
- Read upRead up
- Create a ticketCreate a ticket
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 __construct
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($field, $operator = null, $value = null)
{
if ($field instanceof AbstractScope) {
throw new Exception('Only Scope can contain another conditions');
} elseif ($field instanceof Field) { // for BC
- Read upRead up
- Create a ticketCreate a ticket
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 toQueryArguments
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toQueryArguments(): array
{
$field = $this->field;
$operator = $this->operator;
$value = $this->value;
- Create a ticketCreate a ticket
Method valueToWords
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function valueToWords(Model $model, $value): string
{
if ($value === null) {
return $this->operator
? 'empty'
- Create a ticketCreate a ticket
Method __construct
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($field, $operator = null, $value = null)
{
if ($field instanceof AbstractScope) {
throw new Exception('Only Scope can contain another conditions');
} elseif ($field instanceof Field) { // for BC
- Create a ticketCreate a ticket
Function fieldToWords
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function fieldToWords(Model $model): string
{
$words = [];
$field = $this->field;
- Read upRead up
- Create a ticketCreate a ticket
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 fieldToWords
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function fieldToWords(Model $model): string
{
$words = [];
$field = $this->field;
- Create a ticketCreate a ticket
Function onChangeModel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
#[\Override]
protected function onChangeModel(): void
{
$model = $this->getModel();
if ($model !== null) {
- Read upRead up
- Create a ticketCreate a ticket
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
Avoid too many return
statements within this method. Open
return 'object ' . print_r($value, true);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $valueStr . ($title !== null ? ' (\'' . $title . '\')' : '');
- Create a ticketCreate a ticket