File URI.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
CI_URI
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CI_URI {
/**
* List of cached URI segments
*
Function _set_uri_string
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function _set_uri_string($str, $is_cli = FALSE)
{
// CLI requests have a bit simpler logic
if ($is_cli)
{
- 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 _uri_to_assoc
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _uri_to_assoc($n = 3, $default = array(), $which = 'segment')
{
if ( ! is_numeric($n))
{
return $default;
Method _set_uri_string
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _set_uri_string($str, $is_cli = FALSE)
{
// CLI requests have a bit simpler logic
if ($is_cli)
{
Function _uri_to_assoc
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _uri_to_assoc($n = 3, $default = array(), $which = 'segment')
{
if ( ! is_numeric($n))
{
return $default;
- 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 _parse_request_uri
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _parse_request_uri()
{
if ( ! isset($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']))
{
return '';
Method __construct
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(CI_Config $config)
{
$this->config = $config;
// If it's a CLI request, ignore the configuration
Function _parse_request_uri
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function _parse_request_uri()
{
if ( ! isset($_SERVER['REQUEST_URI'], $_SERVER['SCRIPT_NAME']))
{
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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(CI_Config $config)
{
$this->config = $config;
// If it's a CLI request, ignore the configuration
- 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"