propelorm/Propel2

View on GitHub

Showing 690 of 740 total issues

Avoid too many return statements within this method.
Open

        return $fromFk->isSkipSql() !== $toFk->isSkipSql();
Severity: Major
Found in src/Propel/Generator/Model/Diff/ForeignKeyComparator.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return sprintf("'%s'", $defaultValue->getValue());
    Severity: Major
    Found in src/Propel/Generator/Model/Column.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return '';
      Severity: Major
      Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return true;
        Severity: Major
        Found in src/Propel/Generator/Model/Diff/ForeignKeyComparator.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $behavior;
          Severity: Major
          Found in src/Propel/Generator/Model/ForeignKey.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return false;
            Severity: Major
            Found in src/Propel/Generator/Model/Table.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return ' USING NULL';
              Severity: Major
              Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return true;
                Severity: Major
                Found in src/Propel/Generator/Model/Diff/ForeignKeyComparator.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $this->defaultValue->getValue();
                  Severity: Major
                  Found in src/Propel/Generator/Model/Domain.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                return '';
                    Severity: Major
                    Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 30 mins to fix

                      Function needsSelectAliases has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function needsSelectAliases(): bool
                          {
                              $columnNames = [];
                              foreach ($this->getSelectColumns() as $fullyQualifiedColumnName) {
                                  $pos = strrpos($fullyQualifiedColumnName, '.');
                      Severity: Minor
                      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 25 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function create(string $driver): AdapterInterface
                          {
                              if (!$driver) {
                                  $adapterClass = '\Propel\Runtime\Adapter\NoneAdapter';
                              } elseif (strpos($driver, '\\') === false) {
                      Severity: Minor
                      Found in src/Propel/Runtime/Adapter/AdapterFactory.php - About 25 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 applyLimit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function applyLimit(string &$sql, int $offset, int $limit, ?Criteria $criteria = null): void
                          {
                              $params = [];
                              if ($criteria && $criteria->needsSelectAliases()) {
                                  $crit = clone $criteria;
                      Severity: Minor
                      Found in src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php - About 25 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 convertIntToArray has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function convertIntToArray(?string $val, array $valueSet): array
                          {
                              if ($val === null) {
                                  return [];
                              }
                      Severity: Minor
                      Found in src/Propel/Common/Util/SetColumnConverter.php - About 25 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 prepare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function prepare(string $statement, array $driverOptions = [])
                          {
                              $statementWrapper = null;
                      
                              if ($this->isCachePreparedStatements && isset($this->cachedPreparedStatements[$statement])) {
                      Severity: Minor
                      Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 25 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 getColumnMappings has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getColumnMappings(int $direction = self::LOCAL_TO_FOREIGN): array
                          {
                              $h = [];
                              if (
                                  $direction === self::LEFT_TO_RIGHT
                      Severity: Minor
                      Found in src/Propel/Runtime/Map/RelationMap.php - About 25 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 6 (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'");
                      
                              // First load the tables (important that this happen before filling out details of tables)
                      Severity: Minor
                      Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 25 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 addPrimaryKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function addPrimaryKey(Table $table): void
                          {
                              /** @var \PDOStatement $stmt */
                              $stmt = $this->dbh->query(sprintf('SHOW KEYS FROM %s', $this->getPlatform()->doQuoting($table->getName())));
                      
                      
                      Severity: Minor
                      Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 25 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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function execute(InputInterface $input, OutputInterface $output): int
                          {
                              $configManager = new ConfigurationManager($input->getOption('config-dir'));
                      
                              $outputDir = $input->getOption('output-dir') ?? $configManager->getConfigProperty('paths.phpConfDir');
                      Severity: Minor
                      Found in src/Propel/Generator/Command/ConfigConvertCommand.php - About 25 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 validateModel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function validateModel(): void
                          {
                              parent::validateModel();
                      
                              $table = $this->getTable();
                      Severity: Minor
                      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 25 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