Function jquery_sparklines
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function jquery_sparklines($data, $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
if ( ! is_array($data) || ! $data) {
return 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
Method jquery_sparklines
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jquery_sparklines($data, $extra = [])
{
$extra['id'] = $extra['id'] ?: __FUNCTION__ . '_' . ++$this->_ids[__FUNCTION__];
if ( ! is_array($data) || ! $data) {
return false;
Method chart_flash
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chart_flash($data, $params)
{
if (empty($data)) {
return;
}
Method chart
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chart($data, $params)
{
if ($params['flash'] == true) {
return $this->chart_flash($data, $params);
}
Method chart_bar_flash
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function chart_bar_flash($data, $params)
{
if (empty($data)) {
return;
}
Function chart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function chart($data, $params)
{
if ($params['flash'] == true) {
return $this->chart_flash($data, $params);
}
- 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_ticks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function _get_ticks($data)
{
$max = 0;
foreach ((array) $data as $val) {
if ($val['val'] > $max) {
- 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 chart_bar
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function chart_bar($data, $params)
{
if ($params['flash'] == true) {
return $this->chart_bar_flash($data, $params);
}
- 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"