File CentralColumns.php
has 641 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Database;
Function makeConsistentWithList
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function makeConsistentWithList(
string $db,
array $selectedTables,
): bool|Message {
$message = 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 syncUniqueColumns
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function syncUniqueColumns(
DatabaseName $databaseName,
array $fieldSelect,
bool $isTable = true,
string $containingTable = '',
- 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 deleteColumnsFromList
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function deleteColumnsFromList(
string $database,
array $fieldSelect,
bool $isTable = true,
): bool|Message {
- 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 syncUniqueColumns
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function syncUniqueColumns(
DatabaseName $databaseName,
array $fieldSelect,
bool $isTable = true,
string $containingTable = '',
Method getTemplateVariablesForMain
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTemplateVariablesForMain(
string $db,
int $totalRows,
int $pos,
string $textDir,
Method deleteColumnsFromList
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteColumnsFromList(
string $database,
array $fieldSelect,
bool $isTable = true,
): bool|Message {
CentralColumns
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class CentralColumns
{
/**
* Current user
*/
Function getTemplateVariablesForMain
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getTemplateVariablesForMain(
string $db,
int $totalRows,
int $pos,
string $textDir,
- 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 makeConsistentWithList
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeConsistentWithList(
string $db,
array $selectedTables,
): bool|Message {
$message = true;
Method updateOneColumn
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateOneColumn(
string $db,
string $origColName,
string $colName,
string $colType,
Method getHtmlForEditTableRow
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getHtmlForEditTableRow(array $row, int $rowNum): string
{
$meta = [];
if (! isset($row['col_default']) || $row['col_default'] == '') {
$meta['DefaultType'] = 'NONE';
Method updateOneColumn
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
string $db,
string $origColName,
string $colName,
string $colType,
string $colAttribute,
Method updateMultipleColumn
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateMultipleColumn(array $params): bool|Message
{
$columnDefault = $params['field_default_type'];
$columnIsNull = [];
$columnExtra = [];
Function getHtmlForEditTableRow
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getHtmlForEditTableRow(array $row, int $rowNum): string
{
$meta = [];
if (! isset($row['col_default']) || $row['col_default'] == '') {
$meta['DefaultType'] = 'NONE';
- 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 handleColumnExtra
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function handleColumnExtra(array &$columnsList): void
{
foreach ($columnsList as &$row) {
$vals = explode(',', $row['col_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
Function updateMultipleColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateMultipleColumn(array $params): bool|Message
{
$columnDefault = $params['field_default_type'];
$columnIsNull = [];
$columnExtra = [];
- 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"