Showing 59 of 59 total issues
File MultiRepositoryReadOnly.php
has 819 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Squirrel\Entities;
use Squirrel\Debug\Debug;
Function buildFieldSelection
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
private function buildFieldSelection(
array $selectOptions,
array $objectToTableFields,
array $objectTypes,
array $objectTypesNullable,
- 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 processOptions
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
protected function processOptions(array $validOptions, array $options, bool $writing = false): array
{
// Reset DB class - needs to be set by the current options
$dbInstance = null;
- 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
File RepositoryReadOnly.php
has 504 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Squirrel\Entities;
use Squirrel\Connection\LargeObject;
Method processOptions
has 186 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processOptions(array $validOptions, array $options, bool $writing = false): array
{
// Reset DB class - needs to be set by the current options
$dbInstance = null;
Function __invoke
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(string $fileContents): array
{
// List of classes, each entry has the namespace as first element and the
// class name as the second element
$classes = [];
- 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 __invoke
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function __invoke(): array
{
/** @var list<string> $logRepositories */
$logRepositories = [];
/** @var list<string> $logConflicts */
- 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 preprocessWhere
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
protected function preprocessWhere(array $whereOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$whereProcessed = [];
- 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 buildFieldSelection
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildFieldSelection(
array $selectOptions,
array $objectToTableFields,
array $objectTypes,
array $objectTypesNullable,
Function preprocessJoins
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function preprocessJoins(array $tables, array $tableNames, array $objectToTableFields): array
{
// List of table selection, needs to be imploded with a comma for SQL query
$tablesProcessed = [];
- 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 process
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function process(object|string $class): ?RepositoryConfigInterface
{
// Get class reflection data
$reflectionClass = new \ReflectionClass($class);
- 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 preprocessOrder
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function preprocessOrder(array $orderOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$orderProcessed = [];
- 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 preprocessGroup
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function preprocessGroup(array $groupByOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$groupByProcessed = [];
- 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 processSelectResult
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function processSelectResult(
array $entry,
array $selectTypes,
array $selectTypesNullable,
): array {
- 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 castOneTableVariable
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function castOneTableVariable(mixed $value, ?string $fieldName = null, bool $isChange = false): int|float|string|LargeObject|null
{
// Only scalar values and null are allowed
if (!\is_null($value) && !\is_scalar($value)) {
throw Debug::createException(
Function preprocessOrder
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function preprocessOrder(array $orderOptions): array
{
// Order SQL parts
$orderProcessed = [];
- 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 withRepositories
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public static function withRepositories(array $repositories): self
{
// Connection to use for transaction
$connection = null;
- 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 preprocessJoins
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function preprocessJoins(array $tables, array $tableNames, array $objectToTableFields): array
{
// List of table selection, needs to be imploded with a comma for SQL query
$tablesProcessed = [];
Method __invoke
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __invoke(string $fileContents): array
{
// List of classes, each entry has the namespace as first element and the
// class name as the second element
$classes = [];
Method withRepositories
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function withRepositories(array $repositories): self
{
// Connection to use for transaction
$connection = null;