Showing 228 of 247 total issues
Field
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Field implements Expressionable
{
use DiContainerTrait {
setDefaults as private _setDefaults;
}
- Create a ticketCreate a ticket
Function _subrenderCondition
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
#[\Override]
protected function _subrenderCondition(array $row): string
{
if (count($row) !== 1) {
[$field, $operator, $value] = $row;
- 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 evaluateIf
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function evaluateIf($v1, string $operator, $v2): bool
{
if ($v2 instanceof self) {
$v2 = $v2->getRows();
}
- 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 _execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _execute(?object $connection, bool $fromExecuteStatement)
{
if ($connection === null) {
$connection = $this->connection;
}
- Create a ticketCreate a ticket
Connection
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Connection
{
use DiContainerTrait;
/** @var class-string<Expression> */
- Create a ticketCreate a ticket
Reference
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Reference
{
use DiContainerTrait;
use InitializerTrait {
init as private _init;
- Create a ticketCreate a ticket
Method normalizeDsn
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function normalizeDsn($dsn, $user = null, $password = null)
{
// BC for 2.4 - 3.0 accepted DSN input
if (is_string($dsn)) {
$dsn = ['dsn' => $dsn];
- Create a ticketCreate a ticket
Function createIteratorBy
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function createIteratorBy($field, $operator = null, $value = null): \Traversable
{
$this->assertIsModel();
$scopeOrig = 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
Function match
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function match(array $row, Model\Scope\AbstractScope $condition): bool
{
if ($condition instanceof Model\Scope\Condition) { // simple condition
$args = $condition->toQueryArguments();
- 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 fixMssqlOracleMissingFieldsInGroup
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function fixMssqlOracleMissingFieldsInGroup(Model $model, Query $query): void
{
if ($this->getDatabasePlatform() instanceof SQLServerPlatform
|| $this->getDatabasePlatform() instanceof OraclePlatform) {
$isIdFieldInGroup = false;
- 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 escapeStringLiteral
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
#[\Override]
protected function escapeStringLiteral(string $value): string
{
$dummyPersistence = (new \ReflectionClass(Persistence\Sql::class))->newInstanceWithoutConstructor();
if (\Closure::bind(static fn () => $dummyPersistence->explicitCastIsEncodedBinary($value), null, Persistence\Sql::class)()) {
- 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 Connection.php
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Atk4\Data\Persistence\Sql;
- Create a ticketCreate a ticket
Array_
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Array_ extends Persistence
{
/** @var array<string, array<int|string, mixed>> */
private array $seedData;
- Create a ticketCreate a ticket
Method evaluateIf
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function evaluateIf($v1, string $operator, $v2): bool
{
if ($v2 instanceof self) {
$v2 = $v2->getRows();
}
- Create a ticketCreate a ticket
Method listSequences
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function listSequences(): array
{
if (version_compare(Connection::getDriverVersion(), '3.37') < 0) {
$listAllSchemasSql = (new Query())
->table('pragma_database_list')
- Create a ticketCreate a ticket
Persistence
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Persistence
{
use ContainerTrait {
add as private _add;
}
- Create a ticketCreate a ticket
Method _renderConditionLikeOperator
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\Override]
protected function _renderConditionLikeOperator(bool $negated, string $sqlLeft, string $sqlRight): string
{
return ($negated ? 'not ' : '') . $this->_renderConditionBinaryReuseBool(
$sqlLeft,
- Create a ticketCreate a ticket
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 compareExportUnorderedValue
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function compareExportUnorderedValue($a, $b): int
{
if ($a === $b) {
return 0;
}
- Create a ticketCreate a ticket