propelorm/Propel2

View on GitHub

Showing 693 of 740 total issues

Function getInstance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function getInstance(string $className, $arguments = null, ?string $interfaceName = null): object
    {
        if (!class_exists($className)) {
            throw new ClassNotFoundException("Class $className not found.");
        }
Severity: Minor
Found in src/Propel/Generator/Config/GeneratorConfig.php - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildSql(): void
    {
        $sqlDbMapContent = "# Sqlfile -> Database map\n";
        foreach ($this->getDatabases() as $datasource => $database) {
            /** @var \Propel\Generator\Platform\DefaultPlatform $platform */
Severity: Minor
Found in src/Propel/Generator/Manager/SqlManager.php - About 25 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 doFinalInitialization has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function doFinalInitialization(): void
    {
        // Heavy indexing must wait until after all columns composing
        // a table's primary key have been parsed.
        if ($this->heavyIndexing) {
Severity: Minor
Found in src/Propel/Generator/Model/Table.php - About 25 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 getBuildConnections has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBuildConnections(): array
    {
        if ($this->buildConnections !== null) {
            return $this->buildConnections;
        }
Severity: Minor
Found in src/Propel/Generator/Config/GeneratorConfig.php - About 25 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 getParametersFromColumnName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getParametersFromColumnName(?string $columnName = null): array
    {
        $array = [];
        if ($columnName !== null) {
            $this->cleanupParameters();
Severity: Minor
Found in src/Propel/Generator/Behavior/Validate/ValidateBehavior.php - About 25 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 removeParametersFromColumnName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function removeParametersFromColumnName(?string $columnName = null): void
    {
        if ($columnName !== null) {
            $newParams = [];
            $parameters = $this->getParameters();
Severity: Minor
Found in src/Propel/Generator/Behavior/Validate/ValidateBehavior.php - About 25 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 syncUniqueIndexes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function syncUniqueIndexes(Table $archiveTable, array $uniqueIndexes)
    {
        foreach ($uniqueIndexes as $unique) {
            $index = new Index();
            $index->setTable($archiveTable);
Severity: Minor
Found in src/Propel/Generator/Behavior/Archivable/ArchivableBehavior.php - About 25 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 getColumnSize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getColumnSize(string $name, bool $caseInsensitive = false): ?int
    {
        if ($caseInsensitive) {
            foreach ($this->columnsSize as $forName => $size) {
                if (strcasecmp($forName, $name) === 0) {
Severity: Minor
Found in src/Propel/Generator/Model/Index.php - About 25 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 syncIndexes has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function syncIndexes(Table $archiveTable, array $indexes, bool $rename)
    {
        foreach ($indexes as $index) {
            $copiedIndex = clone $index;
            if ($rename) {
Severity: Minor
Found in src/Propel/Generator/Behavior/Archivable/ArchivableBehavior.php - About 25 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 validateColumnParameter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function validateColumnParameter(): void
    {
        $columnParameters = $this->getParameter(static::PARAMETER_KEY_COLUMNS);
        if (!$columnParameters) {
            $this->throwInvalidArgumentExceptionWithLocation('At least one column is required');

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

    public function getDatabase(?string $name = null, bool $doFinalInitialization = true): ?Database
    {
        // this is temporary until we'll have a clean solution
        // for packaging datamodels/requiring schemas
        if ($doFinalInitialization) {
Severity: Minor
Found in src/Propel/Generator/Model/Schema.php - About 25 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 addDatabase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addDatabase($database): Database
    {
        if ($database instanceof Database) {
            $platform = null;
            $database->setParentSchema($this);
Severity: Minor
Found in src/Propel/Generator/Model/Schema.php - About 25 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 addAddVersion has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function addAddVersion(string &$script): void
    {
        $versionTable = $this->behavior->getVersionTable();
        $versionARClassName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($versionTable));

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