File class.databasestatement.php
has 394 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
DatabaseStatement
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class DatabaseStatement
{
/**
* List of element delimiter
* @var string
Method asTickedString
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function asTickedString($value, $alias = null)
{
if (!$value) {
return '';
}
Function splitFunctionArguments
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
final public function splitFunctionArguments($arguments)
{
General::ensureType([
'arguments' => ['var' => $arguments, 'type' => 'string'],
]);
- 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 asTickedString
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
final public function asTickedString($value, $alias = null)
{
if (!$value) {
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
Function generateOrderedSQLParts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
final public function generateOrderedSQLParts()
{
$allParts = $this->getStatementStructure();
$orderedParts = [];
foreach ($allParts as $ti => $type) {
- 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 appendValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
final protected function appendValues(array $values)
{
if ($this->isUsingPlaceholders()) {
$values = array_values($values);
} else {
- 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 splitFunctionArguments
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function splitFunctionArguments($arguments)
{
General::ensureType([
'arguments' => ['var' => $arguments, 'type' => 'string'],
]);
Avoid too many return
statements within this method. Open
return "($value) AS $alias";
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return $this->asTickedList(explode(self::VALUES_DELIMITER, $value));
Avoid too many return
statements within this method. Open
return $fxCall;
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return $value;
Avoid too many return
statements within this method. Open
return "$value AS $alias";
Avoid too many return
statements within this method. Open
return $ip === -1 ? $this->asTickedString($p) : "$ip";