File Base.php
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Envms\FluentPDO\Queries;
use DateTime, IteratorAggregate, PDO, PDOStatement;
Base
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Base implements IteratorAggregate
{
/** @var float */
private $totalTime;
Function debug
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function debug()
{
if (!empty($this->fluent->debug)) {
if (!is_callable($this->fluent->debug)) {
$backtrace = '';
- 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 convertNullValues
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function convertNullValues(): void
{
$filterList = ['VALUES', 'ON DUPLICATE KEY UPDATE', 'SET'];
foreach ($this->statements as $clause => $statement) {
- 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 buildParameters
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function buildParameters(): array
{
$parameters = [];
foreach ($this->parameters as $clauses) {
if ($this->fluent->convertWrite === true) {
- 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 debug
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function debug()
{
if (!empty($this->fluent->debug)) {
if (!is_callable($this->fluent->debug)) {
$backtrace = '';
Function buildQuery
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function buildQuery()
{
if ($this->fluent->convertWrite === true) {
$this->convertNullValues();
}
- 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 quote
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function quote($value)
{
if (!isset($value)) {
return "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
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return (string)$value;
Avoid too many return
statements within this method. Open
return $this->fluent->getPdo()->quote($value);
Function addStatement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addStatement($clause, $statement, $parameters = [])
{
if ($statement === null) {
return $this->resetClause($clause);
}
- 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"