propelorm/Propel2

View on GitHub

Showing 690 of 740 total issues

TableDiff has 69 functions (exceeds 20 allowed). Consider refactoring.
Open

class TableDiff
{
    /**
     * The first Table object.
     *
Severity: Major
Found in src/Propel/Generator/Model/Diff/TableDiff.php - About 1 day to fix

    ForeignKey has 68 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ForeignKey extends MappingModel
    {
        /**
         * These constants are the uppercase equivalents of the onDelete / onUpdate
         * values in the schema definition.
    Severity: Major
    Found in src/Propel/Generator/Model/ForeignKey.php - About 1 day to fix

      File PgsqlPlatform.php has 569 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: Major
      Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 day to fix

        Function execute has a Cognitive Complexity of 61 (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/MigrationMigrateCommand.php - About 1 day 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

        Database has 59 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Database extends ScopedMappingModel
        {
            use BehaviorableTrait;
        
            /**
        Severity: Major
        Found in src/Propel/Generator/Model/Database.php - About 1 day to fix

          File TableDiff.php has 518 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: Major
          Found in src/Propel/Generator/Model/Diff/TableDiff.php - About 1 day to fix

            File ForeignKey.php has 516 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: Major
            Found in src/Propel/Generator/Model/ForeignKey.php - About 1 day to fix

              NestedSetBehaviorObjectBuilderModifier has 58 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class NestedSetBehaviorObjectBuilderModifier
              {
                  /**
                   * @var \Propel\Generator\Behavior\NestedSet\NestedSetBehavior
                   */

                File Database.php has 513 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: Major
                Found in src/Propel/Generator/Model/Database.php - About 1 day to fix

                  File SortableBehaviorObjectBuilderModifier.php has 512 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

                    File VersionableBehaviorObjectBuilderModifier.php has 512 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 execute has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                      Open

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

                          public function isUnique(array $keys): bool
                          {
                              if (count($keys) === 1) {
                                  $column = $keys[0] instanceof Column ? $keys[0] : $this->getColumn($keys[0]);
                                  if ($column) {
                      Severity: Minor
                      Found in src/Propel/Generator/Model/Table.php - About 7 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

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

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

                        TableMap has 52 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class TableMap
                        {
                            /**
                             * phpname type
                             * e.g. 'AuthorId'
                        Severity: Major
                        Found in src/Propel/Runtime/Map/TableMap.php - About 7 hrs to fix

                          AbstractOMBuilder has 51 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          abstract class AbstractOMBuilder extends DataModelBuilder
                          {
                              use PathTrait;
                          
                              /**
                          Severity: Major
                          Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 7 hrs to fix

                            MysqlPlatform has 50 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class MysqlPlatform extends DefaultPlatform
                            {
                                /**
                                 * @var string
                                 */
                            Severity: Minor
                            Found in src/Propel/Generator/Platform/MysqlPlatform.php - About 7 hrs to fix

                              File PgsqlSchemaParser.php has 457 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/Reverse/PgsqlSchemaParser.php - About 7 hrs to fix

                                Function addForeignKeys has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function addForeignKeys(Table $table): void
                                    {
                                        $database = $table->getDatabase();
                                
                                        $dataFetcher = $this->dbh->query(sprintf('SHOW CREATE TABLE %s', $this->getPlatform()->doQuoting($table->getName())));
                                Severity: Minor
                                Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 6 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 startElement has 171 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function startElement($parser, string $tagName, array $attributes): void
                                    {
                                        $parentTag = $this->peekCurrentSchemaTag();
                                        if ($parentTag === false) {
                                            switch ($tagName) {
                                Severity: Major
                                Found in src/Propel/Generator/Builder/Util/SchemaReader.php - About 6 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language