File Generator.php
has 741 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* HTML Generator
*/
Method getMessage
has 183 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getMessage(
Message|string $message,
string|null $sqlQuery = null,
MessageType $type = MessageType::Notice,
): string {
Function getMessage
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public static function getMessage(
Message|string $message,
string|null $sqlQuery = null,
MessageType $type = MessageType::Notice,
): 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 linkOrButton
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public static function linkOrButton(
string $urlPath,
array|null $urlParams,
string $message,
string|array $tagParams = [],
- 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 mysqlDie
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function mysqlDie(
string $serverMessage = '',
string $sqlQuery = '',
bool $isModifyLink = true,
string $backUrl = '',
Function mysqlDie
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function mysqlDie(
string $serverMessage = '',
string $sqlQuery = '',
bool $isModifyLink = true,
string $backUrl = '',
- 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 linkOrButton
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function linkOrButton(
string $urlPath,
array|null $urlParams,
string $message,
string|array $tagParams = [],
Function getSupportedDatatypes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getSupportedDatatypes(string $selected): string
{
// NOTE: the SELECT tag is not included in this snippet.
$retval = '';
- 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 getDefaultFunctionForField
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getDefaultFunctionForField(
string $trueType,
bool $firstTimestamp,
string|null $defaultValue,
string $extra,
Method getSupportedDatatypes
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getSupportedDatatypes(string $selected): string
{
// NOTE: the SELECT tag is not included in this snippet.
$retval = '';
Function getDefaultFunctionForField
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function getDefaultFunctionForField(
string $trueType,
bool $firstTimestamp,
string|null $defaultValue,
string $extra,
- 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 getListNavigator
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
int $count,
int $pos,
array $urlParams,
string $script,
string $frame,
Method getDefaultFunctionForField
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
string $trueType,
bool $firstTimestamp,
string|null $defaultValue,
string $extra,
bool $isNull,
Method linkOrButton
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $urlPath,
array|null $urlParams,
string $message,
string|array $tagParams = [],
string $target = '',
Consider simplifying this complex logical expression. Open
if (
$trueType === 'timestamp'
&& $firstTimestamp
&& ($defaultValue === null || $defaultValue === '')
&& $extra !== 'on update CURRENT_TIMESTAMP'
Method getIcon
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $icon,
string $alternate = '',
bool $forceText = false,
bool $menuIcon = false,
string $controlParam = 'ActionLinksMode',
Method mysqlDie
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $serverMessage = '',
string $sqlQuery = '',
bool $isModifyLink = true,
string $backUrl = '',
bool $exit = true,
Function getStartAndNumberOfRowsFieldsetData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getStartAndNumberOfRowsFieldsetData(string $sqlQuery): array
{
if (isset($_REQUEST['session_max_rows'])) {
$rows = (int) $_REQUEST['session_max_rows'];
} elseif (isset($_SESSION['tmpval']['max_rows']) && $_SESSION['tmpval']['max_rows'] !== 'all') {
- 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 getServerSSL
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getServerSSL(): string
{
$config = Config::getInstance();
$server = $config->selectedServer;
$class = 'text-danger';
- 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 getIcon
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getIcon(
string $icon,
string $alternate = '',
bool $forceText = false,
bool $menuIcon = false,
- 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 getImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getImage(string $image, string $alternate = '', array $attributes = []): string
{
$alternate = htmlspecialchars($alternate);
if (isset($attributes['class'])) {
- 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"