chrisandchris/passive-record-orm

View on GitHub

Showing 149 of 161 total issues

Avoid too many return statements within this method.
Open

                return [
                    'code'   => '( /@brace(brace) )',
                    'params' => null,
                ];

    Avoid too many return statements within this method.
    Open

                    return [
                        'code'   => 'ON ( /@brace(on) )',
                        'params' => null,
                    ];

      Avoid too many return statements within this method.
      Open

                      return [
                          'code'   => 'USING(`' . $params['field'] . '`)',
                          'params' => null,
                      ];

        Avoid too many return statements within this method.
        Open

                        return [
                            'code'   => 'WHERE /@brace(where)',
                            'params' => null,
                        ];

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

              public function mapFromResult(
                  \PDOStatement $statement,
                  Entity $entity = null,
                  $limit = null,
                  array $mappingInfo = []
          Severity: Minor
          Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Mapper/RowMapper.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 testPrepareOptions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function testPrepareOptions()
              {
                  $model = $this->getModel();
          
                  $options = [

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

              public function prepareOptions(array $availableOptions, array &$options)
              {
                  foreach ($availableOptions as $option) {
                      if (!isset($options[$option])) {
                          $options[$option] = null;

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

              public function orderBy(array $orders)
              {
                  $this->append('order');
                  $idx = 0;
                  foreach ($orders as $field => $direction) {
          Severity: Minor
          Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/Builder.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 prepare has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function prepare(SqlQuery $query)
              {
                  $stmt = $this->createStatement(
                      $query->getQuery(),
                      $query->isReadOnly()

          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