File Monitor.php
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* functions for displaying server status sub item: monitor
*/
Method getJsonForLogDataTypeGeneral
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJsonForLogDataTypeGeneral(
int $start,
int $end,
bool $isTypesLimited,
bool $removeVariables,
Function getJsonForLogDataTypeGeneral
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getJsonForLogDataTypeGeneral(
int $start,
int $end,
bool $isTypesLimited,
bool $removeVariables,
- 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 getJsonForLogDataTypeSlow
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJsonForLogDataTypeSlow(int $start, int $end): array|null
{
$query = 'SELECT start_time, user_host, ';
$query .= 'Sec_to_Time(Sum(Time_to_Sec(query_time))) as query_time, ';
$query .= 'Sec_to_Time(Sum(Time_to_Sec(lock_time))) as lock_time, ';
Function getJsonForChartingDataSwitch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getJsonForChartingDataSwitch(
string $type,
string $pName,
array $serverVars,
array $statusVars,
- 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 getJsonForChartingDataSwitch
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getJsonForChartingDataSwitch(
string $type,
string $pName,
array $serverVars,
array $statusVars,
Method getJsonForChartingData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJsonForChartingData(string $requiredData): array
{
$ret = json_decode($requiredData, true);
$statusVars = [];
$serverVars = [];
Method getJsonForQueryAnalyzer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJsonForQueryAnalyzer(
string $database,
string $query,
): array {
$GLOBALS['cached_affected_rows'] ??= null;
Method getJsonForChartingDataSwitch
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
string $type,
string $pName,
array $serverVars,
array $statusVars,
array $ret,
Function getJsonForChartingDataSet
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getJsonForChartingDataSet(
array $ret,
array $statusVarValues,
array $serverVarValues,
): array {
- 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 getJsonForLogDataTypeSlow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getJsonForLogDataTypeSlow(int $start, int $end): array|null
{
$query = 'SELECT start_time, user_host, ';
$query .= 'Sec_to_Time(Sum(Time_to_Sec(query_time))) as query_time, ';
$query .= 'Sec_to_Time(Sum(Time_to_Sec(lock_time))) as lock_time, ';
- 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 getJsonForChartingDataGet
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array $ret,
array $serverVars,
array $statusVars,
mixed $sysinfo,
mixed $cpuload,
Function getJsonForQueryAnalyzer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getJsonForQueryAnalyzer(
string $database,
string $query,
): array {
$GLOBALS['cached_affected_rows'] ??= 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
Function getJsonForChartingDataGet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getJsonForChartingDataGet(
array $ret,
array $serverVars,
array $statusVars,
mixed $sysinfo,
- 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"