bcit-ci/CodeIgniter

View on GitHub

Showing 728 of 865 total issues

Function get_config has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    function &get_config(Array $replace = array())
    {
        static $config;

        if (empty($config))
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 read has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function read($session_id)
    {
        // This might seem weird, but PHP 5.6 introduces session_reset(),
        // which re-reads session data
        if ($this->_file_handle === NULL)
Severity: Minor
Found in system/libraries/Session/drivers/Session_files_driver.php - About 1 hr to fix

    Method _mcrypt_initialize has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _mcrypt_initialize($params)
        {
            if ( ! empty($params['cipher']))
            {
                $params['cipher'] = strtolower($params['cipher']);
    Severity: Minor
    Found in system/libraries/Encryption.php - About 1 hr to fix

      Method _like has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
          {
              if ( ! is_array($field))
              {
                  $field = array($field => $match);
      Severity: Minor
      Found in system/database/DB_query_builder.php - About 1 hr to fix

        Method compile_binds has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function compile_binds($sql, $binds)
            {
                if (empty($this->bind_marker) OR strpos($sql, $this->bind_marker) === FALSE)
                {
                    return $sql;
        Severity: Minor
        Found in system/database/DB_driver.php - About 1 hr to fix

          Method __construct has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($params)
              {
                  parent::__construct($params);
          
                  if (empty($this->dsn))
          Severity: Minor
          Found in system/database/drivers/pdo/subdrivers/pdo_ibm_driver.php - About 1 hr to fix

            Method escape_identifiers has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function escape_identifiers($item, $split = TRUE)
                {
                    if ($this->_escape_char === '' OR empty($item) OR in_array($item, $this->_reserved_identifiers))
                    {
                        return $item;
            Severity: Minor
            Found in system/database/DB_driver.php - About 1 hr to fix

              Method __construct has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function __construct($params)
                  {
                      parent::__construct($params);
              
                      if (empty($this->dsn))
              Severity: Minor
              Found in system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php - About 1 hr to fix

                Method _display_cache has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function _display_cache(&$CFG, &$URI)
                    {
                        $cache_path = ($CFG->item('cache_path') === '') ? APPPATH.'cache/' : $CFG->item('cache_path');
                
                        // Build the file path. The file name is an MD5 hash of the full URI
                Severity: Minor
                Found in system/core/Output.php - About 1 hr to fix

                  Method do_xss_clean has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function do_xss_clean()
                      {
                          $file = $this->file_temp;
                  
                          if (filesize($file) == 0)
                  Severity: Minor
                  Found in system/libraries/Upload.php - About 1 hr to fix

                    Method image_create_gd has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function image_create_gd($path = '', $image_type = '')
                        {
                            if ($path === '')
                            {
                                $path = $this->full_src_path;
                    Severity: Minor
                    Found in system/libraries/Image_lib.php - About 1 hr to fix

                      Method symbolic_permissions has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function symbolic_permissions($perms)
                          {
                              if (($perms & 0xC000) === 0xC000)
                              {
                                  $symbolic = 's'; // Socket
                      Severity: Minor
                      Found in system/helpers/file_helper.php - About 1 hr to fix

                        Method _set_uri_string has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function _set_uri_string($str, $is_cli = FALSE)
                            {
                                // CLI requests have a bit simpler logic
                                if ($is_cli)
                                {
                        Severity: Minor
                        Found in system/core/URI.php - About 1 hr to fix

                          Method _fetch_from_array has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function _fetch_from_array(&$array, $index = NULL, $xss_clean = FALSE)
                              {
                                  // If $index is NULL, it means that the whole $array is requested
                                  isset($index) OR $index = array_keys($array);
                          
                          
                          Severity: Minor
                          Found in system/core/Input.php - About 1 hr to fix

                            Method serializedata has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function serializedata($typ, $val)
                                {
                                    $rs = '';
                            
                                    switch ($this->xmlrpcTypes[$typ])
                            Severity: Minor
                            Found in system/libraries/Xmlrpc.php - About 1 hr to fix

                              Method __construct has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function __construct()
                                  {
                                      if ( ! $this->is_supported())
                                      {
                                          log_message('error', 'Cache: Failed to create Redis object; extension not loaded?');
                              Severity: Minor
                              Found in system/libraries/Cache/drivers/Cache_redis.php - About 1 hr to fix

                                Method __construct has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function __construct($config = array())
                                    {
                                        // Only run this constructor on main library load
                                        if ( ! in_array(get_class($this), array('CI_Migration', config_item('subclass_prefix').'Migration'), TRUE))
                                        {
                                Severity: Minor
                                Found in system/libraries/Migration.php - About 1 hr to fix

                                  Method delete has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE)
                                      {
                                          // 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 _compile_wh has 40 lines of code (exceeds 25 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 1 hr to fix

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

                                          protected function _alter_table($alter_type, $table, $field)
                                          {
                                              if (in_array($alter_type, array('DROP', 'ADD'), TRUE))
                                              {
                                                  return parent::_alter_table($alter_type, $table, $field);
                                      Severity: Minor
                                      Found in system/database/drivers/postgre/postgre_forge.php - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language