propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method addFindPks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function addFindPks(string &$script): void
    {
        $this->declareClasses(
            '\Propel\Runtime\Collection\Collection',
            '\Propel\Runtime\Connection\ConnectionInterface',
Severity: Minor
Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

    Method computeDiff has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function computeDiff(ForeignKey $fromFk, ForeignKey $toFk, bool $caseInsensitive = false): bool
        {
            // Check for differences in local and remote table
            $fromDifferentTable = $caseInsensitive ?
                strtolower($fromFk->getTableName()) !== strtolower($toFk->getTableName()) :
    Severity: Minor
    Found in src/Propel/Generator/Model/Diff/ForeignKeyComparator.php - About 1 hr to fix

      Method addDoSelect has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addDoSelect(string &$script): void
          {
              $script .= "
      public function doSelect(?ConnectionInterface \$con = null): \Propel\Runtime\DataFetcher\DataFetcherInterface
      {
      Severity: Minor
      Found in src/Propel/Generator/Behavior/QueryCache/QueryCacheBehavior.php - About 1 hr to fix

        Method addObjectCompute has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function addObjectCompute(ObjectBuilder $builder): string
            {
                $conditions = [];
                if ($this->getParameter('condition')) {
                    $conditions[] = $this->getParameter('condition');

          Method resolveString has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function resolveString(string $value, array $resolving = [])
              {
                  /*
                   * %%: to be unescaped
                   * %[^%\s]++%: a parameter
          Severity: Minor
          Found in src/Propel/Common/Config/Loader/FileLoader.php - About 1 hr to fix

            Method parseTables has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function parseTables(Database $database, ?Table $filterTable = null): void
                {
                    $sql = 'SHOW FULL TABLES';
            
                    if ($filterTable) {
            Severity: Minor
            Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 1 hr to fix

              Method addForeignKeys has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addForeignKeys(Table $table): void
                  {
                      $database = $table->getDatabase();
              
                      /** @var \PDOStatement $stmt */
              Severity: Minor
              Found in src/Propel/Generator/Reverse/SqliteSchemaParser.php - About 1 hr to fix

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

                    protected function addColumns(Table $table): void
                    {
                        /** @var \Propel\Runtime\DataFetcher\PDODataFetcher $dataFetcher */
                        $dataFetcher = $this->dbh->query("sp_columns '" . $table->getName() . "'");
                        $dataFetcher->setStyle(PDO::FETCH_ASSOC);
                Severity: Minor
                Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 1 hr to fix

                  Method addPopulateObject has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function addPopulateObject(string &$script): void
                      {
                          $table = $this->getTable();
                          $script .= "
                      /**
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                    Method addGetPrimaryKeyHash has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function addGetPrimaryKeyHash(string &$script): void
                        {
                            // We have to iterate through all the columns so that we know the offset of the primary
                            // key columns.
                            $n = 0;
                    Severity: Minor
                    Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                      Method compareIndices has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function compareIndices(bool $caseInsensitive = false): int
                          {
                              $indexDifferences = 0;
                              $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
                              $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());
                      Severity: Minor
                      Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

                        Method addDeleteDescendants has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function addDeleteDescendants(string &$script): void
                            {
                                $objectClassName = $this->builder->getObjectClassName();
                                $queryClassName = $this->builder->getQueryClassName();
                                $tableMapClass = $this->builder->getTableMapClass();

                          Method addSyncParentToChild has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function addSyncParentToChild(string &$script): void
                              {
                                  $parentTable = $this->getParentTable();
                                  $parentClass = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($parentTable));
                          
                          

                            Method getProfileBetween has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getProfileBetween(array $startSnapshot, array $endSnapshot): string
                                {
                                    $profile = '';
                            
                                    if ($this->slowThreshold) {
                            Severity: Minor
                            Found in src/Propel/Runtime/Util/Profiler.php - About 1 hr to fix

                              Method init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function init(?ConnectionInterface $con = null): void
                                  {
                                      $this->con = $con;
                                      $maxRecordLimit = $this->getMaxRecordLimit();
                                      $hasMaxRecordLimit = (bool)$maxRecordLimit;
                              Severity: Minor
                              Found in src/Propel/Runtime/Util/PropelModelPager.php - About 1 hr to fix

                                Method simpleXmlToArray has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected static function simpleXmlToArray(SimpleXMLElement $xml): array
                                    {
                                        $ar = [];
                                        foreach ($xml->children() as $k => $v) {
                                            // recurse the child
                                Severity: Minor
                                Found in src/Propel/Common/Config/XmlToArrayConverter.php - About 1 hr to fix

                                  Method search has 29 lines of code (exceeds 25 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 1 hr to fix

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

                                        protected function addIndexes(Table $table): void
                                        {
                                            /** @var \Propel\Runtime\DataFetcher\PDODataFetcher $dataFetcher */
                                            $dataFetcher = $this->dbh->query("sp_indexes_rowset '" . $table->getName() . "'");
                                            $dataFetcher->setStyle(PDO::FETCH_ASSOC);
                                    Severity: Minor
                                    Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 1 hr to fix

                                      Method addCrossFKAdd has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function addCrossFKAdd(string &$script, CrossForeignKeys $crossFKs): void
                                          {
                                              $refFK = $crossFKs->getIncomingForeignKey();
                                      
                                              foreach ($crossFKs->getCrossForeignKeys() as $crossFK) {
                                      Severity: Minor
                                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                                        Method addRefFKGetJoinMethods has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            protected function addRefFKGetJoinMethods(string &$script, ForeignKey $refFK): void
                                            {
                                                $table = $this->getTable();
                                                $tblFK = $refFK->getTable();
                                                $joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
                                        Severity: Minor
                                        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language