phpmyadmin/phpmyadmin

View on GitHub

Showing 2,002 of 2,002 total issues

Function display has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function display(OutputInterface $output, SymfonyStyle $io, array $filesInfo): int
    {
        $errors = 0;

        foreach ($filesInfo as $info) {
Severity: Minor
Found in src/Command/TwigLintCommand.php - About 25 mins to fix

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 handleNHibernateXMLBody has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function handleNHibernateXMLBody(
        string $db,
        string $table,
        array $aliases = [],
    ): string {
Severity: Minor
Found in src/Plugins/Export/ExportCodegen.php - About 25 mins to fix

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 = [];
Severity: Minor
Found in src/Database/CentralColumns.php - About 25 mins to fix

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 getErrorMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getErrorMessage(AuthenticationFailure $failure): string
    {
        if ($failure->failureType === AuthenticationFailure::NO_ACTIVITY) {
            return sprintf($failure->getMessage(), (int) Config::getInstance()->settings['LoginCookieValidity']);
        }
Severity: Minor
Found in src/Plugins/AuthenticationPlugin.php - About 25 mins to fix

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 validateTableAndLoadFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function validateTableAndLoadFields(): void
    {
        $sql = 'DESCRIBE ' . Util::backquote($this->tableName);
        $dbi = DatabaseInterface::getInstance();
        $result = $dbi->tryQuery($sql);
Severity: Minor
Found in src/Plugins/Schema/TableStats.php - About 25 mins to fix

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 setCookieParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setCookieParams(array|null $sessionCookieParams = null): void
    {
        /* Session cookie params from config */
        $sessionCookieParams ??= Config::getInstance()->selectedServer['SignonCookieParams'];

Severity: Minor
Found in src/Plugins/Auth/AuthenticationSignon.php - About 25 mins to fix

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 removeRelation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeRelation(string $t1, string $f1, string $t2, string $f2): array
    {
        [$db1, $t1] = explode('.', $t1);
        [$db2, $t2] = explode('.', $t2);

Severity: Minor
Found in src/Database/Designer/Common.php - About 25 mins to fix

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 getAllKeys has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAllKeys(array $designerTables): array
    {
        $keys = [];

        foreach ($designerTables as $designerTable) {
Severity: Minor
Found in src/Database/Designer/Common.php - About 25 mins to fix

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 loadCoordinates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadCoordinates(): void
    {
        if (! isset($_POST['t_h']) || ! is_array($_POST['t_h'])) {
            return;
        }
Severity: Minor
Found in src/Plugins/Schema/TableStats.php - About 25 mins to fix

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 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;
Severity: Minor
Found in src/Server/Status/Monitor.php - About 25 mins to fix

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 previewSQL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function previewSQL(array|string $queryData): void
    {
        $retval = '<div class="preview_sql">';
        if ($queryData === '' || $queryData === []) {
            $retval .= __('No change');
Severity: Minor
Found in src/Core.php - About 25 mins to fix

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 getMime has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getMime(string $db, string $table, bool $strict = false, bool $fullName = false): array|null
    {
        $dbi = DatabaseInterface::getInstance();
        $relation = new Relation($dbi);
        $browserTransformationFeature = $relation->getRelationParameters()->browserTransformationFeature;
Severity: Minor
Found in src/Transformations.php - About 25 mins to fix

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 checkTokenRequestParam has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkTokenRequestParam(): void
    {
        $GLOBALS['token_mismatch'] = true;
        $GLOBALS['token_provided'] = false;

Severity: Minor
Found in src/Http/Middleware/TokenRequestParamChecking.php - About 25 mins to fix

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,
Severity: Minor
Found in src/Server/Status/Monitor.php - About 25 mins to fix

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 replaceDocLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function replaceDocLink(array $found): string
    {
        if (count($found) >= 4) {
            /* doc@page@anchor pattern */
            $page = $found[1];
Severity: Minor
Found in src/Sanitize.php - About 25 mins to fix

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 table has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function table(string $db, string $table): void
    {
        $relationParameters = $this->relation->getRelationParameters();
        $columnCommentsFeature = $relationParameters->columnCommentsFeature;
        $displayFeature = $relationParameters->displayFeature;
Severity: Minor
Found in src/ConfigStorage/RelationCleanup.php - About 25 mins to fix

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 getOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOptions(
        string $exportType,
        string $db,
        string $table,
        string $sqlQuery,
Severity: Minor
Found in src/Export/Options.php - About 25 mins to fix

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 getPostParams has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getPostParams(string $exportType): array
    {
        $postParams = $_POST;

        // Convert the multiple select elements from an array to a string
Severity: Minor
Found in src/Export/Export.php - About 25 mins to fix

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 getColumnCreationStatements has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getColumnCreationStatements(bool $isCreateTable = true): string
    {
        $sqlStatement = '';
        [
            $fieldCount,
Severity: Minor
Found in src/CreateAddField.php - About 25 mins to fix

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 setNavigationTreeTableSeparator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function setNavigationTreeTableSeparator(array $settings): false|string|array
    {
        if (! isset($settings['NavigationTreeTableSeparator'])) {
            return '__';
        }
Severity: Minor
Found in src/Config/Settings.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language