Showing 23 of 23 total issues
Function hasWithWildcard
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public static function hasWithWildcard(
array $array,
string $keys,
bool $searchWithSegment = false,
): bool {
- 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 hasWithWildcard
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function hasWithWildcard(
array $array,
string $keys,
bool $searchWithSegment = false,
): bool {
Function getAllTables
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllTables(
bool $withColumns = true,
?string $connection = null,
): array {
$tables = [];
- 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 transformSqlBinding
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function transformSqlBinding(mixed $binding): float|int|string
{
switch (gettype($binding)) {
case 'boolean':
case 'integer':
Function contains
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function contains(
array $array,
string $needle,
bool $byKey = false,
): bool {
- 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 compileParameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected static function compileParameters(array $parameters): string
{
$compiled = [];
foreach ($parameters as $key => $value) {
- 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 doesMorphedBelongToParent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Model $morphed,
Model $parent,
string $name,
?string $type = null,
?string $id = null,
Method isJson
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
mixed $json,
bool $return = false,
bool $assoc = false,
int $depth = 512,
int $options = 0,
Method does_morphed_model_belong_to_parent
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Model $morphed,
Model $parent,
string $name,
?string $type = null,
?string $id = null,
Method is_json
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
mixed $json,
bool $return = false,
bool $assoc = false,
int $depth = 512,
int $options = 0,
Function hasQueryJoinWith
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function hasQueryJoinWith(object $query, string $with): bool
{
if (method_exists($query, 'getBaseQuery')) {
$baseQuery = $query->getBaseQuery();
} elseif (method_exists($query, 'getQuery')) {
- 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 $binding->format('Y-m-d H:i:s');
Avoid too many return
statements within this method. Open
return self::escapeString((string) $binding);
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return !empty($array);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return self::escapeString((string) $binding);