File OrderGuidePage.php
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
include(dirname(__FILE__) . '/../config.php');
if (!class_exists('FannieAPI')) {
include_once(__DIR__ . '/../classlib2.0/FannieAPI.php');
Method get_order_view
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_order_view()
{
list($vendorID, $storeID) = explode(',', $this->order);
$prep = $this->connection->prepare("
SELECT o.description, o.upc,
Method post_order_handler
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_order_handler()
{
$vendorID = FormLib::get('vendor');
$storeID = FormLib::get('store');
$onhand = FormLib::get('onhand');
Method get_new_view
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_new_view()
{
$stores = FormLib::storePicker();
$vendor = new VendorsModel($this->connection);
$vOpts = $vendor->toOptions();
Method post_edit_handler
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_edit_handler()
{
$vendor = FormLib::get('vendor');
$store = FormLib::get('store');
$ids = FormLib::get('guide');
Method get_edit_view
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_edit_view()
{
list($vendorID, $storeID) = explode(',', $this->edit);
$prep = $this->connection->prepare("SELECT * FROM OrderGuides WHERE vendorID=? AND storeID=? ORDER BY seq");
$guide = $this->connection->getAllRows($prep, array($vendorID, $storeID));
Function post_edit_handler
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function post_edit_handler()
{
$vendor = FormLib::get('vendor');
$store = FormLib::get('store');
$ids = FormLib::get('guide');
- 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 get_view
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$stores = FormLib::storePicker();
$storeID = FormLib::get('store');
if (!$storeID) {
Function post_order_handler
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function post_order_handler()
{
$vendorID = FormLib::get('vendor');
$storeID = FormLib::get('store');
$onhand = FormLib::get('onhand');
- 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 post_new_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function post_new_handler()
{
$model = new OrderGuidesModel($this->connection);
$model->vendorID(FormLib::get('vendor'));
$model->storeID(FormLib::get('store'));
- 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"