propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    public function modifyDatabase(): void
    {
        foreach ($this->getDatabase()->getTables() as $table) {
            if ($table->hasBehavior($this->getId())) {
                // don't add the same behavior twice
Severity: Minor
Found in src/Propel/Generator/Behavior/Versionable/VersionableBehavior.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 staticAttributes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function staticAttributes(AbstractOMBuilder $builder): string
    {
        $tableName = $this->table->getName();
        $col = '';

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

Avoid too many return statements within this method.
Open

                return true;
Severity: Major
Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return new BinaryCriterion($criteria, $column, $value, $comparison);
    Severity: Major
    Found in src/Propel/Runtime/ActiveQuery/Criterion/CriterionFactory.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return false;
      Severity: Major
      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return new BasicCriterion($criteria, $column, $value, $comparison);
        Severity: Major
        Found in src/Propel/Runtime/ActiveQuery/Criterion/CriterionFactory.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return new BasicModelCriterion($this, $clause, $colMap, $value, $this->currentAlias);
          Severity: Major
          Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return new LikeCriterion($criteria, $column, $value, $comparison);
            Severity: Major
            Found in src/Propel/Runtime/ActiveQuery/Criterion/CriterionFactory.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return false;
              Severity: Major
              Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return new CustomCriterion($this, $clause);
                Severity: Major
                Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return [null, null];
                  Severity: Major
                  Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return false;
                    Severity: Major
                    Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                          return false;
                      Severity: Major
                      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return new RawCriterion($this, $clause, $value, $bindingType);
                        Severity: Major
                        Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return $value;
                          Severity: Major
                          Found in src/Propel/Common/Config/XmlToArrayConverter.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return new SeveralModelCriterion($this, $clause, $colMap, $value, $this->currentAlias);
                            Severity: Major
                            Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                          return $replaced;
                              Severity: Major
                              Found in src/Propel/Common/Config/Loader/FileLoader.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return $this->resolveValue($this->get($onlyKey), $resolving);
                                Severity: Major
                                Found in src/Propel/Common/Config/Loader/FileLoader.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                                      return false;
                                  Severity: Major
                                  Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                    return true;
                                    Severity: Major
                                    Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language