RebelCode/sql-cqrs-resource-models-abstract

View on GitHub

Showing 8 of 44 total issues

Method _buildSqlOrderBy has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _buildSqlOrderBy($ordering)
    {
        $orderParts = [];

        foreach ($ordering as $_order) {
Severity: Minor
Found in src/BuildSqlOrderByCapableTrait.php - About 1 hr to fix

    Method _buildSelectSql has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _buildSelectSql(
            $columns,
            $tables,
            $joins = [],
            LogicalExpressionInterface $where = null,
    Severity: Minor
    Found in src/BuildSelectSqlCapableTrait.php - About 1 hr to fix

      Method _buildSelectSql has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $columns,
              $tables,
              $joins = [],
              LogicalExpressionInterface $where = null,
              $ordering = null,
      Severity: Major
      Found in src/BuildSelectSqlCapableTrait.php - About 1 hr to fix

        Method _buildUpdateSql has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _buildUpdateSql(
                $table,
                $changeSet,
                LogicalExpressionInterface $condition = null,
                $ordering = null,
        Severity: Minor
        Found in src/BuildUpdateSqlCapableTrait.php - About 1 hr to fix

          Function _buildSqlOrderBy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _buildSqlOrderBy($ordering)
              {
                  $orderParts = [];
          
                  foreach ($ordering as $_order) {
          Severity: Minor
          Found in src/BuildSqlOrderByCapableTrait.php - About 45 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

          Method _buildUpdateSql has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $table,
                  $changeSet,
                  LogicalExpressionInterface $condition = null,
                  $ordering = null,
                  $limit = null,
          Severity: Minor
          Found in src/BuildUpdateSqlCapableTrait.php - About 45 mins to fix

            Method _buildDeleteSql has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $table,
                    LogicalExpressionInterface $condition = null,
                    $ordering = null,
                    $limit = null,
                    $offset = null,
            Severity: Minor
            Found in src/BuildDeleteSqlCapableTrait.php - About 45 mins to fix

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

                  protected function _buildSqlRecordValues($columns, $record, array $valueHashMap = [])
                  {
                      $data = [];
              
                      foreach ($columns as $_columnName) {
              Severity: Minor
              Found in src/BuildSqlRecordValuesCapableTrait.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