propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method setupReferrers has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setupReferrers(bool $throwErrors = false): void
    {
        foreach ($this->foreignKeys as $foreignKey) {
            // table referrers
            $foreignTable = $this->database->getTable($foreignKey->getForeignTableName());
Severity: Major
Found in src/Propel/Generator/Model/Table.php - About 2 hrs to fix

    File PropelTypes.php has 275 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/Model/PropelTypes.php - About 2 hrs to fix

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

          protected function buildOrderByClause(array &$params): array
          {
              $orderBy = $this->criteria->getOrderByColumns();
              if (!$orderBy) {
                  return ['', ''];
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/SqlBuilder/SelectQuerySqlBuilder.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 search has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public function search($element)
          {
              $hashes = [];
              $isActiveRecord = [];
              foreach (func_get_args() as $pos => $obj) {
      Severity: Minor
      Found in src/Propel/Runtime/Collection/ObjectCombinationCollection.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 getColumnFromName has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getColumnFromName(string $columnName, bool $failSilently = true): array
          {
              if (strpos($columnName, '.') === false) {
                  $prefix = (string)$this->getModelAliasOrName();
              } else {
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.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 addColumns has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addColumns(Table $table): void
          {
              /** @var \PDOStatement $stmt */
              $stmt = $this->dbh->query("SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, DATA_DEFAULT FROM USER_TAB_COLS WHERE TABLE_NAME = '" . $table->getName() . "'");
              while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
      Severity: Minor
      Found in src/Propel/Generator/Reverse/OracleSchemaParser.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 addDoSave has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

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

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

          protected function addColumnAccessorMethods(string &$script): void
          {
              $table = $this->getTable();
      
              foreach ($table->getColumns() as $col) {
      Severity: Minor
      Found in src/Propel/Generator/Builder/Om/AbstractObjectBuilder.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 compareColumns has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public function compareColumns(bool $caseInsensitive = false): int
          {
              $fromTableColumns = $this->getFromTable()->getColumns();
              $toTableColumns = $this->getToTable()->getColumns();
              $columnDifferences = 0;
      Severity: Minor
      Found in src/Propel/Generator/Model/Diff/TableComparator.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 compareColumns has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function compareColumns(Column $fromColumn, Column $toColumn): array
          {
              $changedProperties = [];
      
              // compare column types
      Severity: Minor
      Found in src/Propel/Generator/Model/Diff/ColumnComparator.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 addVersionTable has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addVersionTable(): void
          {
              $table = $this->getTable();
              $database = $table->getDatabase();
              $versionTableName = $this->getParameter('version_table') ?: ($table->getOriginCommonName() . '_version');
      Severity: Minor
      Found in src/Propel/Generator/Behavior/Versionable/VersionableBehavior.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 hydratePropelObjectCollection has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function &hydratePropelObjectCollection(array $row): array
          {
              $col = 0;
      
              // hydrate main object or take it from registry
      Severity: Major
      Found in src/Propel/Runtime/Formatter/AbstractFormatterWithHydration.php - About 2 hrs to fix

        Method addFKAccessor has 63 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function addFKAccessor(string &$script, ForeignKey $fk): void
            {
                $varName = $this->getFKVarName($fk);
                $fkQueryBuilder = $this->getNewStubQueryBuilder($fk->getForeignTable());
                $fkObjectBuilder = $this->getNewObjectBuilder($fk->getForeignTable())->getStubObjectBuilder();
        Severity: Major
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

          Method getReverseDiff has 63 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getReverseDiff(): self
              {
                  $diff = new self();
          
                  // tables
          Severity: Major
          Found in src/Propel/Generator/Model/Diff/TableDiff.php - About 2 hrs to fix

            CollectionIterator has 23 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class CollectionIterator extends ArrayIterator implements IteratorInterface
            {
                /**
                 * @var \Propel\Runtime\Collection\Collection
                 */
            Severity: Minor
            Found in src/Propel/Runtime/Collection/CollectionIterator.php - About 2 hrs to fix

              OraclePlatform has 23 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class OraclePlatform extends DefaultPlatform
              {
                  /**
                   * Initializes db specific domain mapping.
                   *
              Severity: Minor
              Found in src/Propel/Generator/Platform/OraclePlatform.php - About 2 hrs to fix

                Method addColumns has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addColumns(Table $table): void
                    {
                        $tableName = $table->getName();
                
                        /** @var \PDOStatement $stmt */
                Severity: Major
                Found in src/Propel/Generator/Reverse/SqliteSchemaParser.php - About 2 hrs to fix

                  Method addLazyLoaderBody has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method addClassBody has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Method setupObject has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function setupObject(): void
                          {
                              try {
                                  $database = $this->getDatabase();
                                  $platform = ($this->hasPlatform()) ? $this->getPlatform() : null;
                      Severity: Major
                      Found in src/Propel/Generator/Model/Column.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language