propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

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 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 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 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 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 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 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 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 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 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

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

    public function objectMethods(ObjectBuilder $builder): string
    {
        $this->setBuilder($builder);
        $script = '';

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

    protected function addScopeAccessors(string &$script): void
    {
        $script .= "
/**
 * Wrap the getter for scope value

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

    protected function addLoadValidatorMetadataMethod(): string
    {
        $params = $this->getParameters();
        $constraints = [];

Severity: Minor
Found in src/Propel/Generator/Behavior/Validate/ValidateBehavior.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 addObjectGetSyncParent has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addObjectGetSyncParent(string &$script): void
    {
        $parentTable = $this->getParentTable();
        $pkeys = $parentTable->getPrimaryKey();
        $cptype = $pkeys[0]->getPhpType();

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 equals has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function equals(?object $obj): bool
    {
        // TODO: optimize me with early outs
        if ($this === $obj) {
            return true;
Severity: Minor
Found in src/Propel/Runtime/ActiveQuery/Criterion/AbstractModelCriterion.php - About 1 hr to fix

    Method getConnection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getConnection(array $params): PdoConnection
        {
            $params = $this->prepareParams($params);
    
            if (!isset($params['dsn'])) {
    Severity: Minor
    Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 1 hr to fix

      Method addForeignKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function addForeignKeys(Table $table): void
          {
              $database = $table->getDatabase();
      
              /** @var \Propel\Runtime\DataFetcher\PDODataFetcher $dataFetcher */
      Severity: Minor
      Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 1 hr to fix

        Method toArray has 27 lines of code (exceeds 25 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 1 hr to fix
          Severity
          Category
          Status
          Source
          Language