propelorm/Propel2

View on GitHub

Showing 740 of 740 total issues

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 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 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 commit has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function commit(): bool
          {
              $return = true;
              $opcount = $this->nestedTransactionCount;
      
      
      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 convertValueForColumn has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function convertValueForColumn($value, ColumnMap $colMap)
          {
              if ($colMap->getType() === 'OBJECT' && is_object($value)) {
                  $value = serialize($value);
              } elseif ($colMap->getType() === 'ARRAY' && is_array($value)) {
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.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 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 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 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

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

          public function init(?ConnectionInterface $con = null): void
          {
              $this->con = $con;
              $maxRecordLimit = $this->getMaxRecordLimit();
              $hasMaxRecordLimit = (bool)$maxRecordLimit;
      Severity: Minor
      Found in src/Propel/Runtime/Util/PropelModelPager.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 execute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output): int
          {
              $configOptions = [];
      
              if ($this->hasInputOption('output-dir', $input)) {
      Severity: Minor
      Found in src/Propel/Generator/Command/MigrationDownCommand.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 addClearAllReferences has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addClearAllReferences(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 addDoOnDeleteSetNull has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

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

          protected function getCrossRefFKRemoveObjectNames(CrossForeignKeys $crossFKs, ForeignKey $excludeFK): string
          {
              $names = [];
      
              $fks = $crossFKs->getCrossForeignKeys();
      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 addClear has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function addClear(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 addDoOnDeleteCascade has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

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

          protected function getTableOptions(Table $table): array
          {
              $vi = $table->getVendorInfoForType('mysql');
              $tableOptions = [];
              // List of supported table options
      Severity: Minor
      Found in src/Propel/Generator/Platform/MysqlPlatform.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 getMigrationTimestamps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getMigrationTimestamps(): array
          {
              $path = $this->getWorkingDirectory();
              $migrationTimestamps = [];
      
      
      Severity: Minor
      Found in src/Propel/Generator/Manager/MigrationManager.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 getConfiguredPlatform has a Cognitive Complexity of 10 (exceeds 5 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

      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