propelorm/Propel2

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

Summary

Maintainability
F
1 mo
Test Coverage

File ObjectBuilder.php has 3996 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/ObjectBuilder.php - About 1 wk to fix

    ObjectBuilder has 206 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ObjectBuilder extends AbstractObjectBuilder
    {
    
        /**
         * Returns the package for the base object classes.
    Severity: Major
    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 4 days to fix

      Method addCrossFKGet has 122 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addCrossFKGet(&$script, CrossForeignKeys $crossFKs)
          {
              $refFK = $crossFKs->getIncomingForeignKey();
              $selfRelationName = $this->getFKPhpNameAffix($refFK, $plural = false);
              $crossRefTableName = $crossFKs->getMiddleTable()->getName();
      Severity: Major
      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 4 hrs to fix

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

            protected function addCrossFkScheduledForDeletion(&$script, CrossForeignKeys $crossFKs)
            {
                $multipleFks = 1 < count($crossFKs->getCrossForeignKeys()) || !!$crossFKs->getUnclassifiedPrimaryKeys();
                $scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
                $queryClassName = $this->getNewStubQueryBuilder($crossFKs->getMiddleTable())->getClassname();
        Severity: Major
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 4 hrs to fix

          Method addDoInsertBodyRaw has 118 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addDoInsertBodyRaw()
              {
                  $this->declareClasses(
                      '\Propel\Runtime\Propel',
                      '\PDO'
          Severity: Major
          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 4 hrs to fix

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

                protected function addHydrateBody(&$script)
                {
                    $table = $this->getTable();
                    $platform = $this->getPlatform();
            
            
            Severity: Minor
            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addDoSave has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addDoSave(&$script)
                {
                    $table = $this->getTable();
            
                    $reloadOnUpdate = $table->isReloadOnUpdate();
            Severity: Major
            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 4 hrs to fix

              Function addDoInsertBodyRaw has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function addDoInsertBodyRaw()
                  {
                      $this->declareClasses(
                          '\Propel\Runtime\Propel',
                          '\PDO'
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 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 addSaveBody has 89 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addSaveBody(&$script)
                  {
                      $table = $this->getTable();
                      $reloadOnUpdate = $table->isReloadOnUpdate();
                      $reloadOnInsert = $table->isReloadOnInsert();
              Severity: Major
              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 hrs to fix

                Method addHydrateBody has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addHydrateBody(&$script)
                    {
                        $table = $this->getTable();
                        $platform = $this->getPlatform();
                
                
                Severity: Major
                Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 hrs to fix

                  Function addCrossFkScheduledForDeletion has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addCrossFkScheduledForDeletion(&$script, CrossForeignKeys $crossFKs)
                      {
                          $multipleFks = 1 < count($crossFKs->getCrossForeignKeys()) || !!$crossFKs->getUnclassifiedPrimaryKeys();
                          $scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
                          $queryClassName = $this->getNewStubQueryBuilder($crossFKs->getMiddleTable())->getClassname();
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 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 81 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function addClassBody(&$script)
                      {
                          $this->declareClassFromBuilder($this->getStubObjectBuilder());
                          $this->declareClassFromBuilder($this->getStubQueryBuilder());
                          $this->declareClassFromBuilder($this->getTableMapBuilder());
                  Severity: Major
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 hrs to fix

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

                        protected function addToArray(&$script)
                        {
                            $fks = $this->getTable()->getForeignKeys();
                            $referrers = $this->getTable()->getReferrers();
                            $hasFks = count($fks) > 0 || count($referrers) > 0;
                    Severity: Major
                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

                      Method addCrossFKDoAdd has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function addCrossFKDoAdd(&$script, CrossForeignKeys $crossFKs)
                          {
                              $selfRelationName      = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), $plural = false);
                              $selfRelationNamePlural      = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), $plural = true);
                              $relatedObjectClassName      = $this->getCrossFKsPhpNameAffix($crossFKs, $plural = false);
                      Severity: Major
                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

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

                            protected function addDoSave(&$script)
                            {
                                $table = $this->getTable();
                        
                                $reloadOnUpdate = $table->isReloadOnUpdate();
                        Severity: Minor
                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addFKAccessor has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function addFKAccessor(&$script, ForeignKey $fk)
                            {
                                $table = $this->getTable();
                        
                                $varName = $this->getFKVarName($fk);
                        Severity: Major
                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

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

                              protected function addMutatorCloseBody(&$script, Column $column)
                              {
                                  $table = $this->getTable();
                          
                                  if ($column->isForeignKey()) {
                          Severity: Minor
                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addToArray has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function addToArray(&$script)
                              {
                                  $fks = $this->getTable()->getForeignKeys();
                                  $referrers = $this->getTable()->getReferrers();
                                  $hasFks = count($fks) > 0 || count($referrers) > 0;
                          Severity: Minor
                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addCrossFKCount has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function addCrossFKCount(&$script, CrossForeignKeys $crossFKs)
                              {
                                  $refFK = $crossFKs->getIncomingForeignKey();
                                  $selfRelationName = $this->getFKPhpNameAffix($refFK, $plural = false);
                          
                          
                          Severity: Major
                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

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

                                protected function addCrossFKRemove(&$script, CrossForeignKeys $crossFKs)
                                {
                                    $relCol   = $this->getCrossFKsPhpNameAffix($crossFKs, $plural = true);
                                    if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
                                        $collName = 'combination' . ucfirst($this->getCrossFKsVarName($crossFKs));
                            Severity: Major
                            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

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

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

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

                                    protected function addDoInsertBodyWithIdMethod()
                                    {
                                        $table = $this->getTable();
                                        $script = '';
                                        foreach ($table->getPrimaryKey() as $col) {
                                Severity: Minor
                                Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addLazyLoaderBody has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function addLazyLoaderBody(&$script, Column $column)
                                    {
                                        $platform = $this->getPlatform();
                                        $clo = $column->getLowercasedName();
                                
                                
                                Severity: Major
                                Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

                                  Method addCopyInto has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

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

                                        protected function addCrossFKInit(&$script, CrossForeignKeys $crossFKs)
                                        {
                                            $inits = [];
                                    
                                            if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
                                    Severity: Major
                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

                                      Method addClearAllReferences has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

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

                                        Function getDefaultValueString has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            protected function getDefaultValueString(Column $column)
                                            {
                                                $defaultValue = var_export(null, true);
                                                $val = $column->getPhpDefaultValue();
                                                if (null === $val) {
                                        Severity: Minor
                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addFKAccessor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            protected function addFKAccessor(&$script, ForeignKey $fk)
                                            {
                                                $table = $this->getTable();
                                        
                                                $varName = $this->getFKVarName($fk);
                                        Severity: Minor
                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addFKMutator has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function addFKMutator(&$script, ForeignKey $fk)
                                            {
                                                $table = $this->getTable();
                                                $fkTable = $fk->getForeignTable();
                                        
                                        
                                        Severity: Major
                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

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

                                              protected function addCrossFKCreateQuery(&$script, CrossForeignKeys $crossFKs)
                                              {
                                                  if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
                                                      return;
                                                  }
                                          Severity: Major
                                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

                                            Method addCrossFKSet has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                            Open

                                                protected function addCrossFKSet(&$script, CrossForeignKeys $crossFKs)
                                                {
                                                    $scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
                                            
                                                    $multi = 1 < count($crossFKs->getCrossForeignKeys()) || !!$crossFKs->getUnclassifiedPrimaryKeys();
                                            Severity: Minor
                                            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

                                              Method addSetByPosition has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

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

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

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

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

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

                                                      protected function addHashCode(&$script)
                                                      {
                                                          $script .= "
                                                      /**
                                                       * If the primary key is not null, return the hashcode of the
                                                  Severity: Minor
                                                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                    Method addMutatorCloseBody has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                        protected function addMutatorCloseBody(&$script, Column $column)
                                                        {
                                                            $table = $this->getTable();
                                                    
                                                            if ($column->isForeignKey()) {
                                                    Severity: Minor
                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                      Method addRefFKGet has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                          protected function addRefFKGet(&$script, ForeignKey $refFK)
                                                          {
                                                              $fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
                                                              $relCol = $this->getRefFKPhpNameAffix($refFK, $plural = true);
                                                              $collName = $this->getRefFKCollVarName($refFK);
                                                      Severity: Minor
                                                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

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

                                                            protected function addClassBody(&$script)
                                                            {
                                                                $this->declareClassFromBuilder($this->getStubObjectBuilder());
                                                                $this->declareClassFromBuilder($this->getStubQueryBuilder());
                                                                $this->declareClassFromBuilder($this->getTableMapBuilder());
                                                        Severity: Minor
                                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addDoInsertBodyWithIdMethod has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            protected function addDoInsertBodyWithIdMethod()
                                                            {
                                                                $table = $this->getTable();
                                                                $script = '';
                                                                foreach ($table->getPrimaryKey() as $col) {
                                                        Severity: Minor
                                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                          Method addTemporalMutator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              protected function addTemporalMutator(&$script, Column $col)
                                                              {
                                                                  $clo = $col->getLowercasedName();
                                                          
                                                                  $dateTimeClass = $this->getDateTimeClass($col);
                                                          Severity: Minor
                                                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

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

                                                                protected function getDefaultValueString(Column $column)
                                                                {
                                                                    $defaultValue = var_export(null, true);
                                                                    $val = $column->getPhpDefaultValue();
                                                                    if (null === $val) {
                                                            Severity: Minor
                                                            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                              Method addRefFKRemove has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  protected function addRefFKRemove(&$script, ForeignKey $refFK)
                                                                  {
                                                                      $tblFK = $refFK->getTable();
                                                              
                                                                      $className = $this->getClassNameFromTable($refFK->getTable());
                                                              Severity: Minor
                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                Method addRefFKSet has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                    protected function addRefFKSet(&$script, ForeignKey $refFK)
                                                                    {
                                                                        $relatedName = $this->getRefFKPhpNameAffix($refFK, true);
                                                                        $relatedObjectClassName = $this->getRefFKPhpNameAffix($refFK, false);
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

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

                                                                      protected function addDeleteBody(&$script)
                                                                      {
                                                                          $script .= "
                                                                          if (\$this->isDeleted()) {
                                                                              throw new PropelException(\"This object has already been deleted.\");
                                                                  Severity: Minor
                                                                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                    Function addSaveBody has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        protected function addSaveBody(&$script)
                                                                        {
                                                                            $table = $this->getTable();
                                                                            $reloadOnUpdate = $table->isReloadOnUpdate();
                                                                            $reloadOnInsert = $table->isReloadOnInsert();
                                                                    Severity: Minor
                                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addCrossFKDoAdd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        protected function addCrossFKDoAdd(&$script, CrossForeignKeys $crossFKs)
                                                                        {
                                                                            $selfRelationName      = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), $plural = false);
                                                                            $selfRelationNamePlural      = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), $plural = true);
                                                                            $relatedObjectClassName      = $this->getCrossFKsPhpNameAffix($crossFKs, $plural = false);
                                                                    Severity: Minor
                                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addCrossFKGet has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

                                                                        protected function addCrossFKGet(&$script, CrossForeignKeys $crossFKs)
                                                                        {
                                                                            $refFK = $crossFKs->getIncomingForeignKey();
                                                                            $selfRelationName = $this->getFKPhpNameAffix($refFK, $plural = false);
                                                                            $crossRefTableName = $crossFKs->getMiddleTable()->getName();
                                                                    Severity: Minor
                                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addEnsureConsistency has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                                                    Open

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

                                                                        protected function addCrossFKInit(&$script, CrossForeignKeys $crossFKs)
                                                                        {
                                                                            $inits = [];
                                                                    
                                                                            if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
                                                                    Severity: Minor
                                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addCrossFKAdd has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                        protected function addCrossFKAdd(&$script, CrossForeignKeys $crossFKs)
                                                                        {
                                                                            $refFK = $crossFKs->getIncomingForeignKey();
                                                                    
                                                                            foreach ($crossFKs->getCrossForeignKeys() as $crossFK) {
                                                                    Severity: Minor
                                                                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

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

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

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

                                                                          protected function getCrossRefFKRemoveObjectNames(CrossForeignKeys $crossFKs, ForeignKey $excludeFK)
                                                                          {
                                                                              $names = [];
                                                                      
                                                                              $fks = $crossFKs->getCrossForeignKeys();
                                                                      Severity: Minor
                                                                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addRefFKCount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                          protected function addRefFKCount(&$script, ForeignKey $refFK)
                                                                          {
                                                                              $fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
                                                                              $relCol = $this->getRefFKPhpNameAffix($refFK, $plural = true);
                                                                              $collName = $this->getRefFKCollVarName($refFK);
                                                                      Severity: Minor
                                                                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                        Method addRefFKGetJoinMethods has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                            protected function addRefFKGetJoinMethods(&$script, ForeignKey $refFK)
                                                                            {
                                                                                $table = $this->getTable();
                                                                                $tblFK = $refFK->getTable();
                                                                                $joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
                                                                        Severity: Minor
                                                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                          Method addRemoveArrayElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                              protected function addRemoveArrayElement(&$script, Column $col)
                                                                              {
                                                                                  $clo = $col->getLowercasedName();
                                                                                  $cfc = $col->getPhpName();
                                                                                  $visibility = $col->getAccessorVisibility();
                                                                          Severity: Minor
                                                                          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                            Method addCrossFKIsLoaded has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                            Open

                                                                                protected function addCrossFKIsLoaded(&$script, CrossForeignKeys $crossFKs)
                                                                                {
                                                                                    $inits = [];
                                                                            
                                                                                    if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
                                                                            Severity: Minor
                                                                            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                                                              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/ObjectBuilder.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 addReload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

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

                                                                                  protected function addRefFKGetJoinMethods(&$script, ForeignKey $refFK)
                                                                                  {
                                                                                      $table = $this->getTable();
                                                                                      $tblFK = $refFK->getTable();
                                                                                      $joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addApplyDefaultValuesBody has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addApplyDefaultValuesBody(&$script)
                                                                                  {
                                                                                      $table = $this->getTable();
                                                                                      // FIXME - Apply support for PHP default expressions here
                                                                                      // see: http://propel.phpdb.org/trac/ticket/378
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addLazyLoaderBody has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addLazyLoaderBody(&$script, Column $column)
                                                                                  {
                                                                                      $platform = $this->getPlatform();
                                                                                      $clo = $column->getLowercasedName();
                                                                              
                                                                              
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addColumnAttributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

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

                                                                                  protected function addFKMutator(&$script, ForeignKey $fk)
                                                                                  {
                                                                                      $table = $this->getTable();
                                                                                      $fkTable = $fk->getForeignTable();
                                                                              
                                                                              
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addCrossFKCreateQuery has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addCrossFKCreateQuery(&$script, CrossForeignKeys $crossFKs)
                                                                                  {
                                                                                      if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
                                                                                          return;
                                                                                      }
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 addHashCode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addHashCode(&$script)
                                                                                  {
                                                                                      $script .= "
                                                                                  /**
                                                                                   * If the primary key is not null, return the hashcode of the
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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

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

                                                                                  protected function addHasOnlyDefaultValuesBody(&$script)
                                                                                  {
                                                                                      $table = $this->getTable();
                                                                                      $colsWithDefaults = [];
                                                                                      foreach ($table->getColumns() as $col) {
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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

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

                                                                                  protected function addDoInsert()
                                                                                  {
                                                                                      $table = $this->getTable();
                                                                                      $script = "
                                                                                  /**
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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

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

                                                                                  protected function addCrossFKSet(&$script, CrossForeignKeys $crossFKs)
                                                                                  {
                                                                                      $scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
                                                                              
                                                                                      $multi = 1 < count($crossFKs->getCrossForeignKeys()) || !!$crossFKs->getUnclassifiedPrimaryKeys();
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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

                                                                              Function addTemporalMutator has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addTemporalMutator(&$script, Column $col)
                                                                                  {
                                                                                      $clo = $col->getLowercasedName();
                                                                              
                                                                                      $dateTimeClass = $this->getDateTimeClass($col);
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 25 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 validateModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function validateModel()
                                                                                  {
                                                                                      parent::validateModel();
                                                                              
                                                                                      $table = $this->getTable();
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 25 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 addColumnAttributeComment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addColumnAttributeComment(&$script, Column $column)
                                                                                  {
                                                                                      if ($column->isTemporalType()) {
                                                                                          $cptype = $this->getDateTimeClass($column);
                                                                                      } else {
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 25 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 addCrossFKIsLoaded has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                              Open

                                                                                  protected function addCrossFKIsLoaded(&$script, CrossForeignKeys $crossFKs)
                                                                                  {
                                                                                      $inits = [];
                                                                              
                                                                                      if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 25 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

                                                                                  protected function addRemoveArrayElement(&$script, Column $col)
                                                                                  {
                                                                                      $clo = $col->getLowercasedName();
                                                                                      $cfc = $col->getPhpName();
                                                                                      $visibility = $col->getAccessorVisibility();
                                                                              Severity: Major
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php and 1 other location - About 5 hrs to fix
                                                                              src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 1927..1965

                                                                              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 166.

                                                                              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 addAddArrayElement(&$script, Column $col)
                                                                                  {
                                                                                      $clo = $col->getLowercasedName();
                                                                                      $cfc = $col->getPhpName();
                                                                                      $visibility = $col->getAccessorVisibility();
                                                                              Severity: Major
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php and 1 other location - About 5 hrs to fix
                                                                              src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 1972..2013

                                                                              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 166.

                                                                              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

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

                                                                                      if ($column->getType() === PropelTypes::DATE) {
                                                                                          $defaultfmt = $this->getBuildProperty('generator.dateTime.defaultDateFormat');
                                                                                      } elseif ($column->getType() === PropelTypes::TIME) {
                                                                                          $defaultfmt = $this->getBuildProperty('generator.dateTime.defaultTimeFormat');
                                                                                      } elseif ($column->getType() === PropelTypes::TIMESTAMP) {
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php and 1 other location - About 35 mins to fix
                                                                              src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 834..840

                                                                              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 76.

                                                                              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

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

                                                                                      if ($column->getType() === PropelTypes::DATE) {
                                                                                          $defaultfmt = $this->getBuildProperty('generator.dateTime.defaultDateFormat');
                                                                                      } elseif ($column->getType() === PropelTypes::TIME) {
                                                                                          $defaultfmt = $this->getBuildProperty('generator.dateTime.defaultTimeFormat');
                                                                                      } elseif ($column->getType() === PropelTypes::TIMESTAMP) {
                                                                              Severity: Minor
                                                                              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php and 1 other location - About 35 mins to fix
                                                                              src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 897..903

                                                                              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 76.

                                                                              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