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
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 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 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 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 preprocessWhere
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function preprocessWhere(array $whereOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$whereProcessed = [];
Method buildSelectQueryStructured
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildSelectQueryStructured(array $query): array
{
// Process options and make sure all values are valid
[
$sanitizedOptions,
Method preprocessGroup
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function preprocessGroup(array $groupByOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$groupByProcessed = [];
Method preprocessOrder
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function preprocessOrder(array $orderOptions, array $objectToTableFields): array
{
// List of finished WHERE expressions, to be imploded with ANDs
$orderProcessed = [];
Method processSelectResult
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processSelectResult(
array $entry,
array $selectTypes,
array $selectTypesNullable,
): array {
Method buildSelectQueryFreeform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function buildSelectQueryFreeform(array $options): array
{
// Process options and make sure all values are valid
[
$sanitizedOptions,
Function buildSelectQueryStructured
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function buildSelectQueryStructured(array $query): array
{
// Process options and make sure all values are valid
[
$sanitizedOptions,
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
array $selectOptions,
array $objectToTableFields,
array $objectTypes,
array $objectTypesNullable,
bool $generateSql = false,