propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method execute has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $configOptions = [];

        if ($this->hasInputOption('connection', $input)) {
Severity: Minor
Found in src/Propel/Generator/Command/MigrationCreateCommand.php - About 1 hr to fix

    Method addDoInsertBodyWithIdMethod has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addDoInsertBodyWithIdMethod(): string
        {
            $table = $this->getTable();
            $script = '';
            foreach ($table->getPrimaryKey() as $col) {
    Severity: Minor
    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

      Method addBuildRelations has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addBuildRelations(string &$script): void
          {
              $script .= "
          /**
           * Build the RelationMap objects for this table relationships
      Severity: Minor
      Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

        Method buildModel has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function buildModel(): Database
            {
                /** @var \Propel\Generator\Config\GeneratorConfig $config */
                $config = $this->getGeneratorConfig();
                $connection = $this->getConnection();
        Severity: Minor
        Found in src/Propel/Generator/Manager/ReverseManager.php - About 1 hr to fix

          Method getClassesForTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getClassesForTable(Table $table, ?array $classTargets = null): string
              {
                  $classTargets = $classTargets ?? $this->classTargets;
                  $script = '';
          
          
          Severity: Minor
          Found in src/Propel/Generator/Util/QuickBuilder.php - About 1 hr to fix

            Method addPrune has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addPrune(string &$script): void
                {
                    $table = $this->getTable();
                    $class = $this->getObjectClassName();
                    $objectName = '$' . $table->getCamelCaseName();
            Severity: Minor
            Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

              Method getDefaultValueString has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getDefaultValueString(Column $column): string
                  {
                      $defaultValue = var_export(null, true);
                      $val = $column->getPhpDefaultValue();
                      if ($val === null) {
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                Method addTemporalMutator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addTemporalMutator(string &$script, Column $col): void
                    {
                        $clo = $col->getLowercasedName();
                
                        $dateTimeClass = $this->getDateTimeClass($col);
                Severity: Minor
                Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

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

                      public function getAddTableDDL(Table $table): string
                      {
                          $ret = $this->getUseSchemaDDL($table);
                          $ret .= $this->getAddSequenceDDL($table);
                  
                  
                  Severity: Minor
                  Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 hr to fix

                    Method setRelationMap has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function setRelationMap(RelationMap $relationMap, ?string $leftTableAlias = null, ?string $relationAlias = null)
                        {
                            $leftCols = $relationMap->getLeftColumns();
                            $rightCols = $relationMap->getRightColumns();
                            $leftValues = $relationMap->getLocalValues();
                    Severity: Minor
                    Found in src/Propel/Runtime/ActiveQuery/ModelJoin.php - About 1 hr to fix

                      Method getCriterionForClause has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function getCriterionForClause(string $clause, $value, ?int $bindingType = null): AbstractCriterion
                          {
                              $origin = $clause = trim($clause);
                              if ($this->replaceNames($clause)) {
                                  // at least one column name was found and replaced in the clause
                      Severity: Minor
                      Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 1 hr to fix

                        Method buildLogger has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function buildLogger(string $name = 'defaultLogger'): LoggerInterface
                            {
                                if (!isset($this->loggerConfigurations[$name])) {
                                    return $name !== 'defaultLogger' ? $this->getLogger() : new NullLogger();
                                }
                        Severity: Minor
                        Found in src/Propel/Runtime/ServiceContainer/StandardServiceContainer.php - About 1 hr to fix

                          Method execute has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function execute(InputInterface $input, OutputInterface $output): int
                              {
                                  $configOptions = [];
                          
                                  $connection = (string)$input->getArgument('connection');
                          Severity: Minor
                          Found in src/Propel/Generator/Command/DatabaseReverseCommand.php - About 1 hr to fix

                            Method compareColumns has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function compareColumns(bool $caseInsensitive = false): int
                                {
                                    $fromTableColumns = $this->getFromTable()->getColumns();
                                    $toTableColumns = $this->getToTable()->getColumns();
                                    $columnDifferences = 0;
                            Severity: Minor
                            Found in src/Propel/Generator/Model/Diff/TableComparator.php - About 1 hr to fix

                              Method getAddTableDDL has 37 lines of code (exceeds 25 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

                                Method addPopulateObjects has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function addPopulateObjects(string &$script): void
                                    {
                                        $table = $this->getTable();
                                        $script .= "
                                    /**
                                Severity: Minor
                                Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 1 hr to fix

                                  Method addDoOnDeleteSetNull has 36 lines of code (exceeds 25 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

                                    Method addDoOnDeleteCascade has 36 lines of code (exceeds 25 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

                                      Method addColumnAccessorMethods has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function addColumnAccessorMethods(string &$script): void
                                          {
                                              $table = $this->getTable();
                                      
                                              foreach ($table->getColumns() as $col) {
                                      Severity: Minor
                                      Found in src/Propel/Generator/Builder/Om/AbstractObjectBuilder.php - About 1 hr to fix

                                        Function getTemplatePath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            protected function getTemplatePath(string $path): string
                                            {
                                                $srcPos = strrpos($path, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR);
                                                if ($srcPos === false) {
                                                    // BC shim for old template paths
                                        Severity: Minor
                                        Found in src/Propel/Common/Util/PathTrait.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