chrisandchris/passive-record-orm

View on GitHub

Showing 149 of 161 total issues

Method testBag_cast has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testBag_cast()
    {
        $bag = new PgSqlBag();

        $cast = $bag->get('cast');

    ExtendedBuilderTest has 22 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ExtendedBuilderTest extends AbstractBuilderTest
    {
    
        public function testSelect()
        {

      Method testIsOnlyOption has 55 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testIsOnlyOption()
          {
              $model = $this->getModel();
      
              $this->assertTrue(

        File TypeBag.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace ChrisAndChris\Common\RowMapperBundle\Services\Query\Parser;
        
        use ChrisAndChris\Common\RowMapperBundle\Exceptions\InvalidOptionException;

          Method getModel has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getModel(
                  $calcRowCapable = false,
                  SqlQuery $queryMock = null
              ) {
                  $dependencyMock =

            Function updates has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public function updates(array $updates)
                {
                    if (count($updates) < 1) {
                        throw new MalformedQueryException(
                            sprintf('Must update at least one field, %s given', count($updates))
            Severity: Minor
            Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/Builder.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 run has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run(
                    \Closure $process,
                    $eventClass = null,
                    $eventData = null
                ) {
            Severity: Major
            Found in src/ChrisAndChris/Common/RowMapperBundle/Services/BusinessProcess.php - About 2 hrs to fix

              Method testAppendMultipleWrongInput has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function testAppendMultipleWrongInput()
                  {
                      $builder = $this->getBuilder();
                      $array = [0];
                      try {

                Method testSimpleQuery has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function testSimpleQuery()
                    {
                        // @formatter:off
                        $builder = $this->getBuilder();
                        $builder->select()

                  Method testRun has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function testRun()
                      {
                          $mock =
                              $this->getMockBuilder('\ChrisAndChris\Common\RowMapperBundle\Services\Pdo\PdoLayer')
                                   ->disableOriginalConstructor()

                    Method testUpdates has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function testUpdates()
                        {
                            $builder = $this->getBuilder();
                    
                            $builder->updates(

                      Method logOut has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function logOut(
                              $start,
                              $eventClass = null,
                              $result = null,
                              $eventData = null

                        Method append has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function append($typeName, array $params = [])
                            {
                                if ($this->allowAppend() && $this->typeBag->has($typeName)) {
                                    $endParams = [];
                                    $type = $this->typeBag->get($typeName);
                        Severity: Minor
                        Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/Builder.php - About 1 hr to fix

                          Function runCustom has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function runCustom(
                                  SqlQuery $query,
                                  $onSuccess,
                                  $onFailure,
                                  $onError = 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

                          Method updates has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function updates(array $updates)
                              {
                                  if (count($updates) < 1) {
                                      throw new MalformedQueryException(
                                          sprintf('Must update at least one field, %s given', count($updates))
                          Severity: Minor
                          Found in src/ChrisAndChris/Common/RowMapperBundle/Services/Query/Builder.php - About 1 hr to fix

                            Method testAppendMultiple has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function testAppendMultiple()
                                {
                                    $builder = $this->getBuilder();
                                    $array = [0];
                                    $builder->each(

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

                                  public function testIf()
                                  {
                                      $builder = $this->getBuilder();
                              
                                      $builder->_if(true)

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

                                    public function testNestedIf()
                                    {
                                        $builder = $this->getBuilder();
                                
                                        // @formatter:off

                                  Function testBags has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function testBags()
                                      {
                                          /*
                                           * Tests bags for desired behaviour, they must return a string to fulfil the test
                                           */

                                  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 getEntityFiller has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function getEntityFiller() : \Closure
                                      {
                                          return
                                              function (
                                                  Entity &$entity,
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language