propelorm/Propel2

View on GitHub
src/Propel/Generator/Builder/Om/QueryBuilder.php

Summary

Maintainability
F
1 wk
Test Coverage

File QueryBuilder.php has 1128 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: Major
Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 days to fix

    QueryBuilder has 53 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class QueryBuilder extends AbstractOMBuilder
    {
        /**
         * Returns the package for the [base] object classes.
         *
    Severity: Major
    Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 7 hrs to fix

      Method addFilterByCol has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addFilterByCol(&$script, Column $col)
          {
              $colPhpName = $col->getPhpName();
              $colName = $col->getName();
              $variableName = $col->getCamelCaseName();
      Severity: Major
      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 5 hrs to fix

        Method addFindPkSimple has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function addFindPkSimple(&$script)
            {
                $table = $this->getTable();
        
                // this method is not needed if the table has no primary key
        Severity: Major
        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 hrs to fix

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

              protected function addFilterByCol(&$script, Column $col)
              {
                  $colPhpName = $col->getPhpName();
                  $colName = $col->getName();
                  $variableName = $col->getCamelCaseName();
          Severity: Minor
          Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addClassBody has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addClassBody(&$script)
              {
                  $table = $this->getTable();
          
                  // namespaces
          Severity: Major
          Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 hrs to fix

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

                protected function addFilterByFk(&$script, $fk)
                {
                    $this->declareClasses(
                        '\Propel\Runtime\Collection\ObjectCollection',
                        '\Propel\Runtime\Exception\PropelException'
            Severity: Major
            Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 hrs to fix

              Method addFilterByRefFk has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addFilterByRefFk(&$script, ForeignKey $fk)
                  {
                      $this->declareClasses(
                          '\Propel\Runtime\Collection\ObjectCollection',
                          '\Propel\Runtime\Exception\PropelException'
              Severity: Major
              Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 hrs to fix

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

                    protected function addFindPkSimple(&$script)
                    {
                        $table = $this->getTable();
                
                        // this method is not needed if the table has no primary key
                Severity: Minor
                Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addFindPk has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addFindPk(&$script)
                    {
                        $class = $this->getObjectClassName();
                        $tableMapClassName = $this->getTableMapClassName();
                        $table = $this->getTable();
                Severity: Minor
                Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                  Method addFilterByPrimaryKeys has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function addFilterByPrimaryKeys(&$script)
                      {
                          $script .= "
                      /**
                       * Filter the query by a list of primary keys
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                    Method addPrune has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function addPrune(&$script)
                        {
                            $table = $this->getTable();
                            $class = $this->getObjectClassName();
                            $objectName = '$' . $table->getCamelCaseName();
                    Severity: Minor
                    Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                      Method addDoOnDeleteSetNull has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function addDoOnDeleteSetNull(&$script)
                          {
                              $table = $this->getTable();
                              $script .= "
                          /**
                      Severity: Minor
                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                        Method addDoOnDeleteCascade has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function addDoOnDeleteCascade(&$script)
                            {
                                $table = $this->getTable();
                                $script .= "
                            /**
                        Severity: Minor
                        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                          Function addClassBody has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function addClassBody(&$script)
                              {
                                  $table = $this->getTable();
                          
                                  // namespaces
                          Severity: Minor
                          Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addDelete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function addDelete(&$script)
                              {
                                  $script .= "
                              /**
                               * Performs a DELETE on the database based on the current ModelCriteria
                          Severity: Minor
                          Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                            Method addFilterByPrimaryKey has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function addFilterByPrimaryKey(&$script)
                                {
                                    $script .= "
                                /**
                                 * Filter the query by primary key
                            Severity: Minor
                            Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                              Method addFindPks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function addFindPks(&$script)
                                  {
                                      $this->declareClasses(
                                          '\Propel\Runtime\Collection\ObjectCollection',
                                          '\Propel\Runtime\Connection\ConnectionInterface',
                              Severity: Minor
                              Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                                Method addFilterByArrayCol has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function addFilterByArrayCol(&$script, Column $col)
                                    {
                                        $colPhpName = $col->getPhpName();
                                        $singularPhpName = $col->getPhpSingularName();
                                        $colName = $col->getName();
                                Severity: Minor
                                Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                                  Function addDoOnDeleteSetNull has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function addDoOnDeleteSetNull(&$script)
                                      {
                                          $table = $this->getTable();
                                          $script .= "
                                      /**
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addDoOnDeleteCascade has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function addDoOnDeleteCascade(&$script)
                                      {
                                          $table = $this->getTable();
                                          $script .= "
                                      /**
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addFilterByFk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function addFilterByFk(&$script, $fk)
                                      {
                                          $this->declareClasses(
                                              '\Propel\Runtime\Collection\ObjectCollection',
                                              '\Propel\Runtime\Exception\PropelException'
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 55 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 addFindPk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function addFindPk(&$script)
                                      {
                                          $class = $this->getObjectClassName();
                                          $tableMapClassName = $this->getTableMapClassName();
                                          $table = $this->getTable();
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 55 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 addClassOpen has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function addClassOpen(&$script)
                                      {
                                          $table = $this->getTable();
                                          $tableName = $table->getName();
                                          $tableDesc = $table->getDescription();
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 55 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 isDeleteSetNullEmulationNeeded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function isDeleteSetNullEmulationNeeded()
                                      {
                                          $table = $this->getTable();
                                          if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
                                              foreach ($table->getReferrers() as $fk) {
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.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

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

                                      protected function isDeleteCascadeEmulationNeeded()
                                      {
                                          $table = $this->getTable();
                                          if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
                                              foreach ($table->getReferrers() as $fk) {
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.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

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

                                      protected function addFilterByPrimaryKeys(&$script)
                                      {
                                          $script .= "
                                      /**
                                       * Filter the query by a list of primary keys
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.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

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

                                      protected function addJoinRelated(&$script, $fkTable, $queryClass, $relationName, $joinType)
                                  Severity: Minor
                                  Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 35 mins to fix

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

                                        protected function addUseRelatedQuery(&$script, Table $fkTable, $queryClass, $relationName, $joinType)
                                    Severity: Minor
                                    Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 35 mins to fix

                                      Function addFilterByRefFk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                          protected function addFilterByRefFk(&$script, ForeignKey $fk)
                                          {
                                              $this->declareClasses(
                                                  '\Propel\Runtime\Collection\ObjectCollection',
                                                  '\Propel\Runtime\Exception\PropelException'
                                      Severity: Minor
                                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 35 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

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                              foreach ($this->getTable()->getReferrers() as $refFK) {
                                                  $relationName = $this->getRefFKPhpNameAffix($refFK);
                                      
                                                  $script .= "
                                       * @method     $queryClass leftJoin" . $relationName . "(\$relationAlias = null) Adds a LEFT JOIN clause to the query using the " . $relationName . " relation
                                      Severity: Major
                                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php and 1 other location - About 1 day to fix
                                      src/Propel/Generator/Builder/Om/QueryBuilder.php on lines 130..150

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 208.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                              foreach ($this->getTable()->getForeignKeys() as $fk) {
                                                  $relationName = $this->getFKPhpNameAffix($fk);
                                      
                                                  $script .= "
                                       * @method     $queryClass leftJoin" . $relationName . "(\$relationAlias = null) Adds a LEFT JOIN clause to the query using the " . $relationName . " relation
                                      Severity: Major
                                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php and 1 other location - About 1 day to fix
                                      src/Propel/Generator/Builder/Om/QueryBuilder.php on lines 151..171

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 208.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                          protected function isDeleteCascadeEmulationNeeded()
                                          {
                                              $table = $this->getTable();
                                              if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
                                                  foreach ($table->getReferrers() as $fk) {
                                      Severity: Major
                                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php and 1 other location - About 1 hr to fix
                                      src/Propel/Generator/Builder/Om/QueryBuilder.php on lines 355..367

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 88.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      Similar blocks of code found in 2 locations. Consider refactoring.
                                      Open

                                          protected function isDeleteSetNullEmulationNeeded()
                                          {
                                              $table = $this->getTable();
                                              if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
                                                  foreach ($table->getReferrers() as $fk) {
                                      Severity: Major
                                      Found in src/Propel/Generator/Builder/Om/QueryBuilder.php and 1 other location - About 1 hr to fix
                                      src/Propel/Generator/Builder/Om/QueryBuilder.php on lines 337..349

                                      Duplicated Code

                                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                      Tuning

                                      This issue has a mass of 88.

                                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                      Refactorings

                                      Further Reading

                                      There are no issues that match your filters.

                                      Category
                                      Status