Showing 728 of 865 total issues
Function _write_cache
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function _write_cache($output)
{
$CI =& get_instance();
$path = $CI->config->item('cache_path');
$cache_path = ($path === '') ? APPPATH.'cache'.DIRECTORY_SEPARATOR : rtrim($path, '/\\').DIRECTORY_SEPARATOR;
- 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
Function _fetch_from_array
has a Cognitive Complexity of 16 (exceeds 5 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);
- 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 word_wrap
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function word_wrap($str, $charlim = NULL)
{
// Set the character limit, if not already present
if (empty($charlim))
{
Method _sanitize_naughty_html
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _sanitize_naughty_html($matches)
{
static $naughty_tags = array(
'alert', 'area', 'prompt', 'confirm', 'applet', 'audio', 'basefont', 'base', 'behavior', 'bgsound',
'blink', 'body', 'embed', 'expression', 'form', 'frameset', 'frame', 'head', 'html', 'ilayer',
File oci8_driver.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Method image_mirror_gd
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function image_mirror_gd()
{
if ( ! $src_img = $this->image_create_gd())
{
return FALSE;
Method _prep_quoted_printable
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _prep_quoted_printable($str)
{
// ASCII code numbers for "safe" characters that can always be
// used literally, without encoding, as described in RFC 2049.
// https://www.ietf.org/rfc/rfc2049.txt
Method word_wrap
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function word_wrap($str, $charlim = 76)
{
// Set the character limit
is_numeric($charlim) OR $charlim = 76;
Method write_log
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function write_log($level, $msg)
{
if ($this->_enabled === FALSE)
{
return FALSE;
Method _ci_load_library
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_load_library($class, $params = NULL, $object_name = NULL)
{
// Get the class name, and while we're at it trim any slashes.
// The directory path can be included as part of the class name,
// but we don't want a leading slash
Method _ci_autoloader
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_autoloader()
{
if (file_exists(APPPATH.'config/autoload.php'))
{
include(APPPATH.'config/autoload.php');
Method helper
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function helper($helpers = array())
{
is_array($helpers) OR $helpers = array($helpers);
foreach ($helpers as &$helper)
{
Method load
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
$file = ($file === '') ? 'config' : str_replace('.php', '', $file);
$loaded = FALSE;
Method __construct
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(&$params)
{
parent::__construct($params);
// Detect the names of some methods in phpRedis instance
Method write
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function write($session_id, $session_data)
{
// Prevent previous QB calls from messing with our queries
$this->_db->reset_query();
Method link_tag
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
{
$CI =& get_instance();
$link = '<link ';
Method __construct
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($params)
{
parent::__construct($params);
$valid_dsns = array(
Function image_mirror_gd
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function image_mirror_gd()
{
if ( ! $src_img = $this->image_create_gd())
{
return FALSE;
- 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
Function image_process_gd
has a Cognitive Complexity of 15 (exceeds 5 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
- 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
Function _send_with_smtp
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function _send_with_smtp()
{
if ($this->smtp_host === '')
{
$this->_set_error_message('lang:email_no_hostname');
- 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"