propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method queryMethods has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function queryMethods(QueryBuilder $builder): string
    {
        $this->setBuilder($builder);
        $script = '';

    Method build has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function build(array &$params): PreparedStatementDto
        {
            $sourceTableNamesCollector = [];
    
            $selectSql = $this->buildSelectClause($sourceTableNamesCollector);
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/SqlBuilder/SelectQuerySqlBuilder.php - About 1 hr to fix

      Method doUpdate has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function doUpdate($updateValues, ConnectionInterface $con, bool $forceIndividualSaves = false): int
          {
              if ($forceIndividualSaves) {
                  if ($updateValues instanceof Criteria) {
                      throw new LogicException('Parameter #1 `$updateValues` must be an array while `$forceIndividualSaves = true`.');
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 1 hr to fix

        Method addIndexes has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function addIndexes(Table $table): void
            {
                /** @var \PDOStatement $stmt */
                $stmt = $this->dbh->query(sprintf('SHOW INDEX FROM %s', $this->getPlatform()->doQuoting($table->getName())));
        
        
        Severity: Minor
        Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 1 hr to fix

          Method addPrimaryKey has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addPrimaryKey(Table $table, int $oid): void
              {
                  $stmt = $this->dbh->prepare("SELECT
                      DISTINCT ON(cls.relname)
                      cls.relname as idxname,
          Severity: Minor
          Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 1 hr to fix

            Method addRefFKSet has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addRefFKSet(string &$script, ForeignKey $refFK): void
                {
                    $relatedName = $this->getRefFKPhpNameAffix($refFK, true);
                    $relatedObjectClassName = $this->getRefFKPhpNameAffix($refFK, false);
            
            
            Severity: Minor
            Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

              Method addColumnMutatorMethods has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addColumnMutatorMethods(string &$script): void
                  {
                      foreach ($this->getTable()->getColumns() as $col) {
                          if ($col->getType() === PropelTypes::OBJECT) {
                              $this->addObjectMutator($script, $col);
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                            if (
                                $col->isPrimaryKey()
                                && $col->isAutoIncrement()
                                && $table->getIdMethod() !== 'none'
                                && !$table->isAllowPkInsert()
                Severity: Critical
                Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (
                              ($this->isNumber($fromSqlType) && $this->isNumber($toSqlType)) ||
                              ($this->isString($fromSqlType) && $this->isString($toSqlType)) ||
                              ($this->isNumber($fromSqlType) && $this->isString($toSqlType)) ||
                              ($this->isUuid($fromSqlType) && $this->isString($toSqlType))
                  Severity: Critical
                  Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 hr to fix

                    Method createSelectSqlPart has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function createSelectSqlPart(Criteria $criteria, array &$fromClause, bool $aliasAll = false): string
                        {
                            $selectClause = [];
                    
                            if ($aliasAll) {
                    Severity: Minor
                    Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr to fix

                      Method declareClassNamespace has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function declareClassNamespace(string $class, string $namespace = '', $alias = false): string
                          {
                              $namespace = trim($namespace, '\\');
                      
                              // check if the class is already declared
                      Severity: Minor
                      Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 1 hr to fix

                        Method addDelete has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function addDelete(string &$script): void
                            {
                                $script .= "
                            /**
                             * Performs a DELETE on the database based on the current ModelCriteria
                        Severity: Minor
                        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                          Method addFilterByPrimaryKey has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function addFilterByPrimaryKey(string &$script): void
                              {
                                  $script .= "
                              /**
                               * Filter the query by primary key
                          Severity: Minor
                          Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                            Method compareForeignKeys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function compareForeignKeys(bool $caseInsensitive = false): int
                                {
                                    $fkDifferences = 0;
                                    $fromTableFks = $this->getFromTable()->getForeignKeys();
                                    $toTableFks = $this->getToTable()->getForeignKeys();
                            Severity: Minor
                            Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

                              Method addExtraIndices has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function addExtraIndices(): void
                                  {
                                      /**
                                       * A collection of indexed columns. The key is the column name
                                       * (concatenated with a comma in the case of multi-col index), the value is
                              Severity: Minor
                              Found in src/Propel/Generator/Model/Table.php - About 1 hr to fix

                                Method getColumnDefaultValueDDL has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getColumnDefaultValueDDL(Column $col): string
                                    {
                                        $default = '';
                                        $defaultValue = $col->getDefaultValue();
                                        if ($defaultValue !== null) {
                                Severity: Minor
                                Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 1 hr to fix

                                  Method comparePrimaryKeys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function comparePrimaryKeys(bool $caseInsensitive = false): int
                                      {
                                          $pkDifferences = 0;
                                          $fromTablePk = $this->getFromTable()->getPrimaryKey();
                                          $toTablePk = $this->getToTable()->getPrimaryKey();
                                  Severity: Minor
                                  Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

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

                                        public function setupObject(): void
                                        {
                                            parent::setupObject();
                                    
                                            $this->commonName = $this->originCommonName = $this->getAttribute('name');
                                    Severity: Minor
                                    Found in src/Propel/Generator/Model/Table.php - About 1 hr to fix

                                      Method queryMethods has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function queryMethods(AbstractOMBuilder $builder): string
                                          {
                                              $this->setBuilder($builder);
                                              $this->builder->declareClasses(
                                                  '\Propel\Runtime\Propel',

                                        Method modifyTable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function modifyTable(): void
                                            {
                                                $table = $this->getTable();
                                                $database = $table->getDatabase();
                                                $delegates = explode(',', $this->parameters['to']);
                                        Severity: Minor
                                        Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language