Showing 728 of 865 total issues
Method field_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function field_data($table)
{
if (strpos($table, '.') !== FALSE)
{
sscanf($table, '%[^.].%s', $owner, $table);
Method field_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function field_data($table)
{
if (strpos($table, '.') !== FALSE)
{
sscanf($table, '%[^.].%s', $owner, $table);
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($params)
{
parent::__construct($params);
if (empty($this->dsn))
Method site_url
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function site_url($uri = '', $protocol = NULL)
{
$base_url = $this->slash_item('base_url');
if (isset($protocol))
Method write
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function write($session_id, $session_data)
{
// If the two IDs don't match, we have a session_regenerate_id() call
// and we need to close the old handle and open a new one
if ($session_id !== $this->_session_id && ($this->close() === $this->_failure OR $this->read($session_id) === $this->_failure))
Method date_range
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function date_range($unix_start = '', $mixed = '', $is_unix = TRUE, $format = 'Y-m-d')
{
if ($unix_start == '' OR $mixed == '' OR $format == '')
{
return FALSE;
Method create_table
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function create_table($table, $if_not_exists = FALSE, array $attributes = array())
{
if ($table === '')
{
show_error('A table name is required for that operation.');
Method __construct
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct($params)
{
parent::__construct($params);
if (empty($this->dsn))
Method load_class
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function &load_class($class, $directory = 'libraries', $param = NULL)
{
static $_classes = array();
// Does the class exist? If so, we're done...
Method open
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function open($save_path, $name)
{
$this->_memcached = new Memcached();
$this->_memcached->setOption(Memcached::OPT_BINARY_PROTOCOL, TRUE); // required for touch() usage
$server_list = array();
Method _get_lock
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
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.
Method open
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function open($save_path, $name)
{
if (empty($this->_config['save_path']))
{
return $this->_failure;
Method word_is_countable
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function word_is_countable($word)
{
return ! in_array(
strtolower($word),
array(
Method plural
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function plural($str)
{
$result = strval($str);
if ( ! word_is_countable($result))
Method _alter_table
has 36 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);
Method _alter_table
has 36 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);
Method custom_result_object
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function custom_result_object($class_name)
{
if (isset($this->custom_result_object[$class_name]))
{
return $this->custom_result_object[$class_name];
Method csrf_set_cookie
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function csrf_set_cookie()
{
$expire = time() + $this->_csrf_expire;
$secure_cookie = (bool) config_item('cookie_secure');
Function decorate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function decorate($parent)
{
$this->_parent = $parent;
// Lock down attributes to what is defined in the class
- 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 read_dir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function read_dir($path, $preserve_filepath = TRUE, $root_path = NULL)
{
$path = rtrim($path, '/\\').DIRECTORY_SEPARATOR;
if ( ! $fp = @opendir($path))
{
- 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"