propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    protected function addCrossFKCreateQuery(string &$script, CrossForeignKeys $crossFKs): void
    {
        if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
            return;
        }
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 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 addGetPrimaryKeyHash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addGetPrimaryKeyHash(string &$script): void
    {
        // We have to iterate through all the columns so that we know the offset of the primary
        // key columns.
        $n = 0;
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 clean has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function clean(string $content): string
    {
        // line feed
        $content = str_replace("\r\n", "\n", $content);

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 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

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 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

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 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

    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 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

    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 __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct(Criteria $outer, string $clause, $column, $value = null, ?string $tableAlias = null)
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Criterion/AbstractModelCriterion.php - About 35 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 useAbstractInnerQueryCriterion has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  string $abstractInnerQueryCriterionClass,
                  string $relationName,
                  ?string $modelAlias = null,
                  ?string $queryClass = null,
                  ?string $operatorDeclaration = null
          Severity: Minor
          Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.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/PdoAdapter.php - About 35 mins to fix
              Severity
              Category
              Status
              Source
              Language