propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Method buildSchema has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $schema,
        ?string $dsn = null,
        ?string $user = null,
        ?string $pass = null,
        ?AdapterInterface $adapter = null,
Severity: Minor
Found in src/Propel/Generator/Util/QuickBuilder.php - About 45 mins to fix

    Function fromArray has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function fromArray(array $array, ?string $rootKey = null, bool $isList = false, bool $includeHeading = true): string
        {
            $rows = [];
            if ($isList) {
                if ($includeHeading) {
    Severity: Minor
    Found in src/Propel/Runtime/Parser/CsvParser.php - About 45 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 loadBehavior has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function loadBehavior(array $package): ?array
        {
            if (isset($package['type']) && $package['type'] == self::BEHAVIOR_PACKAGE_TYPE) {
                // find propel behavior information
                if (isset($package['extra'])) {
    Severity: Minor
    Found in src/Propel/Generator/Util/BehaviorLocator.php - About 45 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 executeRollbackToPreviousVersion has a Cognitive Complexity of 8 (exceeds 5 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 45 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

    Method select has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            string $question,
            array $choices,
            ?string $default = null,
            ?int $attempts = null,
            string $errorMessage = 'Value "%s" is invalid',
    Severity: Minor
    Found in src/Propel/Generator/Command/Helper/ConsoleHelper.php - About 45 mins to fix

      Function execute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output): int
          {
              $consoleHelper = new ConsoleHelper($input, $output);
              $this->getHelperSet()->set($consoleHelper);
      
      
      Severity: Minor
      Found in src/Propel/Generator/Command/InitCommand.php - About 45 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 execute has a Cognitive Complexity of 8 (exceeds 5 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 45 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

      Method addPrimaryKey has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $columnName,
              string $phpName,
              string $type,
              bool $isNotNull = false,
              ?int $size = null,
      Severity: Minor
      Found in src/Propel/Runtime/Map/TableMap.php - About 45 mins to fix

        Function addIndexes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addIndexes(Table $table): void
            {
                $columnNamesIndexedByIndexName = $this->getColumnNamesIndexedByIndexName($table);
        
                foreach ($columnNamesIndexedByIndexName as $indexName => $columnNames) {
        Severity: Minor
        Found in src/Propel/Generator/Reverse/OracleSchemaParser.php - About 45 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 addColumnAttributes has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

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

            protected function addClassOpen(string &$script): void
            {
                $table = $this->getTable();
                $tableName = $table->getName();
                $tableDesc = $table->getDescription();
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 45 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 validateDatabaseTables has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function validateDatabaseTables(Database $database): void
            {
                $phpNames = [];
                $namespaces = [];
                foreach ($database->getTables() as $table) {
        Severity: Minor
        Found in src/Propel/Generator/Util/SchemaValidator.php - About 45 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 isDeleteSetNullEmulationNeeded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function isDeleteSetNullEmulationNeeded(): bool
            {
                $table = $this->getTable();
                if ((!$this->getPlatform()->supportsNativeDeleteTrigger() || $this->getBuildProperty('generator.objectModel.emulateForeignKeyConstraints')) && count($table->getReferrers()) > 0) {
                    foreach ($table->getReferrers() as $fk) {
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 45 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 addClassOpen has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addClassOpen(string &$script): void
            {
                if ($this->getChild()->getAncestor()) {
                    $ancestorClassName = $this->getChild()->getAncestor();
                    if ($this->getDatabase()->hasTableByPhpName($ancestorClassName)) {
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php - About 45 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 addFilterByPrimaryKeys has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function addFilterByPrimaryKeys(string &$script): void
            {
                $script .= "
            /**
             * Filter the query by a list of primary keys
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 45 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 addBuildRelations has a Cognitive Complexity of 8 (exceeds 5 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 45 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 addClearRelatedInstancePool has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function addClearRelatedInstancePool(): string
            {
                $table = $this->getTable();
                $relatedClassNames = [];
        
        
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/TableMapBuilder.php - About 45 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

        Method extractCrossInformation has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                CrossForeignKeys $crossFKs,
                $crossFKToIgnore,
                array &$signature,
                array &$shortSignature,
                array &$normalizedShortSignature,
        Severity: Minor
        Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 45 mins to fix

          Function addFKMutator has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function addFKMutator(string &$script, ForeignKey $fk): void
              {
                  $fkTable = $fk->getForeignTable();
                  $interface = $fk->getInterface();
          
          
          Severity: Minor
          Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 45 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