File Loader.php
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Function model
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function model($model, $name = '', $db_conn = FALSE)
{
if (empty($model))
{
return $this;
- 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 _ci_init_library
has a Cognitive Complexity of 28 (exceeds 5 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)
{
- 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 model
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function model($model, $name = '', $db_conn = FALSE)
{
if (empty($model))
{
return $this;
CI_Loader
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class CI_Loader {
// All these are set automatically. Don't mess with them.
/**
* Nesting level of the output buffering mechanism
Function helper
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function helper($helpers = array())
{
is_array($helpers) OR $helpers = array($helpers);
foreach ($helpers as &$helper)
{
- 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 _ci_load
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function _ci_load($_ci_data)
{
// Set the default data variables
foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_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 _ci_load_stock_library
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function _ci_load_stock_library($library_name, $file_path, $params, $object_name)
{
$prefix = 'CI_';
if (class_exists($prefix.$library_name, 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
Method _ci_load
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_load($_ci_data)
{
// Set the default data variables
foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val)
{
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)
{
Function _ci_autoloader
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
protected function _ci_autoloader()
{
if (file_exists(APPPATH.'config/autoload.php'))
{
include(APPPATH.'config/autoload.php');
- 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 _ci_load_library
has a Cognitive Complexity of 17 (exceeds 5 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
- 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 _ci_load_stock_library
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_load_stock_library($library_name, $file_path, $params, $object_name)
{
$prefix = 'CI_';
if (class_exists($prefix.$library_name, 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 remove_package_path
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function remove_package_path($path = '')
{
$config =& $this->_ci_get_component('config');
if ($path === '')
Function remove_package_path
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function remove_package_path($path = '')
{
$config =& $this->_ci_get_component('config');
if ($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"
Further reading
Method driver
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function driver($library, $params = NULL, $object_name = NULL)
{
if (is_array($library))
{
foreach ($library as $key => $value)
Function driver
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function driver($library, $params = NULL, $object_name = NULL)
{
if (is_array($library))
{
foreach ($library as $key => $value)
- 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 library
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function library($library, $params = NULL, $object_name = NULL)
{
if (empty($library))
{
return $this;
- 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 dbforge
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dbforge($db = NULL, $return = FALSE)
{
$CI =& get_instance();
if ( ! is_object($db) OR ! ($db instanceof CI_DB))
{
Avoid too many return
statements within this method. Open
return $this->_ci_load_library($class.'/'.$class, $params, $object_name);
Function dbforge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function dbforge($db = NULL, $return = FALSE)
{
$CI =& get_instance();
if ( ! is_object($db) OR ! ($db instanceof CI_DB))
{
- 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"