propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

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

    public function getI18nColumns(): array
    {
        $columns = [];
        $i18nTable = $this->getI18nTable();
        $columnNames = $this->getI18nColumnNamesFromConfig();
Severity: Minor
Found in src/Propel/Generator/Behavior/I18n/I18nBehavior.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 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 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 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 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 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 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 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

    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

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

          public function format(?DataFetcherInterface $dataFetcher = null)
          {
              $this->checkInit();
      
              if ($dataFetcher) {
      Severity: Minor
      Found in src/Propel/Runtime/Formatter/ArrayFormatter.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

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

          protected function addApplyDefaultValuesBody(string &$script): void
          {
              $table = $this->getTable();
              // FIXME - Apply support for PHP default expressions here
              // see: http://propel.phpdb.org/trac/ticket/378
      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 getRelation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getRelation(): ?RelationMap
          {
              if (!$this->relatedTableName) {
                  return null;
              }
      Severity: Minor
      Found in src/Propel/Runtime/Map/ColumnMap.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 buildSQL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function buildSQL(ConnectionInterface $con): int
          {
              $sql = $this->getSQL();
              $statements = SqlParser::parseString($sql);
              foreach ($statements as $statement) {
      Severity: Minor
      Found in src/Propel/Generator/Util/QuickBuilder.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 getBehavior has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getBehavior(string $name): string
          {
              if (strpos($name, '\\') !== false) {
                  $class = $name;
              } else {
      Severity: Minor
      Found in src/Propel/Generator/Util/BehaviorLocator.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