Function readCredentials
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public function readCredentials(): bool
{
$GLOBALS['conn_error'] ??= null;
// Initialization
- 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
File AuthenticationCookie.php
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Cookie Authentication plugin for phpMyAdmin
*/
Method readCredentials
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readCredentials(): bool
{
$GLOBALS['conn_error'] ??= null;
// Initialization
Method showLoginForm
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showLoginForm(): Response
{
$GLOBALS['conn_error'] ??= null;
$responseRenderer = ResponseRenderer::getInstance();
Function showLoginForm
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function showLoginForm(): Response
{
$GLOBALS['conn_error'] ??= null;
$responseRenderer = ResponseRenderer::getInstance();
- 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 storeCredentials
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function storeCredentials(): bool
{
$config = Config::getInstance();
if ($config->settings['AllowArbitraryServer'] && ! empty($GLOBALS['pma_auth_server'])) {
/* Allow to specify 'host 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
Function logOut
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function logOut(): void
{
$config = Config::getInstance();
// -> delete password cookie(s)
if ($config->settings['LoginCookieDeleteAll']) {
- 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 rememberCredentials
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rememberCredentials(): Response|null
{
// Name and password cookies need to be refreshed each time
// Duration = one month for username
$this->storeUsernameCookie($this->user);
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
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 true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;