propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Function addColumn has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function addColumn($data): void
    {
        if ($data instanceof Column) {
            $column = $data;
            $this->columns[] = $column->getName();
Severity: Minor
Found in src/Propel/Generator/Model/Index.php - About 55 mins 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 isAtLeastOneLocalPrimaryKeyNotCovered has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function isAtLeastOneLocalPrimaryKeyNotCovered(ForeignKey $fk): bool
    {
        $primaryKeys = $fk->getLocalColumnObjects();
        foreach ($primaryKeys as $primaryKey) {
            $covered = false;
Severity: Minor
Found in src/Propel/Generator/Model/CrossForeignKeys.php - About 55 mins 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 addExplicitCondition has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $leftTableName,
        string $leftColumnName,
        ?string $leftTableAlias = null,
        ?string $rightTableName = null,
        ?string $rightColumnName = null,
Severity: Major
Found in src/Propel/Runtime/ActiveQuery/Join.php - About 50 mins to fix

    Function equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function equals(?object $obj): bool
        {
            // TODO: optimize me with early outs
            if ($this === $obj) {
                return true;
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/Criterion/AbstractModelCriterion.php - About 45 mins 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 putAll has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function putAll($t)
        {
            if (is_array($t)) {
                foreach ($t as $key => $value) {
                    if ($value instanceof AbstractCriterion) {
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 45 mins 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 cleanupConnections has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function cleanupConnections(): void
        {
            $databaseConnections = $this->config['database']['connections'];
            $assertConnectionExists = static function (string $connection, string $section, string $childSection) use ($databaseConnections): void {
                if (!array_key_exists($connection, $databaseConnections)) {
    Severity: Minor
    Found in src/Propel/Common/Config/ConfigurationManager.php - About 45 mins 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 log has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function log(string $message, int $level = self::LOG_DEBUG): void
        {
            $logger = self::$serviceContainer->getLogger();
    
            switch ($level) {
    Severity: Minor
    Found in src/Propel/Runtime/Propel.php - About 45 mins 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 equals has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function equals(?object $obj): bool
        {
            // TODO: optimize me with early outs
            if ($this === $obj) {
                return true;
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/Criterion/AbstractCriterion.php - About 45 mins 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 setRelationMap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function setRelationMap(RelationMap $relationMap, ?string $leftTableAlias = null, ?string $relationAlias = null)
        {
            $leftCols = $relationMap->getLeftColumns();
            $rightCols = $relationMap->getRightColumns();
            $leftValues = $relationMap->getLocalValues();
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/ModelJoin.php - About 45 mins 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 findOneOrCreate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function findOneOrCreate(?ConnectionInterface $con = null)
        {
            if ($this->joins) {
                throw new PropelException(__METHOD__ . ' cannot be used on a query with a join, because Propel cannot transform a SQL JOIN into a subquery. You should split the query in two queries to avoid joins.');
            }
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 45 mins 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 buildWhereClause has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function buildWhereClause(?array &$params, array &$sourceTableNamesCollector): ?string
        {
            $columnNameToCriterions = $this->criteria->getMap();
            if (!$columnNameToCriterions) {
                return null;
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/SqlBuilder/SelectQuerySqlBuilder.php - About 45 mins 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 __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            Criteria $outer,
            string $clause,
            $column,
            $value = null,
            ?string $tableAlias = null,
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/Criterion/RawModelCriterion.php - About 45 mins to fix

      Function getInstanceKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getInstanceKey($value): ?string
          {
              if (!($value instanceof Criteria) && is_object($value)) {
                  $pk = $value->getPrimaryKey();
                  if (
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/InstancePoolTrait.php - About 45 mins 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 buildJoinCondition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function buildJoinCondition(Criteria $c): void
          {
              /** @var \Propel\Runtime\ActiveQuery\Criterion\AbstractCriterion|null $joinCondition */
              $joinCondition = null;
              for ($i = 0; $i < $this->count; $i++) {
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Join.php - About 45 mins 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 addClassOpen has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addClassOpen(string &$script): void
          {
              $table = $this->getTable();
              $tableName = $table->getName();
              $tableDesc = $table->getDescription();
      Severity: Minor
      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addIndexes(Table $table): void
          {
              $columnNamesIndexedByIndexName = $this->getColumnNamesIndexedByIndexName($table);
      
              foreach ($columnNamesIndexedByIndexName as $indexName => $columnNames) {
      Severity: Minor
      Found in src/Propel/Generator/Reverse/OracleSchemaParser.php - About 45 mins 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 rollBack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rollBack(): bool
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 45 mins 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 addPrimaryKey has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $columnName,
              string $phpName,
              string $type,
              bool $isNotNull = false,
              ?int $size = null,
      Severity: Minor
      Found in src/Propel/Runtime/Map/TableMap.php - About 45 mins to fix

        Function fromArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function fromArray(array $array, ?string $rootKey = null, bool $isList = false, bool $includeHeading = true): string
            {
                $rows = [];
                if ($isList) {
                    if ($includeHeading) {
        Severity: Minor
        Found in src/Propel/Runtime/Parser/CsvParser.php - About 45 mins 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 validateDatabaseTables has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function validateDatabaseTables(Database $database): void
            {
                $phpNames = [];
                $namespaces = [];
                foreach ($database->getTables() as $table) {
        Severity: Minor
        Found in src/Propel/Generator/Util/SchemaValidator.php - About 45 mins 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

        Severity
        Category
        Status
        Source
        Language