propelorm/Propel2

View on GitHub
src/Propel/Generator/Schema/Dumper/XmlDumper.php

Summary

Maintainability
D
2 days
Test Coverage

File XmlDumper.php has 367 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * MIT License. This file is part of the Propel package.
 * For the full copyright and license information, please view the LICENSE
Severity: Minor
Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 4 hrs to fix

    Function appendTableNode has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
    Open

        private function appendTableNode(Table $table, DOMNode $parentNode): void
        {
            /** @var \DOMElement $tableNode */
            $tableNode = $parentNode->appendChild($this->document->createElement('table'));
            $tableNode->setAttribute('name', $table->getCommonName());
    Severity: Minor
    Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 4 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 appendTableNode has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function appendTableNode(Table $table, DOMNode $parentNode): void
        {
            /** @var \DOMElement $tableNode */
            $tableNode = $parentNode->appendChild($this->document->createElement('table'));
            $tableNode->setAttribute('name', $table->getCommonName());
    Severity: Major
    Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 4 hrs to fix

      Function appendColumnNode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          private function appendColumnNode(Column $column, DOMNode $parentNode): void
          {
              /** @var \DOMElement $columnNode */
              $columnNode = $parentNode->appendChild($this->document->createElement('column'));
              $columnNode->setAttribute('name', $column->getName());
      Severity: Minor
      Found in src/Propel/Generator/Schema/Dumper/XmlDumper.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 appendDatabaseNode has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function appendDatabaseNode(Database $database, DOMNode $parentNode): void
          {
              /** @var \DOMElement $databaseNode */
              $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
              $databaseNode->setAttribute('name', $database->getName());
      Severity: Major
      Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 2 hrs to fix

        Method appendColumnNode has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function appendColumnNode(Column $column, DOMNode $parentNode): void
            {
                /** @var \DOMElement $columnNode */
                $columnNode = $parentNode->appendChild($this->document->createElement('column'));
                $columnNode->setAttribute('name', $column->getName());
        Severity: Major
        Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 2 hrs to fix

          Function appendDatabaseNode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              private function appendDatabaseNode(Database $database, DOMNode $parentNode): void
              {
                  /** @var \DOMElement $databaseNode */
                  $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
                  $databaseNode->setAttribute('name', $database->getName());
          Severity: Minor
          Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr 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 appendForeignKeyNode has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function appendForeignKeyNode(ForeignKey $foreignKey, DOMNode $parentNode): void
              {
                  /** @var \DOMElement $foreignKeyNode */
                  $foreignKeyNode = $parentNode->appendChild($this->document->createElement('foreign-key'));
                  $foreignKeyNode->setAttribute('foreignTable', $foreignKey->getForeignTableCommonName());
          Severity: Minor
          Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr to fix

            Function appendForeignKeyNode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private function appendForeignKeyNode(ForeignKey $foreignKey, DOMNode $parentNode): void
                {
                    /** @var \DOMElement $foreignKeyNode */
                    $foreignKeyNode = $parentNode->appendChild($this->document->createElement('foreign-key'));
                    $foreignKeyNode->setAttribute('foreignTable', $foreignKey->getForeignTableCommonName());
            Severity: Minor
            Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 45 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

            There are no issues that match your filters.

            Category
            Status