phpmyadmin/phpmyadmin

View on GitHub
src/Plugins/Export/ExportXml.php

Summary

Maintainability
D
2 days
Test Coverage

Function exportHeader has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
Open

    public function exportHeader(): bool
    {
        $this->setTable(Current::$table);

        $table = $this->getTable();
Severity: Minor
Found in src/Plugins/Export/ExportXml.php - About 5 hrs 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

Method exportHeader has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function exportHeader(): bool
    {
        $this->setTable(Current::$table);

        $table = $this->getTable();
Severity: Major
Found in src/Plugins/Export/ExportXml.php - About 4 hrs to fix

    File ExportXml.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    declare(strict_types=1);
    
    namespace PhpMyAdmin\Plugins\Export;
    Severity: Minor
    Found in src/Plugins/Export/ExportXml.php - About 4 hrs to fix

      Function exportData has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function exportData(
              string $db,
              string $table,
              string $errorUrl,
              string $sqlQuery,
      Severity: Minor
      Found in src/Plugins/Export/ExportXml.php - About 2 hrs 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

      Method setProperties has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function setProperties(): ExportPluginProperties
          {
              // create the export plugin property item
              $exportPluginProperties = new ExportPluginProperties();
              $exportPluginProperties->setText('XML');
      Severity: Major
      Found in src/Plugins/Export/ExportXml.php - About 2 hrs to fix

        Method exportData has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function exportData(
                string $db,
                string $table,
                string $errorUrl,
                string $sqlQuery,
        Severity: Minor
        Found in src/Plugins/Export/ExportXml.php - About 1 hr to fix

          Method exportData has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  string $db,
                  string $table,
                  string $errorUrl,
                  string $sqlQuery,
                  array $aliases = [],
          Severity: Minor
          Found in src/Plugins/Export/ExportXml.php - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status