Showing 31 of 35 total issues
File Common.php
has 667 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace BootPress\Bootstrap;
use BootPress\Page\Component as Page;
Function links
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function links($tag, array $links, array $options = array())
{
$html = '';
$class = null;
if ($space = strpos($tag, ' ')) {
- 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 toggle
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function toggle($type, array $links, array $options = array())
{
$count = 1;
$toggle = array();
$content = '';
- 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 addClass
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function addClass($html, array $tags)
{
$rnr = array();
foreach ($tags as $tag => $class) {
$prefix = (is_array($class) && isset($class[2]) && is_array($class[1])) ? $class : false;
- 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 media
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function media(array $list, $parent = 0)
{
if (is_numeric($parent) && isset($list[0]) && is_array($list[0])) {
$media = array();
foreach ($list[$parent] as $child => $display) {
- 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
Common
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Common
{
use Base;
/** @var object A BootPress\Page\Component instance. */
Method links
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function links($tag, array $links, array $options = array())
{
$html = '';
$class = null;
if ($space = strpos($tag, ' ')) {
Method toggle
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toggle($type, array $links, array $options = array())
{
$count = 1;
$toggle = array();
$content = '';
Method carousel
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function carousel(array $images, array $options = array())
{
$html = '';
$id = $this->page->id('carousel');
$options = array_merge(array(
Function field
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function field($prompt, $input, $error = null)
{
foreach (array('input', 'select', 'textarea', 'button', 'p') as $tag) {
if ($this->firstTagAttributes($input, $matches, '<'.$tag)) {
break;
- 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 label
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function label($prompt, $name, $id)
{
if (empty($prompt)) {
return '';
}
Method media
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function media(array $list, $parent = 0)
{
if (is_numeric($parent) && isset($list[0]) && is_array($list[0])) {
$media = array();
foreach ($list[$parent] as $child => $display) {
Method field
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function field($prompt, $input, $error = null)
{
foreach (array('input', 'select', 'textarea', 'button', 'p') as $tag) {
if ($this->firstTagAttributes($input, $matches, '<'.$tag)) {
break;
Function carousel
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function carousel(array $images, array $options = array())
{
$html = '';
$id = $this->page->id('carousel');
$options = array_merge(array(
- 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 label
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function label($prompt, $name, $id)
{
if (empty($prompt)) {
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
Method button
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function button($class, $name, array $options = array())
{
$attributes = array('type' => 'button');
foreach ($options as $key => $value) {
if (!in_array($key, array('dropdown', 'dropup', 'active', 'disabled', 'pull'))) {
Method accordion
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function accordion($class, array $sections, $open = 1)
{
$html = '';
$count = 0;
$id = $this->page->id('accordion');
Method open
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function open($brand, $align = '', $inverse = false)
{
if (is_array($brand)) {
list($brand, $link) = (count($brand) > 1) ? $brand : each($brand);
} else {
Method search
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($url, array $form = array())
{
$html = '';
$form = array_merge(array(
'name' => 'search',
Method addClass
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addClass($html, array $tags)
{
$rnr = array();
foreach ($tags as $tag => $class) {
$prefix = (is_array($class) && isset($class[2]) && is_array($class[1])) ? $class : false;