Showing 728 of 865 total issues
Function get_config
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
function &get_config(Array $replace = array())
{
static $config;
if (empty($config))
- Read upRead up
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
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)
Method _mcrypt_initialize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _mcrypt_initialize($params)
{
if ( ! empty($params['cipher']))
{
$params['cipher'] = strtolower($params['cipher']);
Method _like
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _like($field, $match = '', $type = 'AND ', $side = 'both', $not = '', $escape = NULL)
{
if ( ! is_array($field))
{
$field = array($field => $match);
Method compile_binds
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function compile_binds($sql, $binds)
{
if (empty($this->bind_marker) OR strpos($sql, $this->bind_marker) === FALSE)
{
return $sql;
Method __construct
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($params)
{
parent::__construct($params);
if (empty($this->dsn))
Method escape_identifiers
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function escape_identifiers($item, $split = TRUE)
{
if ($this->_escape_char === '' OR empty($item) OR in_array($item, $this->_reserved_identifiers))
{
return $item;
Method __construct
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($params)
{
parent::__construct($params);
if (empty($this->dsn))
Method _display_cache
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Method do_xss_clean
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function do_xss_clean()
{
$file = $this->file_temp;
if (filesize($file) == 0)
Method image_create_gd
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function image_create_gd($path = '', $image_type = '')
{
if ($path === '')
{
$path = $this->full_src_path;
Method symbolic_permissions
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function symbolic_permissions($perms)
{
if (($perms & 0xC000) === 0xC000)
{
$symbolic = 's'; // Socket
Method _set_uri_string
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _set_uri_string($str, $is_cli = FALSE)
{
// CLI requests have a bit simpler logic
if ($is_cli)
{
Method _fetch_from_array
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Method serializedata
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function serializedata($typ, $val)
{
$rs = '';
switch ($this->xmlrpcTypes[$typ])
Method __construct
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct()
{
if ( ! $this->is_supported())
{
log_message('error', 'Cache: Failed to create Redis object; extension not loaded?');
Method __construct
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))
{
Method delete
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function delete($table = '', $where = '', $limit = NULL, $reset_data = TRUE)
{
// Combine any cached components with the current statements
$this->_merge_cache();
Method _compile_wh
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function _compile_wh($qb_key)
{
if (count($this->$qb_key) > 0)
{
for ($i = 0, $c = count($this->$qb_key); $i < $c; $i++)
Method _alter_table
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);