Function safe_mailto
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
function safe_mailto($email, $title = '', $attributes = '')
{
$title = (string) $title;
if ($title === '')
- 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 safe_mailto
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
function safe_mailto($email, $title = '', $attributes = '')
{
$title = (string) $title;
if ($title === '')
File url_helper.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
Function auto_link
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function auto_link($str, $type = 'both', $popup = FALSE)
{
// Find and replace any URLs.
if ($type !== 'email' && preg_match_all('#(\w*://|www\.)[a-z0-9]+(-+[a-z0-9]+)*(\.[a-z0-9]+(-+[a-z0-9]+)*)+(/([^\s()<>;]+\w)?/?)?#i', $str, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER))
{
- 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 redirect
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function redirect($uri = '', $method = 'auto', $code = NULL)
{
if ( ! preg_match('#^(\w+:)?//#i', $uri))
{
$uri = site_url($uri);
- 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 anchor_popup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function anchor_popup($uri = '', $title = '', $attributes = FALSE)
{
$title = (string) $title;
$site_url = preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri);
Method redirect
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function redirect($uri = '', $method = 'auto', $code = NULL)
{
if ( ! preg_match('#^(\w+:)?//#i', $uri))
{
$uri = site_url($uri);
Function anchor_popup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function anchor_popup($uri = '', $title = '', $attributes = FALSE)
{
$title = (string) $title;
$site_url = preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri);
- 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"