Showing 246 of 247 total issues

Avoid too many return statements within this method.
Open

                    return $matches[4] ?? $matches[2];
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $matches[2];
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                        return $cmp;
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $matches[4] ?? $matches[2];
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return 0;
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                    return $matches[2];
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

                return $matches[0];
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $a <=> $b;
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

            return 'object ' . print_r($value, true);
Severity: Major
Found in src/Model/Scope/Condition.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $this->getOurModel()->addExpression($fieldName, array_merge($defaults, ['expr' => $fx]));
Severity: Major
Found in src/Reference/HasMany.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $valueStr . ($title !== null ? ' (\'' . $title . '\')' : '');
Severity: Major
Found in src/Model/Scope/Condition.php - About 30 mins to fix

Avoid too many return statements within this method.
Open

        return $convertedSql;
Severity: Major
Found in src/Schema/TestCase.php - About 30 mins to fix

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

    #[\Override]
    protected function afterLoad(Model $entity): void
    {
        $model = $this->getOwner();

Severity: Minor
Found in src/Persistence/Array_/Join.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 initAction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function initAction(Model $model, ?array $fields = null): Action
    {
        if (is_object($model->table)) {
            $tableAction = $this->action($model->table, 'select');

Severity: Minor
Found in src/Persistence/Array_.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 tryLoad has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    #[\Override]
    public function tryLoad(Model $model, $id): ?array
    {
        $model->assertIsModel();

Severity: Minor
Found in src/Persistence/Csv.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 getModelOnlyProperties has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getModelOnlyProperties(): array
    {
        $this->assertIsModel();

        if ((self::$_modelOnlyProperties ?? null) === null) {
Severity: Minor
Found in src/Model.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 getDsqlExpression has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    #[\Override]
    public function getDsqlExpression(Expression $expression): Expression
    {
        $expr = $this->expr;
        if ($expr instanceof \Closure) {
Severity: Minor
Found in src/Field/SqlExpressionField.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 _renderWith has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _renderWith(): ?string
    {
        if (($this->args['with'] ?? []) === []) {
            return '';
        }
Severity: Minor
Found in src/Persistence/Sql/Query.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 convertToPHPValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    #[\Override]
    public function convertToPHPValue($value, AbstractPlatform $platform): ?object
    {
        if ($value === null || trim($value) === '') {
            return null;
Severity: Minor
Found in src/Type/LocalObjectType.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 hasAnyDnsRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function hasAnyDnsRecord(string $domain, array $types = ['MX', 'A', 'AAAA', 'CNAME']): bool
    {
        foreach (array_unique(array_map('strtoupper', $types)) as $t) {
            $dnsConsts = [
                'MX' => \DNS_MX,
Severity: Minor
Found in src/Field/EmailField.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

Severity
Category
Status
Source
Language