propelorm/Propel2

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

Summary

Maintainability
D
2 days
Test Coverage

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

    private function appendTableNode(Table $table, \DOMNode $parentNode)
    {
        $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

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

<?php

/**
 * 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

    Method appendTableNode has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

          private function appendColumnNode(Column $column, \DOMNode $parentNode)
          {
              $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 appendColumnNode has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function appendColumnNode(Column $column, \DOMNode $parentNode)
          {
              $columnNode = $parentNode->appendChild($this->document->createElement('column'));
              $columnNode->setAttribute('name', $column->getName());
      
      
      Severity: Minor
      Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr to fix

        Method appendDatabaseNode has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function appendDatabaseNode(Database $database, \DOMNode $parentNode)
            {
                $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
                $databaseNode->setAttribute('name', $database->getName());
                $databaseNode->setAttribute('defaultIdMethod', $database->getDefaultIdMethod());
        Severity: Minor
        Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr to fix

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

              private function appendDatabaseNode(Database $database, \DOMNode $parentNode)
              {
                  $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
                  $databaseNode->setAttribute('name', $database->getName());
                  $databaseNode->setAttribute('defaultIdMethod', $database->getDefaultIdMethod());
          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 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function appendForeignKeyNode(ForeignKey $foreignKey, \DOMNode $parentNode)
              {
                  $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)
                {
                    $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