propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    protected function addClassOpen(string &$script): void
    {
        if ($this->getChild()->getAncestor()) {
            $ancestorClassName = $this->getChild()->getAncestor();
            if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
Severity: Minor
Found in src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.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 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 addIndexes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addIndexes(Table $table): void
    {
        $columnNamesIndexedByIndexName = $this->getColumnNamesIndexedByIndexName($table);

        foreach ($columnNamesIndexedByIndexName as $indexName => $columnNames) {
Severity: Minor
Found in src/Propel/Generator/Reverse/OracleSchemaParser.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 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 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 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

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

            public function addJoinCondition(string $name, string $clause, $value = null, ?string $operator = null, ?int $bindingType = 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

            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