propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Function replaceNames has a Cognitive Complexity of 17 (exceeds 5 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 2 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 getGroupBy has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function getGroupBy(Criteria $criteria): string
    {
        $groupBy = $criteria->getGroupByColumns();

        if ($groupBy) {
Severity: Minor
Found in src/Propel/Runtime/Adapter/Pdo/PgsqlAdapter.php - About 2 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 createSelectSqlPart has a Cognitive Complexity of 17 (exceeds 5 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 2 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 convertDOMElementToArray has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convertDOMElementToArray(DOMNode $data): array
    {
        $array = [];
        $elementNames = [];
        /** @var \DOMElement $element */
Severity: Minor
Found in src/Propel/Runtime/Parser/XmlParser.php - About 2 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 addIndexes has a Cognitive Complexity of 17 (exceeds 5 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 2 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 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function parseTables(array &$tableWraps, Database $database, ?Table $filterTable = null): void
    {
        $params = [];

        $sql = "
Severity: Minor
Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 2 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 addDoInsertBodyWithIdMethod has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addDoInsertBodyWithIdMethod(): string
    {
        $table = $this->getTable();
        $script = '';
        foreach ($table->getPrimaryKey() as $col) {
Severity: Minor
Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 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 addFindPkSimple has a Cognitive Complexity of 17 (exceeds 5 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: Minor
Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 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 buildModel has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function buildModel(): Database
    {
        /** @var \Propel\Generator\Config\GeneratorConfig $config */
        $config = $this->getGeneratorConfig();
        $connection = $this->getConnection();
Severity: Minor
Found in src/Propel/Generator/Manager/ReverseManager.php - About 2 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 appendColumnNode has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    private function appendColumnNode(Column $column, DOMNode $parentNode): void
    {
        /** @var \DOMElement $columnNode */
        $columnNode = $parentNode->appendChild($this->document->createElement('column'));
        $columnNode->setAttribute('name', $column->getName());
Severity: Minor
Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 2 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 mergeWith has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function mergeWith(self $criteria, ?string $operator = null)
    {
        // merge limit
        $limit = $criteria->getLimit();
        if ($limit && $this->getLimit() === -1) {
Severity: Major
Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 2 hrs to fix

    Method addCopyInto has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method addScopeAccessors has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addScopeAccessors(string &$script): void
          {
              $script .= "
      /**
       * Wrap the getter for scope value

        Method findMethod has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function findMethod(string $methodName)
            {
                if (isset($this->knownMethodCache[$methodName])) {
                    return $this->knownMethodCache[$methodName];
                }
        Severity: Major
        Found in src/Propel/Generator/Util/PhpParser.php - About 2 hrs to fix

          Method appendDatabaseNode has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function appendDatabaseNode(Database $database, DOMNode $parentNode): void
              {
                  /** @var \DOMElement $databaseNode */
                  $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
                  $databaseNode->setAttribute('name', $database->getName());
          Severity: Major
          Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 2 hrs to fix

            Method compareTables has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function compareTables(bool $caseInsensitive = false): int
                {
                    $fromDatabaseTables = $this->fromDatabase->getTables();
                    $toDatabaseTables = $this->toDatabase->getTables();
                    $databaseDifferences = 0;
            Severity: Major
            Found in src/Propel/Generator/Model/Diff/DatabaseComparator.php - About 2 hrs to fix

              File ConcreteInheritanceBehavior.php has 257 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

                ObjectCollection has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class ObjectCollection extends Collection
                {
                    /**
                     * @var array
                     */
                Severity: Minor
                Found in src/Propel/Runtime/Collection/ObjectCollection.php - About 2 hrs to fix

                  AbstractManager has 21 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  abstract class AbstractManager
                  {
                      /**
                       * Data models that we collect. One from each XML schema file.
                       *
                  Severity: Minor
                  Found in src/Propel/Generator/Manager/AbstractManager.php - About 2 hrs to fix

                    Index has 21 functions (exceeds 20 allowed). Consider refactoring.
                    Open

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