propelorm/Propel2

View on GitHub

Showing 740 of 740 total issues

Function getColumnDDL has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getColumnDDL(Column $col): string
    {
        $domain = $col->getDomain();

        $ddl = [$this->quoteIdentifier($col->getName())];
Severity: Minor
Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 hr 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 getModifyTableDDL has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModifyTableDDL(TableDiff $tableDiff): string
    {
        $changedNotEditableThroughDirectDDL = $this->tableAlteringWorkaround && (
            $tableDiff->hasModifiedFks()
            || $tableDiff->hasModifiedIndices()
Severity: Minor
Found in src/Propel/Generator/Platform/SqlitePlatform.php - About 1 hr 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 comparePrimaryKeys has a Cognitive Complexity of 15 (exceeds 5 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

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 getUnclassifiedPrimaryKeys has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUnclassifiedPrimaryKeys(): array
    {
        $pks = [];
        foreach ($this->getMiddleTable()->getPrimaryKey() as $pk) {
            //required
Severity: Minor
Found in src/Propel/Generator/Model/CrossForeignKeys.php - About 1 hr 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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    foreach ($statements as $statement) {
                        try {
                            if ($input->getOption('verbose')) {
                                $output->writeln(sprintf('Executing statement "%s"', $statement));
                            }
Severity: Major
Found in src/Propel/Generator/Command/MigrationMigrateCommand.php and 1 other location - About 1 hr to fix
src/Propel/Generator/Command/MigrationUpCommand.php on lines 134..156

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 119.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                foreach ($statements as $statement) {
                    try {
                        if ($input->getOption('verbose')) {
                            $output->writeln(sprintf('Executing statement "%s"', $statement));
                        }
Severity: Major
Found in src/Propel/Generator/Command/MigrationUpCommand.php and 1 other location - About 1 hr to fix
src/Propel/Generator/Command/MigrationMigrateCommand.php on lines 152..173

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 119.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method addMultipleJoin has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addMultipleJoin(array $conditions, ?string $joinType = null)
    {
        $join = new Join();
        $join->setIdentifierQuoting($this->isIdentifierQuotingEnabled());
        $joinCondition = null;
Severity: Minor
Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 1 hr to fix

    Method addFilterByPrimaryKeys has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function getIdentifierPhp(
              string $columnValueMutator,
              string $connectionVariableName = '$con',
              string $sequenceName = '',
              string $tab = '            ',
      Severity: Major
      Found in src/Propel/Generator/Platform/PgsqlPlatform.php and 1 other location - About 1 hr to fix
      src/Propel/Generator/Platform/OraclePlatform.php on lines 481..503

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function addLocalValueCondition(
              string $leftTableName,
              string $leftColumnName,
              ?string $leftTableAlias,
              $leftColumnValue,
      Severity: Major
      Found in src/Propel/Runtime/ActiveQuery/Join.php and 1 other location - About 1 hr to fix
      src/Propel/Runtime/ActiveQuery/Join.php on lines 289..304

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function addForeignValueCondition(
              string $rightTableName,
              string $rightColumnName,
              ?string $rightTableAlias,
              $rightColumnValue,
      Severity: Major
      Found in src/Propel/Runtime/ActiveQuery/Join.php and 1 other location - About 1 hr to fix
      src/Propel/Runtime/ActiveQuery/Join.php on lines 263..278

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          public function getIdentifierPhp(
              string $columnValueMutator,
              string $connectionVariableName = '$con',
              string $sequenceName = '',
              string $tab = '            ',
      Severity: Major
      Found in src/Propel/Generator/Platform/OraclePlatform.php and 1 other location - About 1 hr to fix
      src/Propel/Generator/Platform/PgsqlPlatform.php on lines 911..933

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 117.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Method replaceNames has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function replaceNames(string &$sql): bool
          {
              $this->replacedColumns = [];
              $this->currentAlias = '';
              $this->foundMatch = false;
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 1 hr to fix

        Method addSetByPosition has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method addClear has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

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

              Method addGetPrimaryKeyFromRow has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addGetPrimaryKeyFromRow(string &$script): void
                  {
                      $script .= "
                  /**
                   * Retrieves the primary key from the DB resultset row
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                Method addFindPk has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addFindPk(string &$script): void
                    {
                        $class = $this->getObjectClassName();
                        $tableMapClassName = $this->getTableMapClassName();
                        $table = $this->getTable();
                Severity: Minor
                Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                  Method generateBlockStorage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function generateBlockStorage($object, bool $isPrimaryKey = false): string
                      {
                          $vendorSpecific = $object->getVendorInfoForType('oracle');
                          if ($vendorSpecific->isEmpty()) {
                              return '';
                  Severity: Minor
                  Found in src/Propel/Generator/Platform/OraclePlatform.php - About 1 hr to fix

                    Method addComputeDiff has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function addComputeDiff(string &$script): void
                        {
                            $script .= "
                    /**
                     * Computes the diff between two versions.
                      Severity
                      Category
                      Status
                      Source
                      Language