File FannieReportPage.php
has 939 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2012 Whole Foods Co-op
Function render_data
has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring. Open
public function render_data($data,$headers=array(),$footers=array(),$format='html')
{
$url = $this->config->get('URL');
$ret = "";
switch(strtolower($format)) {
- 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 render_data
has 307 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render_data($data,$headers=array(),$footers=array(),$format='html')
{
$url = $this->config->get('URL');
$ret = "";
switch(strtolower($format)) {
Function htmlLine
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function htmlLine($row, $header=False)
{
$url = $this->config->get('URL');
$meta = 0;
if (isset($row['meta'])) {
- 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 drawPage
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
function drawPage()
{
if (!($this->config instanceof FannieConfig)) {
$this->config = FannieConfig::factory();
}
- 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
FannieReportPage
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class FannieReportPage extends FanniePage
{
public $required = True;
Method htmlLine
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function htmlLine($row, $header=False)
{
$url = $this->config->get('URL');
$meta = 0;
if (isset($row['meta'])) {
Function multiContent
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function multiContent($data)
{
$output = '';
if ($this->report_format != 'xls') {
foreach($data as $report_data) {
- 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 drawPage
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawPage()
{
if (!($this->config instanceof FannieConfig)) {
$this->config = FannieConfig::factory();
}
Method multiContent
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function multiContent($data)
{
$output = '';
if ($this->report_format != 'xls') {
foreach($data as $report_data) {
Method defaultDescriptionContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function defaultDescriptionContent($rowcount, $datefields=array())
{
$ret = array();
$ret[] = '<div class="hidden-print">' . $this->header . '</div>';
$ret[] = '<div class="hidden-print">' . _('Report generated') . ' ' . date('l, F j, Y g:iA') . '</div>';
Function getData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function getData()
{
$data = array();
$cached = $this->checkDataCache();
if ($cached !== 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 select_headers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function select_headers($incrIndex=False)
{
$headers = array();
$hIndex = $this->header_index;
if (is_array($this->report_headers[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 xlsMeta
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function xlsMeta($data)
{
$fixup = array();
foreach($data as $row) {
$meta = 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 defaultDescriptionContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function defaultDescriptionContent($rowcount, $datefields=array())
{
$ret = array();
$ret[] = '<div class="hidden-print">' . $this->header . '</div>';
$ret[] = '<div class="hidden-print">' . _('Report generated') . ' ' . date('l, F j, Y g:iA') . '</div>';
- 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 $ret;
Avoid too many return
statements within this method. Open
return $carry;
Avoid too many return
statements within this method. Open
return $carry;
Avoid too many return
statements within this method. Open
return $carry;