Function getWhereClause
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
private function getWhereClause(
mixed $criteriaValues,
string $names,
string $types,
string $funcType,
- 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 getWhereClause
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getWhereClause(
mixed $criteriaValues,
string $names,
string $types,
string $funcType,
Method generateWhereClause
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function generateWhereClause(): string
{
if (isset($_POST['customWhereClause']) && trim($_POST['customWhereClause']) != '') {
return ' WHERE ' . $_POST['customWhereClause'];
}
Method getWhereClause
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
mixed $criteriaValues,
string $names,
string $types,
string $funcType,
bool $unaryFlag,
Function buildSqlQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildSqlQuery(): string
{
$sqlQuery = 'SELECT ';
// If only distinct values are needed
- 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 generateWhereClause
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function generateWhereClause(): string
{
if (isset($_POST['customWhereClause']) && trim($_POST['customWhereClause']) != '') {
return ' WHERE ' . $_POST['customWhereClause'];
}
- 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 getGeomWhereClause
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
mixed $criteriaValues,
string $names,
string $funcType,
string $types,
string|null $geomFunc = null,
Function getGeomWhereClause
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getGeomWhereClause(
mixed $criteriaValues,
string $names,
string $funcType,
string $types,
- 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 getEnumWhereClause
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getEnumWhereClause(mixed $criteriaValues, string $funcType): string
{
if (! is_array($criteriaValues)) {
$criteriaValues = explode(',', $criteriaValues);
}
- 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"