bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function display_error has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function display_error($error = '', $swap = '', $native = FALSE)
    {
        $LANG =& load_class('Lang', 'core');
        $LANG->load('db');

Severity: Minor
Found in system/database/DB_driver.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 _alter_table has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _alter_table($alter_type, $table, $field)
    {
        if ($alter_type === 'DROP')
        {
            return parent::_alter_table($alter_type, $table, $field);
Severity: Minor
Found in system/database/drivers/oci8/oci8_forge.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 _process_indexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _process_indexes($table)
    {
        $sql = '';

        for ($i = 0, $c = count($this->keys); $i < $c; $i++)
Severity: Minor
Found in system/database/drivers/cubrid/cubrid_forge.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 site_url has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function site_url($uri = '', $protocol = NULL)
    {
        $base_url = $this->slash_item('base_url');

        if (isset($protocol))
Severity: Minor
Found in system/core/Config.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 _uri_to_assoc has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _uri_to_assoc($n = 3, $default = array(), $which = 'segment')
    {
        if ( ! is_numeric($n))
        {
            return $default;
Severity: Minor
Found in system/core/URI.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 set_status_header has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    function set_status_header($code = 200, $text = '')
    {
        if (is_cli())
        {
            return;
Severity: Minor
Found in system/core/Common.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 _load_agent_file has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function _load_agent_file()
    {
        if (($found = file_exists(APPPATH.'config/user_agents.php')))
        {
            include(APPPATH.'config/user_agents.php');
Severity: Minor
Found in system/libraries/User_agent.php - About 1 hr to fix

    Method _mcrypt_decrypt has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _mcrypt_decrypt($data, $params)
        {
            if ( ! is_resource($params['handle']))
            {
                return FALSE;
    Severity: Minor
    Found in system/libraries/Encryption.php - About 1 hr to fix

      Method ascii_to_entities has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function ascii_to_entities($str)
          {
              $out = '';
              $length = defined('MB_OVERLOAD_STRING')
                  ? mb_strlen($str, '8bit') - 1
      Severity: Minor
      Found in system/helpers/text_helper.php - About 1 hr to fix

        Method _compile_select has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _compile_select($select_override = FALSE)
            {
                // Combine any cached components with the current statements
                $this->_merge_cache();
        
        
        Severity: Minor
        Found in system/database/DB_query_builder.php - About 1 hr to fix

          Method _wh has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _wh($qb_key, $key, $value = NULL, $type = 'AND ', $escape = NULL)
              {
                  $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';
          
                  if ( ! is_array($key))
          Severity: Minor
          Found in system/database/DB_query_builder.php - About 1 hr to fix

            Method get_file_info has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function get_file_info($file, $returned_values = array('name', 'server_path', 'size', 'date'))
                {
                    if ( ! file_exists($file))
                    {
                        return FALSE;
            Severity: Minor
            Found in system/helpers/file_helper.php - About 1 hr to fix

              Method _smtp_authenticate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _smtp_authenticate()
                  {
                      if ( ! $this->_smtp_auth)
                      {
                          return TRUE;
              Severity: Minor
              Found in system/libraries/Email.php - About 1 hr to fix

                Method update_batch has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function update_batch($table, $set = NULL, $index = NULL, $batch_size = 100)
                    {
                        // Combine any cached components with the current statements
                        $this->_merge_cache();
                
                
                Severity: Minor
                Found in system/database/DB_query_builder.php - About 1 hr to fix

                  Method _alter_table has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function _alter_table($alter_type, $table, $field)
                      {
                          if ($alter_type === 'DROP')
                          {
                              return parent::_alter_table($alter_type, $table, $field);
                  Severity: Minor
                  Found in system/database/drivers/oci8/oci8_forge.php - About 1 hr to fix

                    Method do_multicall has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function do_multicall($call)
                        {
                            if ($call->kindOf() !== 'struct')
                            {
                                return $this->multicall_error('notstruct');
                    Severity: Minor
                    Found in system/libraries/Xmlrpcs.php - About 1 hr to fix

                      Method _get_lock has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function _get_lock($session_id)
                          {
                              // PHP 7 reuses the SessionHandler object on regeneration,
                              // so we need to check here if the lock key is for the
                              // correct session ID.
                      Severity: Minor
                      Found in system/libraries/Session/drivers/Session_redis_driver.php - About 1 hr to fix

                        Method _wh_in has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function _wh_in($qb_key, $key, array $values, $not = FALSE, $type = 'AND ', $escape = NULL)
                            {
                                $qb_cache_key = ($qb_key === 'qb_having') ? 'qb_cache_having' : 'qb_cache_where';
                        
                                if (empty($key) OR ! is_string($key))
                        Severity: Minor
                        Found in system/database/DB_query_builder.php - About 1 hr to fix

                          Method order_by has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function order_by($orderby, $direction = '', $escape = NULL)
                              {
                                  $direction = strtoupper(trim($direction));
                          
                                  if ($direction === 'RANDOM')
                          Severity: Minor
                          Found in system/database/DB_query_builder.php - About 1 hr to fix

                            Method _alter_table has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function _alter_table($alter_type, $table, $field)
                                {
                                    if ($alter_type === 'DROP')
                                    {
                                        return parent::_alter_table($alter_type, $table, $field);
                            Severity: Minor
                            Found in system/database/drivers/pdo/subdrivers/pdo_oci_forge.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language