Showing 49 of 49 total issues

Function _render_join has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _render_join(): ?string
    {
        if (!isset($this->args['join'])) {
            return '';
        }
Severity: Minor
Found in src/Query.php - About 35 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 normalizeDsn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function normalizeDsn($dsn, $user = null, $pass = null)
    {
        // Try to dissect DSN into parts
        $parts = is_array($dsn) ? $dsn : parse_url($dsn);

Severity: Minor
Found in src/Connection.php - About 35 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

Avoid too many return statements within this method.
Open

                return '1 = 1'; // always true
Severity: Major
Found in src/Query.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return $field . ' ' . $cond . ' ' . $value;
    Severity: Major
    Found in src/Query.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  $value = '(' . implode(', ', array_map(function ($v) { return $this->escapeParam($v); }, $value)) . ')';
      Severity: Major
      Found in src/Query.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return $ret;
        Severity: Major
        Found in src/Expression.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return $field . ' ' . $cond . ' ' . $value;
          Severity: Major
          Found in src/Query.php - About 30 mins to fix

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

                protected function consume($expression, string $escapeMode = self::ESCAPE_PARAM)
                {
                    if (!is_object($expression)) {
                        switch ($escapeMode) {
                            case self::ESCAPE_PARAM:
            Severity: Minor
            Found in src/Expression.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 forwardTypeDeclarationSQL has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                                private function forwardTypeDeclarationSQL(string $targetMethodName, array $column): string
                                {
                                    $backtrace = debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS);
                                    foreach ($backtrace as $frame) {
                                        if ($this === ($frame['object'] ?? null)
            Severity: Minor
            Found in src/Connection.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