File Session.php
has 584 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Method __construct
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $params = array())
{
// No sessions under CLI
if (is_cli())
{
CI_Session
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class CI_Session {
/**
* Userdata array
*
Method _configure
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _configure(&$params)
{
$expiration = config_item('sess_expiration');
if (isset($params['cookie_lifetime']))
Function __construct
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $params = array())
{
// No sessions under CLI
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
Function _configure_sid_length
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function _configure_sid_length()
{
if (PHP_VERSION_ID < 70100)
{
$hash_function = ini_get('session.hash_function');
- 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_classes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function _ci_load_classes($driver)
{
// PHP 7 compatibility
interface_exists('SessionUpdateTimestampHandlerInterface', FALSE) OR require_once(BASEPATH.'libraries/Session/SessionUpdateTimestampHandlerInterface.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
Method _configure_sid_length
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _configure_sid_length()
{
if (PHP_VERSION_ID < 70100)
{
$hash_function = ini_get('session.hash_function');
Method _ci_load_classes
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _ci_load_classes($driver)
{
// PHP 7 compatibility
interface_exists('SessionUpdateTimestampHandlerInterface', FALSE) OR require_once(BASEPATH.'libraries/Session/SessionUpdateTimestampHandlerInterface.php');
Function _configure
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function _configure(&$params)
{
$expiration = config_item('sess_expiration');
if (isset($params['cookie_lifetime']))
- 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 mark_as_temp
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mark_as_temp($key, $ttl = 300)
{
$ttl += time();
if (is_array($key))
Function mark_as_temp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function mark_as_temp($key, $ttl = 300)
{
$ttl += time();
if (is_array($key))
- 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_vars
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function _ci_init_vars()
{
if ( ! empty($_SESSION['__ci_vars']))
{
$current_time = time();
- 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 mark_as_flash
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function mark_as_flash($key)
{
if (is_array($key))
{
for ($i = 0, $c = count($key); $i < $c; $i++)
- 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 unmark_flash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function unmark_flash($key)
{
if (empty($_SESSION['__ci_vars']))
{
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 unmark_temp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function unmark_temp($key)
{
if (empty($_SESSION['__ci_vars']))
{
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"