propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

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

        foreach ($input->getOptions() as $key => $option) {
Severity: Major
Found in src/Propel/Generator/Command/SqlBuildCommand.php - About 2 hrs to fix

    Method addCrossFKInit has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function addCrossFKInit(string &$script, CrossForeignKeys $crossFKs): void
        {
            $inits = [];
    
            if (1 < count($crossFKs->getCrossForeignKeys()) || $crossFKs->getUnclassifiedPrimaryKeys()) {
    Severity: Major
    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

      Method addClearAllReferences has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addClearAllReferences(string &$script): void
          {
              $table = $this->getTable();
              $script .= "
          /**
      Severity: Major
      Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs to fix

        Method appendColumnNode has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function appendColumnNode(Column $column, DOMNode $parentNode): void
            {
                /** @var \DOMElement $columnNode */
                $columnNode = $parentNode->appendChild($this->document->createElement('column'));
                $columnNode->setAttribute('name', $column->getName());
        Severity: Major
        Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 2 hrs to fix

          Method addIsVersioningNecessary has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function addIsVersioningNecessary(string &$script): void
              {
                  $queryClassName = $this->builder->getQueryClassName();
          
                  $script .= "

            Method addFilterByFk has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addFilterByFk(string &$script, ForeignKey $fk): void
                {
                    $this->declareClasses(
                        '\Propel\Runtime\Collection\ObjectCollection',
                        '\Propel\Runtime\Exception\PropelException',
            Severity: Major
            Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 2 hrs to fix

              Method getModifyTableDDL has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getModifyTableDDL(TableDiff $tableDiff): string
                  {
                      $ret = '';
              
                      $toTable = $tableDiff->getToTable();
              Severity: Major
              Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 2 hrs to fix

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

                    public static function convert(array $c): string
                    {
                        $conf = [];
                        // set datasources
                        if (isset($c['connections'])) {
                Severity: Major
                Found in src/Propel/Generator/Config/ArrayToPhpConverter.php - About 2 hrs to fix

                  Method addMoveSubtreeTo has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function addMoveSubtreeTo(string &$script): void
                      {
                          $queryClassName = $this->builder->getQueryClassName();
                          $tableMapClass = $this->builder->getTableMapClass();
                          $useScope = $this->behavior->useScope();

                    Function create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function create(
                            array $configuration,
                            AdapterInterface $adapter,
                            string $defaultConnectionClass = self::DEFAULT_CONNECTION_CLASS
                        ): ConnectionInterface {
                    Severity: Minor
                    Found in src/Propel/Runtime/Connection/ConnectionFactory.php - About 2 hrs 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 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function execute(InputInterface $input, OutputInterface $output): int
                        {
                            $configOptions = [];
                    
                            foreach ($input->getOptions() as $key => $option) {
                    Severity: Minor
                    Found in src/Propel/Generator/Command/SqlBuildCommand.php - About 2 hrs 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 toArray has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function toArray(string $data, ?string $rootKey = null, bool $isList = false, bool $includeHeading = true): array
                        {
                            $rows = explode($this->lineTerminator, $data);
                            if ($includeHeading) {
                                $heading = array_shift($rows);
                    Severity: Minor
                    Found in src/Propel/Runtime/Parser/CsvParser.php - About 2 hrs 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 getDefaultValueString has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 getClassesForTable has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 addFKAccessor has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function addFKAccessor(string &$script, ForeignKey $fk): void
                        {
                            $varName = $this->getFKVarName($fk);
                            $fkQueryBuilder = $this->getNewStubQueryBuilder($fk->getForeignTable());
                            $fkObjectBuilder = $this->getNewObjectBuilder($fk->getForeignTable())->getStubObjectBuilder();
                    Severity: Minor
                    Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 2 hrs 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 normalizeTable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function normalizeTable(Table $table): void
                        {
                            if ($table->hasForeignKeys()) {
                                foreach ($table->getForeignKeys() as $fk) {
                                    if ($fk->getForeignTable() && !$fk->getForeignTable()->isUnique($fk->getForeignColumnObjects())) {
                    Severity: Minor
                    Found in src/Propel/Generator/Platform/DefaultPlatform.php - About 2 hrs 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 getAddTableDDL has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getAddTableDDL(Table $table): string
                        {
                            $lines = [];
                    
                            foreach ($table->getColumns() as $column) {
                    Severity: Minor
                    Found in src/Propel/Generator/Platform/MysqlPlatform.php - About 2 hrs 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 setSchema has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function setSchema(?string $schema): void
                        {
                            $oldSchema = $this->schema;
                            if ($this->schema !== $schema && $this->getPlatform()) {
                                $schemaDelimiter = $this->getPlatform()->getSchemaDelimiter();
                    Severity: Minor
                    Found in src/Propel/Generator/Model/Database.php - About 2 hrs 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 isColumnForeignKeyOrDuplicated has a Cognitive Complexity of 16 (exceeds 5 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 2 hrs 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 addUpdateLoadedNodes has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function addUpdateLoadedNodes(string &$script): void
                        {
                            $queryClassName = $this->queryClassName;
                            $objectClassName = $this->objectClassName;
                            $tableMapClassName = $this->tableMapClassName;

                    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