Showing 31 of 33 total issues
Method redirect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function redirect()
{
$redirect = false;
$file = $this->file('301.txt');
if (is_file($file)) {
Function tag
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function tag($name, array $attributes, $content = null)
{
$args = func_get_args();
$tag = array_shift($args);
$attributes = array_shift($args);
- 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 get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function get($key, $default = null)
{
if ($this->resumable() && $this->started()) {
$session = $_SESSION;
foreach ($this->explode($key) as $name) {
- 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 display
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function display($content)
{
$html = array();
if (preg_match('/<\s*!doctype\s.*>/i', $content, $match)) {
$content = mb_substr(mb_strstr($content, $match[0]), mb_strlen($match[0]));
- 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 send
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function send($response = '', $status = 200, array $headers = array())
{
if (!$response instanceof Response) {
if (func_num_args() == 1 && is_numeric($response)) {
$status = (int) $response;
- 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 style
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function style($css)
{
if (is_array($css)) {
foreach ($css as $tag => $rules) {
if (is_array($rules)) {
- 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 scripts
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function scripts()
{
// Used in $this->display()
if (isset($this->data['jquery'])) {
$jquery = array_filter(array_unique($this->data['jquery']));
- 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 __get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function &__get($name)
{
// This method must return a reference and not use ternary operators for __set()ing multi-dimensional arrays
// http://stackoverflow.com/questions/4310473/using-set-with-arrays-solved-but-why
// http://stackoverflow.com/questions/5966918/return-null-by-reference-via-get
- 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 dir
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function dir($folder = null)
{
$folders = func_get_args();
if ($folder == 'set') {
list($folder, $name, $dir) = $folders;
- 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 enforce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function enforce($url, $redirect = 301)
{
list($url, $path, $suffix, $query) = $this->formatLocalPath($url, 'array');
$compare = $this->url['path'];
if (!empty($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
Avoid too many return
statements within this method. Open
return htmlspecialchars($this->formatLocalPath($base.$query.$fragment));