propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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

    public function buildSQL(ConnectionInterface $con): int
    {
        $sql = $this->getSQL();
        $statements = SqlParser::parseString($sql);
        foreach ($statements as $statement) {
Severity: Minor
Found in src/Propel/Generator/Util/QuickBuilder.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 extractCrossInformation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function extractCrossInformation(
        CrossForeignKeys $crossFKs,
        $crossFKToIgnore,
        array &$signature,
        array &$shortSignature,
Severity: Minor
Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.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 isDeleteCascadeEmulationNeeded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function isDeleteCascadeEmulationNeeded(): 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 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

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

    protected function addRefFKGetJoinMethods(string &$script, ForeignKey $refFK): void
    {
        $table = $this->getTable();
        $tblFK = $refFK->getTable();
        $joinBehavior = $this->getBuildProperty('generator.objectModel.useLeftJoinsInDoJoinMethods') ? 'Criteria::LEFT_JOIN' : 'Criteria::INNER_JOIN';
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 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 getBehavior has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBehavior(string $name): string
    {
        if (strpos($name, '\\') !== false) {
            $class = $name;
        } else {
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 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 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

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

        protected function addGetPrimaryKeyHash(string &$script): void
        {
            // We have to iterate through all the columns so that we know the offset of the primary
            // key columns.
            $n = 0;
    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 rollBack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function rollBack(): bool
        {
            $return = true;
            $opcount = $this->nestedTransactionCount;
    
    
    Severity: Minor
    Found in src/Propel/Runtime/Connection/ConnectionWrapper.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 getRelation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRelation(): ?RelationMap
        {
            if (!$this->relatedTableName) {
                return null;
            }
    Severity: Minor
    Found in src/Propel/Runtime/Map/ColumnMap.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
        {
            $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 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

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

        protected function addApplyDefaultValuesBody(string &$script): void
        {
            $table = $this->getTable();
            // FIXME - Apply support for PHP default expressions here
            // see: http://propel.phpdb.org/trac/ticket/378
    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