propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method getIdentifierPhp has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $columnValueMutator,
        string $connectionVariableName = '$con',
        string $sequenceName = '',
        string $tab = '            ',
        ?string $phpType = null
Severity: Minor
Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 35 mins to fix

    Method getMigrationClassBody has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getMigrationClassBody(array $migrationsUp, array $migrationsDown, int $timestamp, string $comment = '', string $suffix = ''): string
    Severity: Minor
    Found in src/Propel/Generator/Manager/MigrationManager.php - About 35 mins to fix

      Function combine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function combine(array $criterions = [], string $operator = self::LOGICAL_AND, ?string $name = null)
          {
              $operatorMethod = (strtoupper($operator) === self::LOGICAL_AND) ? 'addAnd' : 'addOr';
              $namedCriterions = [];
              foreach ($criterions as $key) {
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function rollBack(): bool
          {
              $return = true;
              $opcount = $this->getNestedTransactionCount();
              if ($opcount > 0) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/MSSQL/MssqlPropelPDO.php - About 35 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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct(array $errors)
          {
              $numErrors = count($errors);
      
              $message = '';
      Severity: Minor
      Found in src/Propel/Common/Config/Exception/XmlParseException.php - About 35 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 groupByClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function groupByClass(string $class)
          {
              if ($class == $this->getModelAliasOrName()) {
                  // column of the Criteria's model
                  $tableMap = $this->getTableMap();
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 35 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 count has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function count(): int
          {
              if ($this->dataObject && $this->dataObject->getConnection()->getAttribute(PDO::ATTR_DRIVER_NAME) === 'sqlite') {
                  $lastQuery = $this->dataObject->getStatement()->queryString;
                  if (substr(trim(strtoupper($lastQuery)), 0, 7) === 'SELECT ') {
      Severity: Minor
      Found in src/Propel/Runtime/DataFetcher/PDODataFetcher.php - About 35 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 addSelectQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addSelectQuery(Criteria $subQueryCriteria, ?string $alias = null, bool $addAliasAndSelectColumns = true)
          {
              if (!$subQueryCriteria->hasSelectClause()) {
                  $subQueryCriteria->addSelfSelectColumns();
              }
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 35 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 cleanupSQL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function cleanupSQL(string &$sql, array &$params, Criteria $values, DatabaseMap $dbMap): void
          {
              $i = 1;
              foreach ($params as $param) {
                  $tableName = $param['table'];
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php - About 35 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 bindValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap): void
          {
              $position = 0;
              foreach ($params as $param) {
                  $position++;
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 35 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 setMaxPerPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setMaxPerPage(int $max): void
          {
              if ($max > 0) {
                  $this->maxPerPage = $max;
                  if ($this->page === 0) {
      Severity: Minor
      Found in src/Propel/Runtime/Util/PropelModelPager.php - About 35 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 build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function build(array &$params): PreparedStatementDto
          {
              $sourceTableNamesCollector = [];
      
              $selectSql = $this->buildSelectClause($sourceTableNamesCollector);
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/SqlBuilder/SelectQuerySqlBuilder.php - About 35 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 getPlainSelectedColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getPlainSelectedColumns(Criteria $criteria): array
          {
              $selected = [];
              foreach ($criteria->getSelectColumns() as $columnName) {
                  if (strpos($columnName, '(') === false) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 35 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 initConnection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function initConnection(ConnectionInterface $con, array $settings): void
          {
              $con->exec("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
              $con->exec("ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'");
              if (isset($settings['queries']) && is_array($settings['queries'])) {
      Severity: Minor
      Found in src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php - About 35 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 addColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addColumns(Table $table): void
          {
              /** @var \Propel\Runtime\DataFetcher\PDODataFetcher $dataFetcher */
              $dataFetcher = $this->dbh->query("sp_columns '" . $table->getName() . "'");
              $dataFetcher->setStyle(PDO::FETCH_ASSOC);
      Severity: Minor
      Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 35 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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function parse(Database $database, array $additionalTables = []): int
          {
              $dataFetcher = $this->dbh->query("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME <> 'dtproperties'");
      
              if ($dataFetcher === false) {
      Severity: Minor
      Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 35 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 formatOne has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function formatOne(?DataFetcherInterface $dataFetcher = null)
          {
              $this->checkInit();
              $result = null;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Formatter/SimpleArrayFormatter.php - About 35 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 formatOne has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function formatOne(?DataFetcherInterface $dataFetcher = null): ?array
          {
              $this->checkInit();
              $result = null;
      
      
      Severity: Minor
      Found in src/Propel/Runtime/Formatter/ArrayFormatter.php - About 35 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 cleanupRow has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function cleanupRow(array $row): array
          {
              foreach ($row as $key => $column) {
                  if ($this->isQuoted($column)) {
                      $column = $this->unescape($this->unquote($column));
      Severity: Minor
      Found in src/Propel/Runtime/Parser/CsvParser.php - About 35 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 getReadConnection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getReadConnection(?AdapterInterface $adapter = null): ConnectionInterface
          {
              if ($this->writeConnection && $this->writeConnection->inTransaction()) {
                  return $this->writeConnection;
              }
      Severity: Minor
      Found in src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php - About 35 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