Showing 36 of 38 total issues
File DBConvertStructuredQueryToSQL.php
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Squirrel\Queries\Doctrine;
use Squirrel\Debug\Debug;
File DBAbstractImplementation.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Squirrel\Queries\Doctrine;
use Doctrine\DBAL\Connection;
Consider simplifying this complex logical expression. Open
if (
\str_contains($expression, ' ')
|| \str_contains($expression, '=')
|| \str_contains($expression, '<')
|| \str_contains($expression, '>')
Function buildChanges
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function buildChanges(array $changes, array $queryValues): array
{
// List of finished change expressions, to be imploded with ,
$changesList = [];
- 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 verifyAndProcessOptions
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function verifyAndProcessOptions(array $validOptions, array $options): array
{
// Convert "table" to "tables"
if (
isset($options['table'])
Function verifyAndProcessOptions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function verifyAndProcessOptions(array $validOptions, array $options): array
{
// Convert "table" to "tables"
if (
isset($options['table'])
- 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 buildWhere
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function buildWhere(array $whereOptions, array $queryValues = []): array
{
// If no WHERE restrictions are defined, we just do "WHERE 1"
if (\count($whereOptions) === 0) {
return ['1', $queryValues];
- 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
DBAbstractImplementation
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class DBAbstractImplementation implements DBRawInterface
{
protected DBConvertStructuredQueryToSQL $structuredQueryConverter;
/**
Function buildFieldSelection
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function buildFieldSelection(array $fields): string
{
// No fields mean we select all fields!
if (\count($fields) === 0) {
return '*';
- 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 transactionExecute
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function transactionExecute(
callable $func,
array $arguments,
array $connectionRetries,
array $lockRetries,
Method buildChanges
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildChanges(array $changes, array $queryValues): array
{
// List of finished change expressions, to be imploded with ,
$changesList = [];
Function transactionExecute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function transactionExecute(
callable $func,
array $arguments,
array $connectionRetries,
array $lockRetries,
- 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 buildOrderBy
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function buildOrderBy(array $orderOptions): string
{
// 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
Method buildWhere
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildWhere(array $whereOptions, array $queryValues = []): array
{
// If no WHERE restrictions are defined, we just do "WHERE 1"
if (\count($whereOptions) === 0) {
return ['1', $queryValues];
Method buildFieldSelection
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildFieldSelection(array $fields): string
{
// No fields mean we select all fields!
if (\count($fields) === 0) {
return '*';
Method buildGroupBy
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildGroupBy(array $groupByOptions): string
{
// List of finished WHERE expressions, to be imploded with ANDs
$groupByProcessed = [];
Method buildOrderBy
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildOrderBy(array $orderOptions): string
{
// List of finished WHERE expressions, to be imploded with ANDs
$orderProcessed = [];
Method internalCall
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function internalCall(
string $name,
array $arguments,
array $connectionRetries,
array $lockRetries,
Method convertStructuredSelectToQuery
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertStructuredSelectToQuery(array $select): array
{
// Make sure all options are correctly defined
$select = $this->structuredQueryConverter->verifyAndProcessOptions([
'fields' => [],
Function buildGroupBy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function buildGroupBy(array $groupByOptions): string
{
// 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"