propelorm/Propel2

View on GitHub
src/Propel/Generator/Model/Diff/TableComparator.php

Summary

Maintainability
D
1 day
Test Coverage

Function compareColumns has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function compareColumns(bool $caseInsensitive = false): int
    {
        $fromTableColumns = $this->getFromTable()->getColumns();
        $toTableColumns = $this->getToTable()->getColumns();
        $columnDifferences = 0;
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.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

Function compareForeignKeys has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

    public function compareForeignKeys(bool $caseInsensitive = false): int
    {
        $fkDifferences = 0;
        $fromTableFks = $this->getFromTable()->getForeignKeys();
        $toTableFks = $this->getToTable()->getForeignKeys();
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.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

Function comparePrimaryKeys has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function comparePrimaryKeys(bool $caseInsensitive = false): int
    {
        $pkDifferences = 0;
        $fromTablePk = $this->getFromTable()->getPrimaryKey();
        $toTablePk = $this->getToTable()->getPrimaryKey();
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.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

Function compareIndices has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function compareIndices(bool $caseInsensitive = false): int
    {
        $indexDifferences = 0;
        $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
        $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.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 compareColumns has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function compareColumns(bool $caseInsensitive = false): int
    {
        $fromTableColumns = $this->getFromTable()->getColumns();
        $toTableColumns = $this->getToTable()->getColumns();
        $columnDifferences = 0;
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

    Method compareForeignKeys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function compareForeignKeys(bool $caseInsensitive = false): int
        {
            $fkDifferences = 0;
            $fromTableFks = $this->getFromTable()->getForeignKeys();
            $toTableFks = $this->getToTable()->getForeignKeys();
    Severity: Minor
    Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

      Method comparePrimaryKeys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function comparePrimaryKeys(bool $caseInsensitive = false): int
          {
              $pkDifferences = 0;
              $fromTablePk = $this->getFromTable()->getPrimaryKey();
              $toTablePk = $this->getToTable()->getPrimaryKey();
      Severity: Minor
      Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

        Method compareIndices has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compareIndices(bool $caseInsensitive = false): int
            {
                $indexDifferences = 0;
                $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
                $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());
        Severity: Minor
        Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status