propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    protected function addIndexes(Table $table): void
    {
        /** @var \PDOStatement $stmt */
        $stmt = $this->dbh->query('PRAGMA index_list("' . $table->getName() . '")');

Severity: Minor
Found in src/Propel/Generator/Reverse/SqliteSchemaParser.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 addClassBody has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addClassBody(string &$script): void
    {
        $this->declareClassFromBuilder($this->getStubObjectBuilder());
        $this->declareClassFromBuilder($this->getStubQueryBuilder());
        $this->declareClassFromBuilder($this->getTableMapBuilder());
Severity: Minor
Found in src/Propel/Generator/Builder/Om/ObjectBuilder.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 parseTables has a Cognitive Complexity of 15 (exceeds 5 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

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

    protected function addIndexes(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

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

    protected function addDoDelete(string &$script): void
    {
        $table = $this->getTable();
        $script .= "
    /**
Severity: Minor
Found in src/Propel/Generator/Builder/Om/TableMapBuilder.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 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 appendModifiedFksToString has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function appendModifiedFksToString(string $ret): string
    {
        $modifiedFks = $this->getModifiedFks();

        if ($modifiedFks) {
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableDiff.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

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

      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 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 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 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