propelorm/Propel2

View on GitHub

Showing 740 of 740 total issues

Function addColumns has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addColumns(Table $table, int $oid): void
    {
        // Get the columns, types, etc.
        // Based on code from pgAdmin3 (http://www.pgadmin.org/)

Severity: Minor
Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 5 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

ColumnMap has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

class ColumnMap
{
    /**
     * Propel type of the column
     *
Severity: Minor
Found in src/Propel/Runtime/Map/ColumnMap.php - About 5 hrs to fix

    File QuickBuilder.php has 388 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Function execute has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output): int
          {
              $configOptions = [];
      
              if ($this->hasInputOption('output-dir', $input)) {
      Severity: Minor
      Found in src/Propel/Generator/Command/MigrationStatusCommand.php - About 5 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 addInitialize has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addInitialize(string &$script): void
          {
              $table = $this->getTable();
              /** @var \Propel\Generator\Platform\DefaultPlatform $platform */
              $platform = $this->getPlatform();
      Severity: Minor
      Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 5 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 getModifyColumnDDL has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getModifyColumnDDL(ColumnDiff $columnDiff): string
          {
              $ret = '';
              $changedProperties = $columnDiff->getChangedProperties();
      
      
      Severity: Minor
      Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 5 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 modifyTable has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public function modifyTable(): void
          {
              $table = $this->getTable();
              $parentTable = $this->getParentTable();
      
      

      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

      ConnectionWrapper has 38 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ConnectionWrapper implements ConnectionInterface, LoggerAwareInterface
      {
          use TransactionTrait;
      
          /**
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 5 hrs to fix

        File Join.php has 373 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

          Function getColumnDDL has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getColumnDDL(Column $col): string
              {
                  $domain = $col->getDomain();
                  $sqlType = $domain->getSqlType();
                  $notNullString = $this->getNullString($col->isNotNull());
          Severity: Minor
          Found in src/Propel/Generator/Platform/MysqlPlatform.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 addCrossFKGet has 122 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addCrossFKGet(string &$script, CrossForeignKeys $crossFKs): void
              {
                  $refFK = $crossFKs->getIncomingForeignKey();
                  $selfRelationName = $this->getFKPhpNameAffix($refFK, 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(string &$script, CrossForeignKeys $crossFKs): void
                {
                    $multipleFks = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$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

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

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

                Method execute has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function execute(InputInterface $input, OutputInterface $output): int
                    {
                        $configOptions = [];
                
                        if ($this->hasInputOption('output-dir', $input)) {
                Severity: Major
                Found in src/Propel/Generator/Command/MigrationUpCommand.php - About 4 hrs to fix

                  Method execute has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output): int
                      {
                          $configOptions = [];
                  
                          if ($this->hasInputOption('output-dir', $input)) {
                  Severity: Major
                  Found in src/Propel/Generator/Command/MigrationMigrateCommand.php - About 4 hrs to fix

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

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

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

                          protected function addAddArrayElement(string &$script, Column $col): void
                          {
                              $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 4 hrs to fix
                      src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 2236..2277

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

                      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 addRemoveArrayElement(string &$script, Column $col): void
                          {
                              $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 4 hrs to fix
                      src/Propel/Generator/Builder/Om/ObjectBuilder.php on lines 2188..2226

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

                      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

                      File SortableBehaviorQueryBuilderModifier.php has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /**
                       * MIT License. This file is part of the Propel package.
                       * For the full copyright and license information, please view the LICENSE

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

                            protected function addHydrateBody(string &$script): void
                            {
                                $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

                        Severity
                        Category
                        Status
                        Source
                        Language