propelorm/Propel2

View on GitHub

Showing 740 of 740 total issues

Method compareForeignKeys has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function compareForeignKeys(bool $caseInsensitive = false): int
    {
        $fkDifferences = 0;
        $fromTableFks = $this->getFromTable()->getForeignKeys();
        $toTableFks = $this->getToTable()->getForeignKeys();
Severity: Minor
Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

    Method getColumnDefaultValueDDL has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getColumnDefaultValueDDL(Column $col): string
        {
            $default = '';
            $defaultValue = $col->getDefaultValue();
            if ($defaultValue !== null) {
    Severity: Minor
    Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 1 hr to fix

      Method addExtraIndices has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function addExtraIndices(): void
          {
              /**
               * A collection of indexed columns. The key is the column name
               * (concatenated with a comma in the case of multi-col index), the value is
      Severity: Minor
      Found in src/Propel/Generator/Model/Table.php - About 1 hr to fix

        Method setupObject has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function setupObject(): void
            {
                parent::setupObject();
        
                $this->commonName = $this->originCommonName = $this->getAttribute('name');
        Severity: Minor
        Found in src/Propel/Generator/Model/Table.php - About 1 hr to fix

          Method queryMethods has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function queryMethods(AbstractOMBuilder $builder): string
              {
                  $this->setBuilder($builder);
                  $this->builder->declareClasses(
                      '\Propel\Runtime\Propel',

            Method modifyTable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function modifyTable(): void
                {
                    $table = $this->getTable();
                    $database = $table->getDatabase();
                    $delegates = explode(',', $this->parameters['to']);
            Severity: Minor
            Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 1 hr to fix

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

                    Severity
                    Category
                    Status
                    Source
                    Language