Showing 18 of 18 total issues
File Component.php
has 614 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace BootPress\Asset;
use BootPress\Page\Component as Page;
Function cached
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
public static function cached($dir, array $glide = array())
{
$page = Page::html();
static::$instance = new static();
$asset = static::$instance;
- 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 mime
has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring. Open
public static function mime($type)
{
$mime = null;
$single = (is_array($type)) ? false : true;
if (is_array($type)) {
- 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 mime
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function mime($type)
{
$mime = null;
$single = (is_array($type)) ? false : true;
if (is_array($type)) {
Function urls
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public static function urls($html)
{
if (is_null(static::$instance) || empty($html)) {
return $html;
}
- 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 cached
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function cached($dir, array $glide = array())
{
$page = Page::html();
static::$instance = new static();
$asset = static::$instance;
Method urls
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function urls($html)
{
if (is_null(static::$instance) || empty($html)) {
return $html;
}
Function paths
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function paths(&$cache)
{
$page = Page::html();
$count = 0;
foreach ($cache as $dir => $files) {
- 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 css
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function css($file, $row)
{
$page = Page::html();
$css = file_get_contents($file);
if (substr($css, 0, 3) == "\xef\xbb\xbf") {
- 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 dispatch
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function dispatch($file, $options = array())
{
$set = array_merge(array(
'name' => '',
'expires' => 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
Method dispatch
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function dispatch($file, $options = array())
{
$set = array_merge(array(
'name' => '',
'expires' => 0,
Method paths
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function paths(&$cache)
{
$page = Page::html();
$count = 0;
foreach ($cache as $dir => $files) {
Method css
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function css($file, $row)
{
$page = Page::html();
$css = file_get_contents($file);
if (substr($css, 0, 3) == "\xef\xbb\xbf") {
Method ids
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function ids($count)
{
$ids = array();
if ($stmt = $this->db->query(array(
'SELECT id, tiny',
Avoid deeply nested control flow statements. Open
if (is_file($row['file'])) {
$minify[$row['file']] = $row;
}
Avoid deeply nested control flow statements. Open
if (!empty($row['query'])) {
$source = $page->dir();
$image = substr($row['file'], strlen($source));
parse_str($row['query'], $params);
$setup = $glide;
Function ids
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function ids($count)
{
$ids = array();
if ($stmt = $this->db->query(array(
'SELECT id, tiny',
- 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 $response;