propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    public function addClearRelatedInstancePool(): string
    {
        $table = $this->getTable();
        $relatedClassNames = [];

Severity: Minor
Found in src/Propel/Generator/Builder/Om/TableMapBuilder.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 addDoInsert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

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

Severity: Minor
Found in src/Propel/Generator/Builder/Om/TableMapBuilder.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 extractCrossInformation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function extractCrossInformation(
        CrossForeignKeys $crossFKs,
        $crossFKToIgnore,
        array &$signature,
        array &$shortSignature,
Severity: Minor
Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.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 addFKMutator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addFKMutator(string &$script, ForeignKey $fk): void
    {
        $fkTable = $fk->getForeignTable();
        $interface = $fk->getInterface();

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

    protected function addRefFKGetJoinMethods(string &$script, ForeignKey $refFK): void
    {
        $table = $this->getTable();
        $tblFK = $refFK->getTable();
        $joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
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 isDeleteCascadeEmulationNeeded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isDeleteCascadeEmulationNeeded(): bool
    {
        $table = $this->getTable();
        if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
            foreach ($table->getReferrers() as $fk) {
Severity: Minor
Found in src/Propel/Generator/Builder/Om/QueryBuilder.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 addBuildRelations has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addBuildRelations(string &$script): void
    {
        $script .= "
    /**
     * Build the RelationMap objects for this table relationships
Severity: Minor
Found in src/Propel/Generator/Builder/Om/TableMapBuilder.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 getMigrationTableDDL has a Cognitive Complexity of 8 (exceeds 5 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 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 computeDiff has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        Database $fromDatabase,
        Database $toDatabase,
        bool $caseInsensitive = false,
        bool $withRenaming = false,
        bool $removeTable = true,
Severity: Minor
Found in src/Propel/Generator/Model/Diff/DatabaseComparator.php - About 45 mins to fix

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

        protected function setupObject(): void
        {
            try {
                $database = $this->getDatabase();
                $platform = ($this->hasPlatform()) ? $this->getPlatform() : null;
    Severity: Minor
    Found in src/Propel/Generator/Model/Column.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 appendForeignKeyNode has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function appendForeignKeyNode(ForeignKey $foreignKey, DOMNode $parentNode): void
        {
            /** @var \DOMElement $foreignKeyNode */
            $foreignKeyNode = $parentNode->appendChild($this->document->createElement('foreign-key'));
            $foreignKeyNode->setAttribute('foreignTable', $foreignKey->getForeignTableCommonName());
    Severity: Minor
    Found in src/Propel/Generator/Schema/Dumper/XmlDumper.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 addSyncParentToChild has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function addSyncParentToChild(string &$script): void
        {
            $parentTable = $this->getParentTable();
            $parentClass = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($parentTable));
    
    

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

        public function addBehavior($bdata): Behavior
        {
            if ($bdata instanceof Behavior) {
                $behavior = $bdata;
    
    
    Severity: Minor
    Found in src/Propel/Generator/Model/BehaviorableTrait.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 addForeignKeyVersionColumns has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function addForeignKeyVersionColumns(): void
        {
            $versionTable = $this->versionTable;
            foreach ($this->getVersionableFks() as $fk) {
                $fkVersionColumnName = $fk->getLocalColumnName() . '_version';
    Severity: Minor
    Found in src/Propel/Generator/Behavior/Versionable/VersionableBehavior.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 generateName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function generateName(array $inputs): string
        {
            $schemaName = (string)$inputs[0];
            $method = (string)$inputs[1];
    
    
    Severity: Minor
    Found in src/Propel/Generator/Model/PhpNameGenerator.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

    Consider simplifying this complex logical expression.
    Open

            if (
                $table
                && $table->getDatabase()
                && ($table->getSchema() || $table->getDatabase()->getSchema())
                && $table->getDatabase()->getPlatform()
    Severity: Major
    Found in src/Propel/Generator/Model/Index.php - About 40 mins to fix

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

              string $leftTableName,
              string $leftColumnName,
              ?string $leftTableAlias,
              $leftColumnValue,
              string $operator = self::EQUAL
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Join.php - About 35 mins to fix

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

            public function bindValue(StatementInterface $stmt, string $parameter, $value, ColumnMap $cMap, ?int $position = null): bool;
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/SqlAdapterInterface.php - About 35 mins to fix

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

              public function bindValue(StatementInterface $stmt, string $parameter, $value, ColumnMap $cMap, ?int $position = null): bool
          Severity: Minor
          Found in src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php - About 35 mins to fix

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

                public function bindValue(StatementInterface $stmt, string $parameter, $value, ColumnMap $cMap, ?int $position = null): bool
            Severity: Minor
            Found in src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language