propelorm/Propel2

View on GitHub

Showing 694 of 741 total issues

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

    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)
                {
                    $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

                  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

                    Function convert has a Cognitive Complexity of 31 (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 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 addDoSave has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      MigrationManager has 34 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class MigrationManager extends AbstractManager
                      {
                          use PathTrait;
                      
                          /**
                      Severity: Minor
                      Found in src/Propel/Generator/Manager/MigrationManager.php - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language