bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

File User_agent.php has 292 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/User_agent.php - About 3 hrs to fix

    File url_helper.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Method _compile_queries has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _compile_queries()
          {
              $dbs = array();
      
              // Let's determine which databases are currently connected to
      Severity: Major
      Found in system/libraries/Profiler.php - About 3 hrs to fix

        Method _display has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function _display($output = NULL)
            {
                // Note:  We use load_class() because we can't use $CI =& get_instance()
                // since this function is sometimes called by the caching mechanism,
                // which happens before the CI super object is available.
        Severity: Major
        Found in system/core/Output.php - About 3 hrs to fix

          Method _configure has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _configure(&$params)
              {
                  $expiration = config_item('sess_expiration');
          
                  if (isset($params['cookie_lifetime']))
          Severity: Major
          Found in system/libraries/Session/Session.php - About 2 hrs to fix

            Method backup has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function backup($params = array())
                {
                    // If the parameters have not been submitted as an
                    // array then we know that it is simply the table
                    // name, which is a valid short cut.
            Severity: Major
            Found in system/database/DB_utility.php - About 2 hrs to fix

              Method set_cookie has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL, $samesite = NULL)
                  {
                      if (is_array($name))
                      {
                          // always leave 'name' in last place, as the loop will break otherwise, due to $$item
              Severity: Major
              Found in system/core/Input.php - About 2 hrs to fix

                Function _build_message has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _build_message()
                    {
                        if ($this->wordwrap === TRUE && $this->mailtype !== 'html')
                        {
                            $this->_body = $this->word_wrap($this->_body);
                Severity: Minor
                Found in system/libraries/Email.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_rules has a Cognitive Complexity of 21 (exceeds 5 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: 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 _compile_wh has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _compile_wh($qb_key)
                    {
                        if (count($this->$qb_key) > 0)
                        {
                            for ($i = 0, $c = count($this->$qb_key); $i < $c; $i++)
                Severity: Minor
                Found in system/database/DB_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

                Function _ci_load_stock_library has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _ci_load_stock_library($library_name, $file_path, $params, $object_name)
                    {
                        $prefix = 'CI_';
                
                        if (class_exists($prefix.$library_name, FALSE))
                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

                Method open_tag has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function open_tag($the_parser, $name)
                    {
                        $the_parser = (string) $the_parser;
                
                        // If invalid nesting, then return
                Severity: Major
                Found in system/libraries/Xmlrpc.php - About 2 hrs to fix

                  Method load has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function load($langfile, $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
                      {
                          if (is_array($langfile))
                          {
                              foreach ($langfile as $value)
                  Severity: Major
                  Found in system/core/Lang.php - About 2 hrs to fix

                    CI_Image_lib has 25 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class CI_Image_lib {
                    
                        /**
                         * PHP extension/library to use for image manipulation
                         * Can be: imagemagick, netpbm, gd, gd2
                    Severity: Minor
                    Found in system/libraries/Image_lib.php - About 2 hrs to fix

                      CI_User_agent has 25 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class CI_User_agent {
                      
                          /**
                           * Current user-agent
                           *
                      Severity: Minor
                      Found in system/libraries/User_agent.php - About 2 hrs to fix

                        CI_DB_forge has 25 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        abstract class CI_DB_forge {
                        
                            /**
                             * Database object
                             *
                        Severity: Minor
                        Found in system/database/DB_forge.php - About 2 hrs to fix

                          File URI.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

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

                            Method load_driver has 70 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function load_driver($child)
                                {
                                    // Get CodeIgniter instance and subclass prefix
                                    $prefix = config_item('subclass_prefix');
                            
                            
                            Severity: Major
                            Found in system/libraries/Driver.php - About 2 hrs to fix

                              Method _ci_load has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function _ci_load($_ci_data)
                                  {
                                      // Set the default data variables
                                      foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val)
                                      {
                              Severity: Major
                              Found in system/core/Loader.php - About 2 hrs to fix

                                Function __construct has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function __construct(array $params = array())
                                    {
                                        // No sessions under CLI
                                        if (is_cli())
                                        {
                                Severity: Minor
                                Found in system/libraries/Session/Session.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