propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

NestedSetBehaviorQueryBuilderModifier has 30 functions (exceeds 20 allowed). Consider refactoring.
Open

class NestedSetBehaviorQueryBuilderModifier
{
    /**
     * @var \Propel\Generator\Behavior\NestedSet\NestedSetBehavior
     */

    VersionableBehaviorObjectBuilderModifier has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class VersionableBehaviorObjectBuilderModifier
    {
        /**
         * @var \Propel\Generator\Behavior\Versionable\VersionableBehavior
         */

      Function addColumns has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addColumns(Table $table): void
          {
              $tableName = $table->getName();
      
              /** @var \PDOStatement $stmt */
      Severity: Minor
      Found in src/Propel/Generator/Reverse/SqliteSchemaParser.php - About 3 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 joinSchemas has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          public function joinSchemas(array $schemas): void
          {
              foreach ($schemas as $schema) {
                  foreach ($schema->getDatabases(false) as $addDb) {
                      $addDbName = $addDb->getName();
      Severity: Minor
      Found in src/Propel/Generator/Model/Schema.php - About 3 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 applyLimit has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function applyLimit(string &$sql, int $offset, int $limit, ?Criteria $criteria = null): void
          {
              // split the select and from clauses out of the original query
              $selectStatement = '';
              $fromStatement = '';
      Severity: Major
      Found in src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php - About 3 hrs to fix

        Method addSaveBody has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          File OraclePlatform.php has 313 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/Platform/OraclePlatform.php - About 3 hrs to fix

            PropelModelPager has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class PropelModelPager implements IteratorAggregate, Countable
            {
                /**
                 * @var \Propel\Runtime\ActiveQuery\ModelCriteria
                 */
            Severity: Minor
            Found in src/Propel/Runtime/Util/PropelModelPager.php - About 3 hrs to fix

              PdoAdapter has 29 functions (exceeds 20 allowed). Consider refactoring.
              Open

              abstract class PdoAdapter
              {
                  /**
                   * Indicates if the database system can process DELETE statements with
                   * aliases like 'DELETE t FROM my_table t JOIN my_other_table o ON ...'
              Severity: Minor
              Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 3 hrs to fix

                StatementWrapper has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class StatementWrapper implements StatementInterface, IteratorAggregate
                {
                    /**
                     * The wrapped statement class
                     *
                Severity: Minor
                Found in src/Propel/Runtime/Connection/StatementWrapper.php - About 3 hrs to fix

                  Function simpleXmlToArray has a Cognitive Complexity of 24 (exceeds 5 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 3 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 parseTables has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function parseTables(Database $database, ?Table $filterTable = null): void
                      {
                          $sql = "
                          SELECT name
                          FROM sqlite_master
                  Severity: Minor
                  Found in src/Propel/Generator/Reverse/SqliteSchemaParser.php - About 3 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 addForeignKeys has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addForeignKeys(Table $table, int $oid): void
                      {
                          $database = $table->getDatabase();
                          $stmt = $this->dbh->prepare("SELECT
                              conname,
                  Severity: Minor
                  Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 3 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 addCrossFkScheduledForDeletion has a Cognitive Complexity of 24 (exceeds 5 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: Minor
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 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 addClassBody has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function addClassBody(string &$script): void
                      {
                          $this->declareClassFromBuilder($this->getStubObjectBuilder());
                          $this->declareClassFromBuilder($this->getStubQueryBuilder());
                          $this->declareClassFromBuilder($this->getTableMapBuilder());
                  Severity: Major
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 3 hrs to fix

                    File ConnectionWrapper.php has 308 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/Connection/ConnectionWrapper.php - About 3 hrs to fix

                      Method getColumnFromRow has 84 lines of code (exceeds 25 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: Major
                      Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 3 hrs to fix

                        Method addFindPkSimple has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function addFindPkSimple(string &$script): void
                            {
                                $table = $this->getTable();
                        
                                // this method is not needed if the table has no primary key
                        Severity: Major
                        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 3 hrs to fix

                          RelationMap has 28 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class RelationMap
                          {
                              // types
                              /**
                               * @var int
                          Severity: Minor
                          Found in src/Propel/Runtime/Map/RelationMap.php - About 3 hrs to fix

                            Domain has 28 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            class Domain extends MappingModel
                            {
                                /**
                                 * @var string|null
                                 */
                            Severity: Minor
                            Found in src/Propel/Generator/Model/Domain.php - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language