elcodedocle/gplusraffle

View on GitHub
RaffleDAO.php

Summary

Maintainability
F
4 days
Test Coverage

File RaffleDAO.php has 498 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * gplusraffle - Google API PHP OAuth 2.0 and FusionTables client based raffle
 * management system
 * 
Severity: Minor
Found in RaffleDAO.php - About 7 hrs to fix

    Method pickWinners has 87 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function pickWinners(
            $raffleId, 
            $limit = null, 
            $raffled = null, 
            $tableId = null, 
    Severity: Major
    Found in RaffleDAO.php - About 3 hrs to fix

      Method addRaffle has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function addRaffle(
              $description, 
              $userId, 
              $created = null, 
              $privacy = null, 
      Severity: Major
      Found in RaffleDAO.php - About 2 hrs to fix

        Method getRaffles has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRaffles(
                $raffleId = null,
                $description = null,
                $creatorId = null,
                $participantId = null,
        Severity: Major
        Found in RaffleDAO.php - About 2 hrs to fix

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

              public function getRaffles(
                  $raffleId = null,
                  $description = null,
                  $creatorId = null,
                  $participantId = null,
          Severity: Minor
          Found in RaffleDAO.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

          Function addRaffle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

              public function addRaffle(
                  $description, 
                  $userId, 
                  $created = null, 
                  $privacy = null, 
          Severity: Minor
          Found in RaffleDAO.php - About 1 hr 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 getResultsForRaffleId has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getResultsForRaffleId(
                  $raffleId, 
                  $tableId = null,
                  $userIdAndIdField = null,
                  $fusionTablesService = null
          Severity: Minor
          Found in RaffleDAO.php - About 1 hr 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 pickWinners has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
          Open

              public function pickWinners(
                  $raffleId, 
                  $limit = null, 
                  $raffled = null, 
                  $tableId = null, 
          Severity: Minor
          Found in RaffleDAO.php - About 1 hr 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 getResultsForRaffleId has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getResultsForRaffleId(
                  $raffleId, 
                  $tableId = null,
                  $userIdAndIdField = null,
                  $fusionTablesService = null
          Severity: Minor
          Found in RaffleDAO.php - About 1 hr to fix

            Method deleteRaffle has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function deleteRaffle(
                    $raffleId, 
                    $tableIds = null, 
                    $fusionTablesService = null
                ){
            Severity: Minor
            Found in RaffleDAO.php - About 1 hr to fix

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

                  private function getFilteredDataFromTable(
                      $tableIdOrName,
                      $raffleId = null,
                      $id = null
                  ){
              Severity: Minor
              Found in RaffleDAO.php - About 1 hr to fix

                Method addRaffle has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $description, 
                        $userId, 
                        $created = null, 
                        $privacy = null, 
                        $status = null, 
                Severity: Major
                Found in RaffleDAO.php - About 1 hr to fix

                  Method getRaffles has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $raffleId = null,
                          $description = null,
                          $creatorId = null,
                          $participantId = null,
                          $winnerId = null,
                  Severity: Major
                  Found in RaffleDAO.php - About 50 mins to fix

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

                            $userId, 
                            $raffleId,
                            $comment = null,
                            $joined =  null, 
                            $tableId = null, 
                    Severity: Minor
                    Found in RaffleDAO.php - About 45 mins to fix

                      Consider simplifying this complex logical expression.
                      Open

                              if (
                                  isset($result->columns)&&
                                  is_array($result->columns)&&
                                  $result->columns[0]==='rowid'&&
                                  isset($result->rows)&&
                      Severity: Major
                      Found in RaffleDAO.php - About 40 mins to fix

                        Method addWinner has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                $userId,
                                $raffleId,
                                $raffled, 
                                $tableId = null, 
                                $fusionTablesService = null
                        Severity: Minor
                        Found in RaffleDAO.php - About 35 mins to fix

                          Method pickWinners has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  $raffleId, 
                                  $limit = null, 
                                  $raffled = null, 
                                  $tableId = null, 
                                  $fusionTablesService = null
                          Severity: Minor
                          Found in RaffleDAO.php - About 35 mins to fix

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

                                public function updateRaffleStatus(
                                    $raffleId, 
                                    $status, 
                                    $tableId = null, 
                                    $fusionTablesService = null
                            Severity: Minor
                            Found in RaffleDAO.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 deleteRaffle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function deleteRaffle(
                                    $raffleId, 
                                    $tableIds = null, 
                                    $fusionTablesService = null
                                ){
                            Severity: Minor
                            Found in RaffleDAO.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 deleteParticipant has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function deleteParticipant(
                                    $userId, 
                                    $raffleId, 
                                    $tableId = null, 
                                    $fusionTablesService = null
                            Severity: Minor
                            Found in RaffleDAO.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

                            There are no issues that match your filters.

                            Category
                            Status