elcodedocle/gplusraffle

View on GitHub

Showing 70 of 70 total issues

Method readAdminSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function readAdminSettings($fileName = null){
        if ($fileName === null) { $fileName = $this->fileName; }
        if (file_exists($fileName)){
            require $fileName;
            if (!isset($settings)||!is_array($settings)){
Severity: Minor
Found in AdminDAO.php - About 1 hr to fix

    Function processFail has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function processFail(request,responseText,status,subtitle){
        "use strict";
        var data, response;
        if(
            status === 404 &&
    Severity: Minor
    Found in webapp/webappClientController.js - About 1 hr to fix

      Method process has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function process(){
              
              if (!isset($this->request['collection'])){
                  throw new Exception(
                      'The request does not contain a collection.', 
      Severity: Minor
      Found in MainController.php - About 1 hr to fix

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

                $client_id = null,
                $client_secret = null,
                $redirect_uri = null,
                $adminId = null, 
                $accessToken = null, 
        Severity: Major
        Found in AdminDAO.php - About 1 hr to fix

          Function formatDateTimeString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function formatDateTimeString(dateTimeString){
              "use strict";
              var dateParts = dateTimeString.split(' '),
                  timeParts = dateParts[1].split(':'),
                  dateDateParts = dateParts[0].split('-'),
          Severity: Minor
          Found in webapp/webappClientController.js - About 1 hr to fix

            Function requestAndProcessPageJSONData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            function requestAndProcessPageJSONData(request){
                "use strict";
                var xmlhttp, //intervalID = window.setInterval(processingDots,1000), 
                    spinnerSettings, spinner, params, subtitle;
                if (request.hasOwnProperty('subtitle')){
            Severity: Minor
            Found in webapp/webappClientController.js - 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 processUserAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                private function processUserAction($request = null){
            
                    if ($request === null){
                        $request = $this->request;
                    }
            Severity: Minor
            Found in MainController.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 authenticate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function authenticate($client = null, $code = null, $token = null){
            
                    if ($client === null) { $client = $this->client; }
                    if ($token===null){ $token = $this->token; }
                    
            Severity: Minor
            Found in User.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 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 __construct has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $client_id,
                      $client_secret,
                      $redirect_uri,
                      $token = null,
                      $code = null,
              Severity: Major
              Found in User.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

                  Consider simplifying this complex logical expression.
                  Open

                  if (
                      // not signing in
                      (
                          !isset($_REQUEST['collection'])
                          ||(
                  Severity: Major
                  Found in main.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

                      Avoid deeply nested control flow statements.
                      Open

                                          if (typeof data.data.rows[index][propertyName] !== 'undefined') {
                                              //noinspection JSUnfilteredForInLoop
                                              switch (data.data.columns[propertyName]){
                                                  case 'raffleid':
                                                      //noinspection JSUnfilteredForInLoop
                      Severity: Major
                      Found in webapp/webappClientController.js - About 45 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

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

                              public function updateStatus(
                                  $raffleId, 
                                  $status, 
                                  $userId = null, 
                                  $isAdmin = null, 
                          Severity: Minor
                          Found in Raffle.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

                          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 raffle has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $raffleId, 
                                    $limit = null, 
                                    $userId = null, 
                                    $isAdmin = null, 
                                    $raffleDAO = null
                            Severity: Minor
                            Found in Raffle.php - About 35 mins to fix

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

                                      $accessToken = null, 
                                      $client_id = null, 
                                      $client_secret = null, 
                                      $redirect_uri = null, 
                                      $client = null
                              Severity: Minor
                              Found in AdminDAO.php - About 35 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
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language