File ViewPickups.php
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use COREPOS\Fannie\API\lib\Store;
include(__DIR__ . '/../../../config.php');
Method get_view
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_view()
{
$store = FormLib::get('store', false);
if ($store === false) {
$store = Store::getIdByIp();
Method get_id_view
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function get_id_view()
{
$order = new PickupOrdersModel($this->connection);
$order->pickupOrderID($this->id);
$order->load();
Method post_id_print_handler
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function post_id_print_handler()
{
$pdf=new FPDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
Function post_id_print_handler
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function post_id_print_handler()
{
$pdf=new FPDF('P','mm','Letter'); //start new instance of PDF
$pdf->Open(); //open new PDF Document
- 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 pickList
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function pickList($orderID, $store)
{
$prep = $this->connection->prepare("
SELECT p.upc, p.brand, p.description, p.quantity, q.size, q.scale
FROM PickupOrderItems AS p
Function get_view
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function get_view()
{
$store = FormLib::get('store', false);
if ($store === false) {
$store = Store::getIdByIp();
- 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 $list;
Function pickList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function pickList($orderID, $store)
{
$prep = $this->connection->prepare("
SELECT p.upc, p.brand, p.description, p.quantity, q.size, q.scale
FROM PickupOrderItems AS p
- 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"