Function doImport
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
public function doImport(File|null $importHandle = null): array
{
$GLOBALS['error'] ??= null;
$sqlStatements = [];
- 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 doImport
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doImport(File|null $importHandle = null): array
{
$GLOBALS['error'] ??= null;
$sqlStatements = [];
Function delimiterReplace
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function delimiterReplace(string $replace, string $subject): string
{
// String that will be returned
$cleaned = '';
// Possible states of current character
- 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 ImportMediawiki.php
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MediaWiki import plugin for phpMyAdmin
*/
Method delimiterReplace
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function delimiterReplace(string $replace, string $subject): string
{
// String that will be returned
$cleaned = '';
// Possible states of current character
Function importDataOneTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function importDataOneTable(ImportTable $table, array &$sqlStatements): void
{
if ($this->analyze) {
// Set the table name
if ($table->tableName === '') {
- 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"