File class.widget.php
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package toolkit
*/
/**
Function Select
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public static function Select($name, array $options = null, array $attributes = null)
{
General::ensureType(array(
'name' => array('var' => $name, 'type' => 'string')
));
- 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 TableHead
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function TableHead(array $columns = null)
{
$thead = new XMLElement('thead');
$tr = new XMLElement('tr');
- 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 Select
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Select($name, array $options = null, array $attributes = null)
{
General::ensureType(array(
'name' => array('var' => $name, 'type' => 'string')
));
Method Checkbox
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Checkbox($name, $value, $description = null, XMLElement &$wrapper = null, $help = null)
{
General::ensureType(array(
'name' => array('var' => $name, 'type' => 'string'),
'value' => array('var' => $value, 'type' => 'string', 'optional' => true),
Method Drawer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Drawer($id = '', $label = '', XMLElement $content = null, $default_state = 'closed', $context = '', array $attributes = array())
Method Table
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Table(XMLElement $header = null, XMLElement $footer = null, XMLElement $body = null, $class = null, $id = null, Array $attributes = null)
Method Anchor
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Anchor($value, $href, $title = null, $class = null, $id = null, array $attributes = null)
Method TableRow
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function TableRow(array $cells, $class = null, $id = null, $rowspan = null, Array $attributes = null)
Method Form
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Form($action = null, $method = 'post', $class = null, $id = null, array $attributes = null)
Method Textarea
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Textarea($name, $rows = 15, $cols = 50, $value = null, array $attributes = null)
Method Label
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Label($name = null, XMLElement $child = null, $class = null, $id = null, array $attributes = null)
Method TableData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function TableData($value, $class = null, $id = null, $colspan = null, Array $attributes = null)
Method Checkbox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function Checkbox($name, $value, $description = null, XMLElement &$wrapper = null, $help = null)
Function Table
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function Table(XMLElement $header = null, XMLElement $footer = null, XMLElement $body = null, $class = null, $id = null, Array $attributes = null)
{
General::ensureType(array(
'class' => array('var' => $class, 'type' => 'string', 'optional' => true),
'id' => array('var' => $id, 'type' => 'string', 'optional' => true)
- 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 TableData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function TableData($value, $class = null, $id = null, $colspan = null, Array $attributes = null)
{
General::ensureType(array(
'class' => array('var' => $class, 'type' => 'string', 'optional' => true),
'id' => array('var' => $id, 'type' => 'string', 'optional' => true),
- 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 TableRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function TableRow(array $cells, $class = null, $id = null, $rowspan = null, Array $attributes = null)
{
General::ensureType(array(
'class' => array('var' => $class, 'type' => 'string', 'optional' => true),
'id' => array('var' => $id, 'type' => 'string', 'optional' => true),
- 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 __SelectBuildOption
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function __SelectBuildOption($option)
{
list($value, $selected, $desc, $class, $id, $attributes) = array_pad($option, 6, null);
if (!$desc) {
- 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"