propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method getConfiguredPlatform has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getConfiguredPlatform(?ConnectionInterface $con = null, ?string $database = null): ?PlatformInterface
    {
        $platform = $this->get()['generator']['platformClass'];

        if ($platform === null) {
Severity: Minor
Found in src/Propel/Generator/Config/GeneratorConfig.php - About 1 hr to fix

    Method addObjectGetSyncParent has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addObjectGetSyncParent(string &$script): void
        {
            $parentTable = $this->getParentTable();
            $pkeys = $parentTable->getPrimaryKey();
            $cptype = $pkeys[0]->getPhpType();

      Method isColumnForeignKeyOrDuplicated has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function isColumnForeignKeyOrDuplicated(Column $column): bool
          {
              $delegateTable = $column->getTable();
              $table = $this->getTable();
              $fks = [];
      Severity: Minor
      Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 1 hr to fix

        Method moveI18nColumns has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function moveI18nColumns(): void
            {
                $table = $this->getTable();
                $i18nTable = $this->i18nTable;
        
        
        Severity: Minor
        Found in src/Propel/Generator/Behavior/I18n/I18nBehavior.php - About 1 hr to fix

          Method addColumn has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  string $name,
                  string $phpName,
                  string $type,
                  bool $isNotNull = false,
                  ?int $size = null,
          Severity: Major
          Found in src/Propel/Runtime/Map/TableMap.php - About 1 hr to fix

            Method cleanupSQL has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function cleanupSQL(string &$sql, array &$params, Criteria $values, DatabaseMap $dbMap): void
                {
                    $i = 1;
                    $paramCols = [];
                    foreach ($params as $param) {
            Severity: Minor
            Found in src/Propel/Runtime/Adapter/Pdo/MssqlAdapter.php - About 1 hr to fix

              Method convert has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function convert(string $xmlToParse): array
                  {
                      $isFile = file_exists($xmlToParse);
              
                      if ($isFile) {
              Severity: Minor
              Found in src/Propel/Common/Config/XmlToArrayConverter.php - About 1 hr to fix

                Method executeRollbackToPreviousVersion has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function executeRollbackToPreviousVersion(int $currentVersion, ?int $previousVersion = null): bool
                    {
                        $this->output->writeln(sprintf(
                            'Executing migration %s down',
                            $this->migrationManager->getMigrationClassName($currentVersion),
                Severity: Minor
                Found in src/Propel/Generator/Command/Executor/RollbackExecutor.php - About 1 hr to fix

                  Method addInstancePool has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function addInstancePool(): string
                      {
                          // No need to override instancePool if the PK is not composite
                          if (!$this->getTable()->hasCompositePrimaryKey()) {
                              return '';
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                    Method addFilterByArrayCol has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function addFilterByArrayCol(string &$script, Column $col): void
                        {
                            $singularPhpName = $col->getPhpSingularName();
                            $colName = $col->getName();
                            $variableName = $col->getCamelCaseName();
                    Severity: Minor
                    Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

                      Method mergeStatements has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function mergeStatements(string $sql): string
                          {
                              $sqlParser = new SqlParser();
                              $sqlParser->setSQL($sql);
                              $statements = $sqlParser->explodeIntoStatements();
                      Severity: Minor
                      Found in src/Propel/Generator/Platform/Util/AlterTableStatementMerger.php - About 1 hr to fix

                        Method __construct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __construct(?array $extraConf = [])
                            {
                                if ($extraConf === null) {
                                    $extraConf = [];
                                }
                        Severity: Minor
                        Found in src/Propel/Generator/Config/QuickGeneratorConfig.php - About 1 hr to fix

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

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

                              Function getProfileBetween has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getProfileBetween(array $startSnapshot, array $endSnapshot): string
                                  {
                                      $profile = '';
                              
                                      if ($this->slowThreshold) {
                              Severity: Minor
                              Found in src/Propel/Runtime/Util/Profiler.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 getPluralForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getPluralForm(string $root): string
                                  {
                                      // save some time in the case that singular and plural are the same
                                      if (in_array(strtolower($root), $this->uncountable, true)) {
                                          return $root;
                              Severity: Minor
                              Found in src/Propel/Common/Pluralizer/StandardEnglishPluralizer.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 populateRelation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function populateRelation(
                                      string $relation,
                                      ?Criteria $criteria = null,
                                      ?ConnectionInterface $con = null
                                  ) {
                              Severity: Minor
                              Found in src/Propel/Runtime/Collection/ObjectCollection.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 convert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function convert(string $xmlToParse): array
                                  {
                                      $isFile = file_exists($xmlToParse);
                              
                                      if ($isFile) {
                              Severity: Minor
                              Found in src/Propel/Common/Config/XmlToArrayConverter.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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function __construct($leftColumn = null, $rightColumn = null, ?string $joinType = null)
                                  {
                                      if ($leftColumn !== null && $rightColumn !== null) {
                                          if (is_array($leftColumn) && is_array($rightColumn)) {
                                              // join with multiple conditions
                              Severity: Minor
                              Found in src/Propel/Runtime/ActiveQuery/Join.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 getClause has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getClause(array &$params): string
                                  {
                                      if ($this->joinCondition === null) {
                                          $conditions = [];
                                          for ($i = 0; $i < $this->count; $i++) {
                              Severity: Minor
                              Found in src/Propel/Runtime/ActiveQuery/Join.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