bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

File Calendar.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * CodeIgniter
 *
 * An open source application development framework for PHP
Severity: Minor
Found in system/libraries/Calendar.php - About 2 hrs to fix

    Function send has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function send($tb_data)
        {
            if ( ! is_array($tb_data))
            {
                $this->set_error('The send() method must be passed an array');
    Severity: Minor
    Found in system/libraries/Trackback.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 _reset_data_array has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _reset_data_array(&$data)
        {
            foreach ($this->_field_data as $field => $row)
            {
                if ($row['postdata'] !== NULL)
    Severity: Minor
    Found in system/libraries/Form_validation.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 run has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function run($config = NULL, &$data = NULL)
        {
            $validation_array = empty($this->validation_data)
                ? $_POST
                : $this->validation_data;
    Severity: Minor
    Found in system/libraries/Form_validation.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 directory_map has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        function directory_map($source_dir, $directory_depth = 0, $hidden = FALSE)
        {
            if ($fp = @opendir($source_dir))
            {
                $filedata    = array();
    Severity: Minor
    Found in system/helpers/directory_helper.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 _ci_autoloader has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _ci_autoloader()
        {
            if (file_exists(APPPATH.'config/autoload.php'))
            {
                include(APPPATH.'config/autoload.php');
    Severity: Minor
    Found in system/core/Loader.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 _set_routing has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _set_routing()
        {
            // Load the routes.php file. It would be great if we could
            // skip this for enable_query_strings = TRUE, but then
            // default_controller would be empty ...
    Severity: Minor
    Found in system/core/Router.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 parseRequest has 60 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parseRequest($data = '')
        {
            //-------------------------------------
            //  Get Data
            //-------------------------------------
    Severity: Major
    Found in system/libraries/Xmlrpcs.php - About 2 hrs to fix

      Method sendPayload has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function sendPayload($msg)
          {
              if ($this->proxy === FALSE)
              {
                  $server = $this->server;
      Severity: Major
      Found in system/libraries/Xmlrpc.php - About 2 hrs to fix

        Method image_process_gd has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function image_process_gd($action = 'resize')
            {
                $v2_override = FALSE;
        
                // If the target width/height match the source, AND if the new file name is not equal to the old file name
        Severity: Major
        Found in system/libraries/Image_lib.php - About 2 hrs to fix

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

              public function db_connect($persistent = FALSE)
              {
                  if (isset($this->stricton))
                  {
                      if ($this->stricton)
          Severity: Major
          Found in system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php - About 2 hrs to fix

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

            class CI_URI {
            
                /**
                 * List of cached URI segments
                 *
            Severity: Minor
            Found in system/core/URI.php - About 2 hrs to fix

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

              class CI_Security {
              
                  /**
                   * List of sanitize filename strings
                   *
              Severity: Minor
              Found in system/core/Security.php - About 2 hrs to fix

                Method set_rules has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function set_rules($field, $label = null, $rules = null, $errors = array())
                    {
                        // No reason to set rules if we have no POST data
                        // or a validation array has not been specified
                        if ($this->CI->input->method() !== 'post' && empty($this->validation_data))
                Severity: Major
                Found in system/libraries/Form_validation.php - About 2 hrs to fix

                  File postgre_driver.php has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * CodeIgniter
                   *
                   * An open source application development framework for PHP
                  Severity: Minor
                  Found in system/database/drivers/postgre/postgre_driver.php - About 2 hrs to fix

                    Method join has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function join($table, $cond, $type = '', $escape = NULL)
                        {
                            $type = trim(strtoupper($type).' JOIN');
                            preg_match('#^(NATURAL\s+)?((LEFT|RIGHT|FULL)\s+)?((INNER|OUTER)\s+)?JOIN$#', $type) OR $type = 'JOIN';
                    
                    
                    Severity: Major
                    Found in system/database/DB_query_builder.php - About 2 hrs to fix

                      Method _send_command has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function _send_command($cmd, $data = '')
                          {
                              switch ($cmd)
                              {
                                  case 'hello':
                      Severity: Major
                      Found in system/libraries/Email.php - About 2 hrs to fix

                        Method _set_routing has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function _set_routing()
                            {
                                // Load the routes.php file. It would be great if we could
                                // skip this for enable_query_strings = TRUE, but then
                                // default_controller would be empty ...
                        Severity: Major
                        Found in system/core/Router.php - About 2 hrs to fix

                          Method array_column has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function array_column(array $array, $column_key, $index_key = NULL)
                              {
                                  if ( ! in_array($type = gettype($column_key), array('integer', 'string', 'NULL'), TRUE))
                                  {
                                      if ($type === 'double')
                          Severity: Major
                          Found in system/core/compat/standard.php - About 2 hrs to fix

                            Function open_tag has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function open_tag($the_parser, $name)
                                {
                                    $the_parser = (string) $the_parser;
                            
                                    // If invalid nesting, then return
                            Severity: Minor
                            Found in system/libraries/Xmlrpc.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

                            Severity
                            Category
                            Status
                            Source
                            Language