propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method getAddTableDDL has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getAddTableDDL(Table $table): string
    {
        $tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';

        $lines = [];
Severity: Minor
Found in src/Propel/Generator/Platform/OraclePlatform.php - About 1 hr to fix

    Method addInsertAsNextSiblingOf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addInsertAsNextSiblingOf(string &$script): void
        {
            $objectClassName = $this->builder->getObjectClassName();
            $queryClassName = $this->builder->getQueryClassName(true);
            $useScope = $this->behavior->useScope();

      Method syncTables has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function syncTables(): Table
          {
              $archiveTable = $this->getArchiveTable();
              $sourceTable = $this->getTable();
      
      
      Severity: Minor
      Found in src/Propel/Generator/Behavior/Archivable/ArchivableBehavior.php - About 1 hr to fix

        Method addMoveToRank has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function addMoveToRank(string &$script): void
            {
                $useScope = $this->behavior->useScope();
                $script .= "
        /**

          Method addInsertAsPrevSiblingOf has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addInsertAsPrevSiblingOf(string &$script): void
              {
                  $objectClassName = $this->builder->getObjectClassName();
                  $queryClassName = $this->builder->getQueryClassName(true);
                  $useScope = $this->behavior->useScope();

            Method addRelation has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    string $name,
                    string $tablePhpName,
                    int $type,
                    array $joinConditionMapping = [],
                    ?string $onDelete = null,
            Severity: Major
            Found in src/Propel/Runtime/Map/TableMap.php - About 1 hr to fix

              Method addForeignPrimaryKey has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      string $columnName,
                      string $phpName,
                      string $type,
                      string $fkTable,
                      string $fkColumn,
              Severity: Major
              Found in src/Propel/Runtime/Map/TableMap.php - About 1 hr to fix

                Method addForeignKey has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        string $columnName,
                        string $phpName,
                        string $type,
                        string $fkTable,
                        string $fkColumn,
                Severity: Major
                Found in src/Propel/Runtime/Map/TableMap.php - About 1 hr to fix

                  Function configureSelectColumns has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function configureSelectColumns(): void
                      {
                          if (!$this->select) {
                              return;
                          }
                  Severity: Minor
                  Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 55 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 quoteIdentifier has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function quoteIdentifier(string $string, string $tableName = ''): string
                      {
                          if ($this->isIdentifierQuotingEnabled()) {
                              $adapter = Propel::getServiceContainer()->getAdapter($this->getDbName());
                  
                  
                  Severity: Minor
                  Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 55 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 commit has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function commit(): bool
                      {
                          $return = true;
                          $opcount = $this->getNestedTransactionCount();
                          if ($opcount > 0) {
                  Severity: Minor
                  Found in src/Propel/Runtime/Adapter/MSSQL/MssqlPropelPDO.php - About 55 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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function __construct(int $error)
                      {
                          $message = 'Error while parsing Json configuration file: ';
                  
                          if (!function_exists('json_last_error_msg')) {
                  Severity: Minor
                  Found in src/Propel/Common/Config/Exception/JsonParseException.php - About 55 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 createDateTime has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected static function createDateTime($value, ?DateTimeZone $timeZone = null, string $dateTimeClass = 'DateTime')
                      {
                          if (static::isTimestamp($value)) { // if it's a unix timestamp
                              $format = 'U';
                              if (strpos($value, '.')) {
                  Severity: Minor
                  Found in src/Propel/Runtime/Util/PropelDateTime.php - About 55 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 loadBehaviorsFromLockFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function loadBehaviorsFromLockFile(SplFileInfo $composerLock): array
                      {
                          $behaviors = [];
                  
                          $json = json_decode($composerLock->getContents(), true);
                  Severity: Minor
                  Found in src/Propel/Generator/Util/BehaviorLocator.php - About 55 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 getBehaviors has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getBehaviors(): array
                      {
                          if ($this->behaviors === null) {
                              // find behaviors in composer.lock file
                              $lock = $this->findComposerLock();
                  Severity: Minor
                  Found in src/Propel/Generator/Util/BehaviorLocator.php - About 55 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 addFilterByFk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addFilterByFk(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 55 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 addReload has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

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

                      protected function addLazyLoaderBody(string &$script, Column $column): void
                      {
                          $platform = $this->getPlatform();
                          $clo = $column->getLowercasedName();
                  
                  
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 55 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 addHasOnlyDefaultValuesBody has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addHasOnlyDefaultValuesBody(string &$script): void
                      {
                          $table = $this->getTable();
                          $colsWithDefaults = [];
                          foreach ($table->getColumns() as $col) {
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 55 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 getI18nColumns has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getI18nColumns(): array
                      {
                          $columns = [];
                          $i18nTable = $this->getI18nTable();
                          $columnNames = $this->getI18nColumnNamesFromConfig();
                  Severity: Minor
                  Found in src/Propel/Generator/Behavior/I18n/I18nBehavior.php - About 55 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