propelorm/Propel2

View on GitHub

Showing 690 of 740 total issues

File SqlitePlatform.php has 381 lines of code (exceeds 250 allowed). Consider refactoring.
Open

Severity: Minor
Found in src/Propel/Generator/Platform/SqlitePlatform.php - About 5 hrs to fix

    File MysqlSchemaParser.php has 379 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/MysqlSchemaParser.php - About 5 hrs to fix

      Function getColumnFromRow has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getColumnFromRow(array $row, Table $table): Column
          {
              $name = $row['Field'];
              $isNullable = ($row['Null'] === 'YES');
              $autoincrement = (strpos($row['Extra'], 'auto_increment') !== false);
      Severity: Minor
      Found in src/Propel/Generator/Reverse/MysqlSchemaParser.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

      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

      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

        Function addColumns has a Cognitive Complexity of 33 (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 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

        Function execute has a Cognitive Complexity of 33 (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 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 Join.php has 368 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

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

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

                Function convert has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function convert(array $c): string
                    {
                        $conf = [];
                        // set datasources
                        if (isset($c['connections'])) {
                Severity: Minor
                Found in src/Propel/Generator/Config/ArrayToPhpConverter.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

                Function addArchiveTable has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function addArchiveTable(): void
                    {
                        $table = $this->getTable();
                        $database = $table->getDatabase();
                        $platform = $database->getPlatform();
                Severity: Minor
                Found in src/Propel/Generator/Behavior/Archivable/ArchivableBehavior.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 addDoInsertBodyRaw has 118 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

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

                    Method execute has 116 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

                      Function addHydrateBody has a Cognitive Complexity of 30 (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

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

                          private function appendTableNode(Table $table, DOMNode $parentNode): void
                          {
                              /** @var \DOMElement $tableNode */
                              $tableNode = $parentNode->appendChild($this->document->createElement('table'));
                              $tableNode->setAttribute('name', $table->getCommonName());
                      Severity: Minor
                      Found in src/Propel/Generator/Schema/Dumper/XmlDumper.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 execute has 110 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/MigrationDownCommand.php - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language