php-vivace/db

View on GitHub

Showing 47 of 71 total issues

File Driver.php has 535 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Created by PhpStorm.
 * User: macbookpro
 * Date: 15.02.2018
Severity: Major
Found in src/sql/MySQL/Driver.php - About 1 day to fix

    Function select has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        protected static function select(array &$stack, Statement\Select $statement)
        {
            self::literal($stack, 'SELECT ');
    
            if (!$statement->projection) {
    Severity: Minor
    Found in src/sql/PostgreSQL/Driver.php - About 1 day 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

    File Driver.php has 516 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Created by PhpStorm.
     * User: macbookpro
     * Date: 15.02.2018
    Severity: Major
    Found in src/sql/PostgreSQL/Driver.php - About 1 day to fix

      Function select has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function select(array &$stack, Statement\Select $statement)
          {
              self::literal($stack, 'SELECT ');
      
              if (!$statement->projection) {
      Severity: Minor
      Found in src/sql/MySQL/Driver.php - About 6 hrs 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 build has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          public function build($statement): array
          {
              $stack = [];
              $sql = [];
              $values = [];
      Severity: Minor
      Found in src/sql/MySQL/Driver.php - About 6 hrs 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 build has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
      Open

          public function build($statement): array
          {
              $stack = [];
              $sql = [];
              $values = [];
      Severity: Minor
      Found in src/sql/PostgreSQL/Driver.php - About 6 hrs 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 populate has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          function populate(array &$data, string $field)
          {
              $finder = $this->storage->find();
              if ($this->filter) {
                  $finder = $finder->filter($this->filter);
      Severity: Minor
      Found in src/Relation/Single.php - About 5 hrs 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 populate has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

          function populate(array &$data, string $field)
          {
              $finder = $this->storage->find();
              if ($this->filter) {
                  $finder = $finder->filter($this->filter);
      Severity: Minor
      Found in src/Relation/Many.php - About 4 hrs 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

      Method build has 111 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function build($statement): array
          {
              $stack = [];
              $sql = [];
              $values = [];
      Severity: Major
      Found in src/sql/PostgreSQL/Driver.php - About 4 hrs to fix

        Method build has 111 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function build($statement): array
            {
                $stack = [];
                $sql = [];
                $values = [];
        Severity: Major
        Found in src/sql/MySQL/Driver.php - About 4 hrs to fix

          Function save has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              public function save(array $data): bool
              {
                  $columns = [];
                  $values = [];
          
          
          Severity: Minor
          Found in src/sql/Storage.php - About 4 hrs 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 normalizeFilter has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function normalizeFilter(?array $projection, array $filter): array
              {
                  if (!$filter) {
                      return $filter;
                  }
          Severity: Minor
          Found in src/sql/Finder.php - About 4 hrs 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

          Method schema has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function schema(string $source, bool $refresh = false): Schema
              {
                  if (!$refresh && isset($this->schemas[$source])) {
                      return $this->schemas[$source];
                  }
          Severity: Major
          Found in src/sql/Driver.php - About 4 hrs to fix

            Function insert has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function insert(array &$stack, Statement\Insert $statement)
                {
                    self::literal($stack, 'INSERT INTO ');
                    self::identifier($stack, $statement->source);
                    self::literal($stack, ' (');
            Severity: Minor
            Found in src/sql/PostgreSQL/Driver.php - About 3 hrs 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

            Method select has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected static function select(array &$stack, Statement\Select $statement)
                {
                    self::literal($stack, 'SELECT ');
            
                    if (!$statement->projection) {
            Severity: Major
            Found in src/sql/PostgreSQL/Driver.php - About 2 hrs to fix

              Function insert has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function insert(array &$stack, Statement\Insert $statement)
                  {
                      self::literal($stack, 'INSERT INTO ');
                      self::identifier($stack, $statement->source);
                      self::literal($stack, ' (');
              Severity: Minor
              Found in src/sql/MySQL/Driver.php - About 2 hrs 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

              Method normalizeFilter has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function normalizeFilter(?array $projection, array $filter): array
                  {
                      if (!$filter) {
                          return $filter;
                      }
              Severity: Major
              Found in src/sql/Finder.php - About 2 hrs to fix

                Function update has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function update(array &$stack, Statement\Update $statement)
                    {
                        self::literal($stack, 'UPDATE ');
                        if ($statement->offset) {
                            self::identifier($stack, $statement->source);
                Severity: Minor
                Found in src/sql/MySQL/Driver.php - About 2 hrs 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

                Method populate has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function populate(array &$data, string $field)
                    {
                        $finder = $this->storage->find();
                        if ($this->filter) {
                            $finder = $finder->filter($this->filter);
                Severity: Major
                Found in src/Relation/Single.php - About 2 hrs to fix

                  Method populate has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function populate(array &$data, string $field)
                      {
                          $finder = $this->storage->find();
                          if ($this->filter) {
                              $finder = $finder->filter($this->filter);
                  Severity: Major
                  Found in src/Relation/Many.php - About 2 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language