File BatchListPage.php
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2009,2010 Whole Foods Co-op
Method batchListDisplay
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
function batchListDisplay($filter='', $mode='', $maxBatchID='')
{
global $FANNIE_URL;
$dbc = $this->con;
Function batchListDisplay
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function batchListDisplay($filter='', $mode='', $maxBatchID='')
{
global $FANNIE_URL;
$dbc = $this->con;
- 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 newBatchInput
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
function newBatchInput()
{
$dbc = FannieDB::get($this->config->get('OP_DB'));
$url = $this->config->get('URL');
Method unitTest
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unitTest($phpunit)
{
$get = $this->get_view();
$phpunit->assertNotEquals(0, strlen($get));
Method post_id_batchName_batchType_startDate_endDate_owner_handler
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_batchName_batchType_startDate_endDate_owner_handler()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
Method post_newType_newName_newStart_newEnd_newOwner_handler
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_newType_newName_newStart_newEnd_newOwner_handler()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
$json = array('error'=>0, 'msg'=>'Created batch ' . $this->newName);
Function post_id_batchName_batchType_startDate_endDate_owner_handler
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function post_id_batchName_batchType_startDate_endDate_owner_handler()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
- 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 post_delete_id_handler
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_delete_id_handler()
{
global $FANNIE_OP_DB;
$json = array('error'=>0,'msg'=>'Deleted batch #' . $this->id);
$dbc = FannieDB::get($FANNIE_OP_DB);
Method batchToTableRow
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function batchToTableRow($batch)
{
/**
strtotime() and date() are not reciprocal functions
date('Y-m-d', strtotime('0000-00-00')) results in
Function post_newType_newName_newStart_newEnd_newOwner_handler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function post_newType_newName_newStart_newEnd_newOwner_handler()
{
global $FANNIE_OP_DB;
$dbc = FannieDB::get($FANNIE_OP_DB);
$json = array('error'=>0, 'msg'=>'Created batch ' . $this->newName);
- 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"