propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Function getConnection has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getConnection(array $params): PdoConnection
    {
        $params = $this->prepareParams($params);

        if (!isset($params['dsn'])) {
Severity: Minor
Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
Open

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

    public function parse(Database $database, array $additionalTables = []): int
    {
        $tables = [];
        /** @var \PDOStatement $stmt */
        $stmt = $this->dbh->query("SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE'");
Severity: Minor
Found in src/Propel/Generator/Reverse/OracleSchemaParser.php - About 1 hr 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 needAliasForClassName has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function needAliasForClassName(string $class, string $classNamespace): bool
    {
        // Should remove this check by not allowing nullable return values in getNamespace
        if ($this->getNamespace() === null) {
            return false;
Severity: Minor
Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 1 hr 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 addCopyInto has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addCopyInto(string &$script): void
    {
        $table = $this->getTable();

        $script .= "
Severity: Minor
Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 addExtraIndices has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function addExtraIndices(): void
    {
        /**
         * A collection of indexed columns. The key is the column name
         * (concatenated with a comma in the case of multi-col index), the value is
Severity: Minor
Found in src/Propel/Generator/Model/Table.php - About 1 hr 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 appendDatabaseNode has a Cognitive Complexity of 14 (exceeds 5 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: Minor
Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr 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 generateBlockStorage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function generateBlockStorage($object, bool $isPrimaryKey = false): string
    {
        $vendorSpecific = $object->getVendorInfoForType('oracle');
        if ($vendorSpecific->isEmpty()) {
            return '';
Severity: Minor
Found in src/Propel/Generator/Platform/OraclePlatform.php - About 1 hr 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 getModifyTableDDL has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getModifyTableDDL(TableDiff $tableDiff): string
    {
        $ret = '';

        $toTable = $tableDiff->getToTable();
Severity: Minor
Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 1 hr 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 getCrossFks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCrossFks(): array
    {
        $crossFks = [];
        foreach ($this->referrers as $refFK) {
            if ($refFK->getTable()->isCrossRef()) {
Severity: Minor
Found in src/Propel/Generator/Model/Table.php - About 1 hr 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 modifyTable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function modifyTable(): void
    {
        $table = $this->getTable();
        $database = $table->getDatabase();
        $delegates = explode(',', $this->parameters['to']);
Severity: Minor
Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 1 hr 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 getAllObjectsFromRow has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAllObjectsFromRow(array $row): ActiveRecordInterface
    {
        $col = 0;

        // main object
Severity: Minor
Found in src/Propel/Runtime/Formatter/OnDemandFormatter.php - About 1 hr to fix

    Method addHashCode has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addHashCode(string &$script): void
        {
            $script .= "
        /**
         * If the primary key is not null, return the hashcode of the
    Severity: Minor
    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

      Method getMigrationTableDDL has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getMigrationTableDDL(TableDiff $tableDiff): string
          {
              $pattern = "
      CREATE TEMPORARY TABLE %s AS SELECT %s FROM %s;
      DROP TABLE %s;
      Severity: Minor
      Found in src/Propel/Generator/Platform/SqlitePlatform.php - About 1 hr to fix

        Method insertSql has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function insertSql(?string $datasource = null): bool
            {
                $statementsToInsert = [];
                foreach ($this->getProperties($this->getSqlDbMapFilename()) as $sqlFile => $database) {
                    if ($datasource !== null && $database !== $datasource) {
        Severity: Minor
        Found in src/Propel/Generator/Manager/SqlManager.php - About 1 hr to fix

          Method getTableOptions has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function getTableOptions(Table $table): array
              {
                  $vi = $table->getVendorInfoForType('mysql');
                  $tableOptions = [];
                  // List of supported table options
          Severity: Minor
          Found in src/Propel/Generator/Platform/MysqlPlatform.php - About 1 hr to fix

            Method execute has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output): int
                {
                    $configOptions = [];
            
                    if ($this->hasInputOption('output-dir', $input)) {
            Severity: Minor
            Found in src/Propel/Generator/Command/MigrationDownCommand.php - About 1 hr to fix

              Method addMutatorCloseBody has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addMutatorCloseBody(string &$script, Column $column): void
                  {
                      $table = $this->getTable();
              
                      if ($column->isForeignKey()) {
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                Method addGetOMClassInheritance has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addGetOMClassInheritance(string &$script): void
                    {
                        $col = $this->getTable()->getChildrenColumn();
                        $script .= "
                    /**
                Severity: Minor
                Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                  Method compareColumns has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function compareColumns(Column $fromColumn, Column $toColumn): array
                      {
                          $changedProperties = [];
                  
                          // compare column types
                  Severity: Minor
                  Found in src/Propel/Generator/Model/Diff/ColumnComparator.php - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language