File CommonGrammar.php
has 303 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Finesse\QueryScribe\Grammars;
use Finesse\QueryScribe\Exceptions\InvalidQueryException;
CommonGrammar
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class CommonGrammar implements GrammarInterface
{
use CommonGrammarCriteriaTrait;
use CommonGrammarOrderTrait;
Function compileInsertFromValues
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array
{
if (empty($values)) {
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 compileInsert
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function compileInsert(Query $query): array
{
if ($query->table === null) {
throw new InvalidQueryException('The INTO table is not set');
}
Method compileInsertFromValues
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function compileInsertFromValues($table, string $tableAlias = null, array $values): array
{
if (empty($values)) {
return [];
}
Function compileInsert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function compileInsert(Query $query): array
{
if ($query->table === null) {
throw new InvalidQueryException('The INTO table is not set');
}
- 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 compileOffsetAndLimitPart
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function compileOffsetAndLimitPart(Query $query, array &$bindings): string
{
$parts = [];
if ($query->limit !== 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"