Showing 34 of 651 total issues
Method load
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($file = '', $use_sections = false, $fail_gracefully = false, $_module = '')
{
if (in_array($file, $this->is_loaded, true)) {
return $this->item($file);
}
Function _set_module_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _set_module_path(&$_route)
{
if (! empty($_route)) {
// Are module/directory/controller/method segments being specified?
$sgs = sscanf($_route, '%[^/]/%[^/]/%[^/]/%s', $module, $directory, $class, $method);
- 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 load
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function load($langfile, $lang = '', $return = false, $add_suffix = true, $alt_path = '', $_module = '')
Function _set_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function _set_request($segments = [])
{
if ($this->translate_uri_dashes === true) {
foreach (range(0, 2) as $v) {
isset($segments[$v]) && $segments[$v] = str_replace('-', '_', $segments[$v]);
- 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 language
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function language($langfile, $idiom = '', $return = false, $add_suffix = true, $alt_path = '')
Function autoload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function autoload($class)
{
// don't autoload CI_ prefixed classes or those using the config subclass_prefix
if (strstr($class, 'CI_') || strstr($class, config_item('subclass_prefix'))) {
return;
- 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_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function load_file($file, $path, $type = 'other', $result = true)
{
$file = str_replace(EXT, '', $file);
$location = $path.$file.EXT;
- 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 initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function initialize($controller = null)
{
// set the module name
$this->_module = CI::$APP->router->fetch_module();
- 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
Avoid too many return
statements within this method. Open
return $this->language;
Avoid too many return
statements within this method. Open
return array_slice($segments, 1);
Avoid too many return
statements within this method. Open
return array_slice($segments, 2);
Avoid too many return
statements within this method. Open
return $segments;
Avoid too many return
statements within this method. Open
return array_slice($segments, 1);
Function plugin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function plugin($plugin)
{
if (is_array($plugin)) {
return $this->plugins($plugin);
}
- 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"