propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Function format has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function format(?DataFetcherInterface $dataFetcher = null)
    {
        $this->checkInit();

        if ($dataFetcher) {
Severity: Minor
Found in src/Propel/Runtime/Formatter/SimpleArrayFormatter.php - About 35 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 getBuildName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBuildName(?array $classTargets = null): string
    {
        $tables = [];
        foreach ($this->getDatabase()->getTables() as $table) {
            if (count($tables) > 3) {
Severity: Minor
Found in src/Propel/Generator/Util/QuickBuilder.php - About 35 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 addSequences has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addSequences(Database $database): void
    {
        $searchPath = '?';
        $params = [$database->getSchema()];
        if (!$database->getSchema()) {
Severity: Minor
Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 35 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 addCrossFKSet has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addCrossFKSet(string &$script, CrossForeignKeys $crossFKs): void
    {
        $scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);

        $multi = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$crossFKs->getUnclassifiedPrimaryKeys();
Severity: Minor
Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 35 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 addFindPk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addFindPk(string &$script): void
    {
        $class = $this->getObjectClassName();
        $tableMapClassName = $this->getTableMapClassName();
        $table = $this->getTable();
Severity: Minor
Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 35 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 addHashCode has a Cognitive Complexity of 7 (exceeds 5 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 35 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 addFilterByRefFk has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addFilterByRefFk(string &$script, ForeignKey $fk): void
    {
        $this->declareClasses(
            '\Propel\Runtime\Collection\ObjectCollection',
            '\Propel\Runtime\Exception\PropelException',
Severity: Minor
Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addDoInsert(): string
    {
        $table = $this->getTable();
        $script = "
    /**
Severity: Minor
Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 35 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 getRelatedBySuffix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function getRelatedBySuffix(ForeignKey $fk): string
    {
        $relCol = '';

        foreach ($fk->getMapping() as $mapping) {
Severity: Minor
Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 35 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 findMigrationClassNameSuffix has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function findMigrationClassNameSuffix(int $timestamp): string
    {
        $suffix = '';
        $path = $this->getWorkingDirectory();
        if ($path && is_dir($path)) {
Severity: Minor
Found in src/Propel/Generator/Manager/MigrationManager.php - About 35 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 getPrimaryKeyDDL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getPrimaryKeyDDL(Table $table): string
    {
        if ($table->hasPrimaryKey()) {
            $keys = $table->getPrimaryKey();

Severity: Minor
Found in src/Propel/Generator/Platform/MysqlPlatform.php - About 35 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 computeDiff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function computeDiff(Column $fromColumn, Column $toColumn)
    {
        $changedProperties = self::compareColumns($fromColumn, $toColumn);
        if ($changedProperties) {
            if ($fromColumn->hasPlatform() || $toColumn->hasPlatform()) {
Severity: Minor
Found in src/Propel/Generator/Model/Diff/ColumnComparator.php - About 35 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 getAddColumnDDL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAddColumnDDL(Column $column): string
    {
        $pattern = "
ALTER TABLE %s ADD %s %s;
";
Severity: Minor
Found in src/Propel/Generator/Platform/MysqlPlatform.php - About 35 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 getNextTableBehavior has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getNextTableBehavior(): ?Behavior
    {
        // order the behaviors according to Behavior::$tableModificationOrder
        $behaviors = [];
        $nextBehavior = null;
Severity: Minor
Found in src/Propel/Generator/Model/Database.php - About 35 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 queryAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function queryAttributes(): string
    {
        $script = '';
        $collations = '';

Severity: Minor
Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 35 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 objectFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function objectFilter(string &$script): void
    {
        $p = new PhpParser($script, true);
        $text = (string)$p->findMethod('toArray');
        $matches = [];
Severity: Minor
Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 35 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 queryMethods has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function queryMethods(QueryBuilder $builder): string
    {
        $script = '';

        foreach ($this->delegates as $delegate => $type) {
Severity: Minor
Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 35 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 addValidateMethod has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addValidateMethod(): string
    {
        $table = $this->getTable();
        $foreignKeys = $table->getForeignKeys();
        $hasForeignKeys = (count($foreignKeys) != 0);
Severity: Minor
Found in src/Propel/Generator/Behavior/Validate/ValidateBehavior.php - About 35 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 objectFilter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function objectFilter(string &$script, AbstractOMBuilder $builder): void
    {
        if ($this->behavior->useScope()) {
            if ($this->behavior->hasMultipleScopes()) {
                foreach ($this->behavior->getScopes() as $idx => $scope) {

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

    public function modifyTable(): void
    {
        $table = $this->getTable();

        if (!$table->hasColumn($this->getParameter('rank_column'))) {
Severity: Minor
Found in src/Propel/Generator/Behavior/Sortable/SortableBehavior.php - About 35 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