Showing 229 of 251 total issues

Avoid too many return statements within this method.
Open

        return $this->_renderConditionBinary($operator, $field, $value);
Severity: Major
Found in src/Persistence/Sql/Query.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 $cmp;
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 $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 $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 '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 $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 $convertedSql;
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 $this->refLink()->action('fx', $args);
Severity: Major
Found in src/Reference/HasMany.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

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

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

    public function insert(array $row)
    {
        $entity = $this->createEntity();

        $hasRefs = false;
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 escapeStringLiteral has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    #[\Override]
    protected function escapeStringLiteral(string $value): string
    {
        $parts = [];
        foreach (preg_split('~((?:\x00+[^\x00]{1,100})*\x00+)~', $value, -1, \PREG_SPLIT_DELIM_CAPTURE) as $i => $v) {
Severity: Minor
Found in src/Persistence/Sql/Mysql/ExpressionTrait.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