EMSL-MSC/pacifica-reporting

View on GitHub

Showing 207 of 259 total issues

File jsgrid.js has 1961 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * jsGrid v1.5.3 (http://js-grid.com)
 * (c) 2016 Artem Tabalin
 * Licensed under MIT (https://github.com/tabalinas/jsgrid/blob/master/LICENSE)
 */
Severity: Major
Found in application/resources/scripts/jsgrid/jsgrid.js - About 5 days to fix

    File IRI.php has 835 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * IRI parser/serialiser/normaliser
     *
     * @package Requests
    Severity: Major
    Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 2 days to fix

      Function request has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring.
      Open

          public function request($url, $headers = array(), $data = array(), $options = array()) {
              $options['hooks']->dispatch('fsockopen.before_request');
      
              $url_parts = parse_url($url);
              $host = $url_parts['host'];

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

          protected function remove_iunreserved_percent_encoded($match)
          {
              // As we just have valid percent encoded sequences we can just explode
              // and ignore the first member of the returned array (an empty string).
              $bytes = explode('%', $match[0]);
      Severity: Minor
      Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 7 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

      File reporting.js has 451 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      var hc_pie_options = {
          credits: false,
          chart: {
              animation: false,
              plotBackgroundColor: null,
      Severity: Minor
      Found in application/resources/scripts/reporting.js - About 6 hrs to fix

        Function replace_invalid_with_pct_encoding has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = FALSE)
            {
                // Normalize as many pct-encoded sections as possible
                $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array(&$this, 'remove_iunreserved_percent_encoded'), $string);
        
        
        Severity: Minor
        Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 6 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 request has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function request($url, $headers = array(), $data = array(), $options = array()) {
                $options['hooks']->dispatch('fsockopen.before_request');
        
                $url_parts = parse_url($url);
                $host = $url_parts['host'];

          Function absolutize has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function absolutize($base, $relative)
              {
                  if (!($relative instanceof Requests_IRI))
                  {
                      $relative = new Requests_IRI($relative);
          Severity: Minor
          Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 6 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 setup_db_structure has 161 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function setup_db_structure()
              {
                  //check for database existence
                  $this->load->database('default');
                  $this->load->dbforge();
          Severity: Major
          Found in application/models/System_setup_model.php - About 6 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                            if (
                                // Invalid sequences
                                !$valid
                                // Non-shortest form sequences are invalid
                                || $length > 1 && $character <= 0x7F
            Severity: Critical
            Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 6 hrs to fix

              File Compliance_model.php has 411 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /**
               * Pacifica
               *
               * Pacifica is an open-source data management framework designed
              Severity: Minor
              Found in application/models/Compliance_model.php - About 5 hrs to fix

                File Requests.php has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * Requests for PHP
                 *
                 * Inspired by Requests for Python.
                Severity: Minor
                Found in application/third_party/Requests-1.7.0/library/Requests.php - About 5 hrs to fix

                  Function utf8_to_codepoints has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected static function utf8_to_codepoints($input) {
                          $codepoints = array();
                  
                          // Get number of bytes
                          $strlen = strlen($input);

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

                      public function update_object_preferences($object_type, $object_list, $group_id)
                      {
                          $table        = 'reporting_selection_prefs';
                          $additions    = array();
                          $removals     = array();
                  Severity: Minor
                  Found in application/models/Group_info_model.php - About 4 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

                  File Group.php has 363 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * Pacifica
                   *
                   * Pacifica is an open-source data management framework designed
                  Severity: Minor
                  Found in application/controllers/Group.php - About 4 hrs to fix

                    Method view has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function view(
                            $object_type = false,
                            $time_range = false,
                            $start_date = false,
                            $end_date = false,
                    Severity: Major
                    Found in application/controllers/Group.php - About 4 hrs to fix

                      Function load_compliance_report has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var load_compliance_report = function(destination_object, month, year){
                          $("#compliance_loading_screen").show();
                          $("#booking_results_error").hide();
                          $("#search_results_display").fadeOut();
                          $("#booking_results_display").empty();
                      Severity: Major
                      Found in application/resources/scripts/compliance.js - About 4 hrs to fix

                        Function _get_reporting_info_list_base has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function _get_reporting_info_list_base(
                                $object_type,
                                $group_id,
                                $time_basis,
                                $time_range,
                        Severity: Minor
                        Found in application/controllers/Group.php - About 4 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 punycode_encode has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static function punycode_encode($input) {
                                $output = '';
                        #        let n = initial_n
                                $n = self::BOOTSTRAP_INITIAL_N;
                        #        let delta = 0

                        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 (
                                        // Invalid sequences
                                        !$valid
                                        // Non-shortest form sequences are invalid
                                        || $length > 1 && $character <= 0x7F
                        Severity: Critical
                        Found in application/third_party/Requests-1.7.0/library/Requests/IRI.php - About 4 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language