propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method addSequences has 32 lines of code (exceeds 25 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 1 hr to fix

    Method addDeleteBody has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addDeleteBody(string &$script): void
        {
            $script .= "
            if (\$this->isDeleted()) {
                throw new PropelException(\"This object has already been deleted.\");
    Severity: Minor
    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

      Method normalizeTable has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function normalizeTable(Table $table): void
          {
              if ($table->getPrimaryKey()) {
                  //search if there is already a UNIQUE constraint over the primary keys
                  $pkUniqueExist = false;
      Severity: Minor
      Found in src/Propel/Generator/Platform/SqlitePlatform.php - About 1 hr to fix

        Function appendPsForUniqueClauseTo has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function appendPsForUniqueClauseTo(string &$sb, array &$params): void
            {
                $field = ($this->table === null) ? $this->column : $this->table . '.' . $this->column;
                $db = $this->getAdapter();
                // If selection is case insensitive use ILIKE for PostgreSQL or SQL
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/Criterion/LikeCriterion.php - About 1 hr 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 executeRollbackForDatasource has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function executeRollbackForDatasource(string $datasource, string $sql): void
            {
                $connection = $this->migrationManager->getConnection($datasource);
        
                if ($this->isVerbose()) {
        Severity: Minor
        Found in src/Propel/Generator/Command/Executor/RollbackExecutor.php - About 1 hr 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 setAttribute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setAttribute($attribute, $value): bool
            {
                if (is_string($attribute)) {
                    if (strpos($attribute, '::') === false) {
                        if (defined('\PDO::' . $attribute)) {
        Severity: Minor
        Found in src/Propel/Runtime/Connection/ConnectionWrapper.php - About 1 hr 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 addPrimaryKey has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addPrimaryKey(Table $table, int $oid): void
            {
                $stmt = $this->dbh->prepare("SELECT
                    DISTINCT ON(cls.relname)
                    cls.relname as idxname,
        Severity: Minor
        Found in src/Propel/Generator/Reverse/PgsqlSchemaParser.php - About 1 hr 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 addCrossFKDoAdd has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addCrossFKDoAdd(string &$script, CrossForeignKeys $crossFKs): void
            {
                $selfRelationNamePlural = $this->getFKPhpNameAffix($crossFKs->getIncomingForeignKey(), true);
                $relatedObjectClassName = $this->getCrossFKsPhpNameAffix($crossFKs, false);
                $className = $this->getClassNameFromTable($crossFKs->getIncomingForeignKey()->getTable());
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 addCrossFKInit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addCrossFKInit(string &$script, CrossForeignKeys $crossFKs): void
            {
                $inits = [];
        
                if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 addSaveBody has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addSaveBody(string &$script): void
            {
                $table = $this->getTable();
                $reloadOnUpdate = $table->isReloadOnUpdate();
                $reloadOnInsert = $table->isReloadOnInsert();
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 addEnsureConsistency has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

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

            protected function addCrossFKGet(string &$script, CrossForeignKeys $crossFKs): void
            {
                $refFK = $crossFKs->getIncomingForeignKey();
                $selfRelationName = $this->getFKPhpNameAffix($refFK, false);
                $crossRefTableName = $crossFKs->getMiddleTable()->getName();
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 includeExternalSchemas has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function includeExternalSchemas(DOMDocument $dom, string $srcDir): int
            {
                $databaseNode = $dom->getElementsByTagName('database')->item(0);
                $externalSchemaNodes = $dom->getElementsByTagName('external-schema');
        
        
        Severity: Minor
        Found in src/Propel/Generator/Manager/AbstractManager.php - About 1 hr 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 getAddTableDDL has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getAddTableDDL(Table $table): string
            {
                $table = clone $table;
                $tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
        
        
        Severity: Minor
        Found in src/Propel/Generator/Platform/SqlitePlatform.php - About 1 hr 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 getSharedFks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function getSharedFks(Column $fromColumn, Column $toColumn): array
            {
                $sharedKeys = [];
        
                foreach (['getReferrers', 'getForeignKeys'] as $getFk) {
        Severity: Minor
        Found in src/Propel/Generator/Platform/Util/MysqlUuidMigrationBuilder.php - About 1 hr 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 getUsingCast has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getUsingCast(Column $fromColumn, Column $toColumn): string
            {
                $fromSqlType = strtoupper($fromColumn->getDomain()->getSqlType());
                $toSqlType = strtoupper($toColumn->getDomain()->getSqlType());
                $name = $fromColumn->getName();
        Severity: Minor
        Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 hr 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 addJoin has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function addJoin($left, $right, ?string $joinType = null)
            {
                if (is_array($left) && is_array($right)) {
                    $conditions = [];
                    foreach ($left as $key => $value) {
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 1 hr to fix

          Method buildJoinCondition has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function buildJoinCondition(Criteria $c): void
              {
                  /** @var \Propel\Runtime\ActiveQuery\Criterion\AbstractCriterion|null $joinCondition */
                  $joinCondition = null;
                  for ($i = 0; $i < $this->count; $i++) {
          Severity: Minor
          Found in src/Propel/Runtime/ActiveQuery/Join.php - About 1 hr to fix

            Method convertDOMElementToArray has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function convertDOMElementToArray(DOMNode $data): array
                {
                    $array = [];
                    $elementNames = [];
                    /** @var \DOMElement $element */
            Severity: Minor
            Found in src/Propel/Runtime/Parser/XmlParser.php - About 1 hr to fix

              Method arrayToDOM has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function arrayToDOM(array $array, DOMElement $rootElement, ?string $charset = null): DOMElement
                  {
                      foreach ($array as $key => $value) {
                          if (is_numeric($key)) {
                              $key = $rootElement->nodeName;
              Severity: Minor
              Found in src/Propel/Runtime/Parser/XmlParser.php - About 1 hr to fix
                Severity
                Category
                Status
                Source
                Language