File ReplicationGui.php
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Functions for the replication GUI
*/
Method getHtmlForReplicaConfiguration
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHtmlForReplicaConfiguration(
string|null $connection,
bool $serverReplicaStatus,
array $serverReplicaReplication,
bool $replicaConfigure,
Method handleControlRequest
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleControlRequest(
bool $srTakeAction,
bool $replicaChangePrimary,
bool $srReplicaServerControl,
string|null $srReplicaAction,
Function handleControlRequest
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function handleControlRequest(
bool $srTakeAction,
bool $replicaChangePrimary,
bool $srReplicaServerControl,
string|null $srReplicaAction,
- 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 handleRequestForReplicaChangePrimary
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleRequestForReplicaChangePrimary(
string $username,
string $pmaPassword,
string $hostname,
int $port,
Method getHtmlForReplicationStatusTable
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHtmlForReplicationStatusTable(
string|null $connection,
string $type,
bool $isHidden = false,
bool $hasTitle = true,
Method getHtmlForReplicationPrimaryAddReplicaUser
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHtmlForReplicationPrimaryAddReplicaUser(string|null $postUsername, string|null $hostname): string
{
[$usernameLength, $hostnameLength] = $this->getUsernameHostnameLength();
$username = '';
Method handleControlRequest
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
bool $srTakeAction,
bool $replicaChangePrimary,
bool $srReplicaServerControl,
string|null $srReplicaAction,
bool $srReplicaSkipError,
Function getHtmlForReplicaConfiguration
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getHtmlForReplicaConfiguration(
string|null $connection,
bool $serverReplicaStatus,
array $serverReplicaReplication,
bool $replicaConfigure,
- 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 getUsernameHostnameLength
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getUsernameHostnameLength(): array
{
$fieldsInfo = DatabaseInterface::getInstance()->getColumns('mysql', 'user');
$usernameLength = 16;
$hostnameLength = 41;
- 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 getHtmlForReplicationStatusTable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getHtmlForReplicationStatusTable(
string|null $connection,
string $type,
bool $isHidden = false,
bool $hasTitle = true,
- 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 handleRequestForReplicaChangePrimary
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleRequestForReplicaChangePrimary(
string $username,
string $pmaPassword,
string $hostname,
int $port,
- 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 getHtmlForPrimaryReplication
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string|null $connection,
bool $hasReplicaClearScreen,
string|null $primaryAddUser,
string|null $username,
string|null $hostname,
Function getHtmlForReplicationPrimaryAddReplicaUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getHtmlForReplicationPrimaryAddReplicaUser(string|null $postUsername, string|null $hostname): string
{
[$usernameLength, $hostnameLength] = $this->getUsernameHostnameLength();
$username = '';
- 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"