Showing 728 of 865 total issues
Function _parse_form_attributes
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function _parse_form_attributes($attributes, $default)
{
if (is_array($attributes))
{
foreach ($default as $key => $val)
- 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 _run_hook
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function _run_hook($data)
{
// Closures/lambda functions and array($object, 'method') callables
if (is_callable($data))
{
- 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
File DB_result.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Method _file_mime_type
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _file_mime_type($file)
{
// We'll need this to validate the MIME info string (e.g. text/plain; charset=us-ascii)
$regexp = '/^([a-z\-]+\/[a-z0-9\-\.\+]+)(;\s.+)?$/';
Method overlay_watermark
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function overlay_watermark()
{
if ( ! function_exists('imagecolortransparent'))
{
$this->set_error('imglib_gd_required');
Method _run_hook
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _run_hook($data)
{
// Closures/lambda functions and array($object, 'method') callables
if (is_callable($data))
{
Method _write_cache
has 66 lines of code (exceeds 25 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;
Function initialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function initialize()
{
/* If an established connection is available, then there's
* no need to connect and select the database.
*
- 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 ascii_to_entities
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function ascii_to_entities($str)
{
$out = '';
$length = defined('MB_OVERLOAD_STRING')
? mb_strlen($str, '8bit') - 1
- 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 set_cookie
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function set_cookie($name, $value = '', $expire = 0, $domain = '', $path = '/', $prefix = '', $secure = NULL, $httponly = NULL, $samesite = NULL)
{
if (is_array($name))
{
// always leave 'name' in last place, as the loop will break otherwise, due to $$item
- 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 load_class
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function &load_class($class, $directory = 'libraries', $param = NULL)
{
static $_classes = array();
// Does the class exist? If so, we're done...
- 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 image_process_netpbm
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function image_process_netpbm($action = 'resize')
{
if ($this->library_path === '')
{
$this->set_error('imglib_libpath_invalid');
Method _get_params
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _get_params($params)
{
if (empty($params))
{
return isset($this->_cipher, $this->_mode, $this->_key, $this->_handle)
File Pagination.php
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Method _execute
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _execute($m)
{
$methName = $m->method_name;
// Check to see if it is a system call
Method form_dropdown
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function form_dropdown($data = '', $options = array(), $selected = array(), $extra = '')
{
$defaults = array();
if (is_array($data))
Method timespan
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
function timespan($seconds = 1, $time = '', $units = 7)
{
$CI =& get_instance();
$CI->lang->load('date');
Method _ci_init_library
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_init_library($class, $prefix, $config = FALSE, $object_name = NULL)
{
// Is there an associated config file for this class? Note: these should always be lowercase
if ($config === NULL)
{
CI_DB_result
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class CI_DB_result {
/**
* Connection ID
*
CI_DB_postgre_driver
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class CI_DB_postgre_driver extends CI_DB {
/**
* Database driver
*