File TransRecord.php
has 507 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2001, 2004 Wedge Community Co-op
Method addItem
has 27 arguments (exceeds 4 allowed). Consider refactoring. Open
static private function addItem($strupc, $strdescription, $strtransType, $strtranssubType, $strtransstatus, $intdepartment, $dblquantity, $dblunitPrice, $dbltotal, $dblregPrice, $intscale, $inttax, $intfoodstamp, $dbldiscount, $dblmemDiscount, $intdiscountable, $intdiscounttype, $dblItemQtty, $intvolDiscType, $intvolume, $dblVolSpecial, $intmixMatch, $intmatched, $intvoided, $cost=0, $numflag=0, $charflag='')
Method addItem
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
static private function addItem($strupc, $strdescription, $strtransType, $strtranssubType, $strtransstatus, $intdepartment, $dblquantity, $dblunitPrice, $dbltotal, $dblregPrice, $intscale, $inttax, $intfoodstamp, $dbldiscount, $dblmemDiscount, $intdiscountable, $intdiscounttype, $dblItemQtty, $intvolDiscType, $intvolume, $dblVolSpecial, $intmixMatch, $intmatched, $intvoided, $cost=0, $numflag=0, $charflag='')
{
//$dbltotal = MiscLib::truncate2(str_replace(",", "", $dbltotal)); replaced by apbw 7/27/05 with the next 4 lines -- to fix thousands place errors
$dbltotal = self::formatDouble($dbltotal);
$dblunitPrice = self::formatDouble($dblunitPrice);
TransRecord
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class TransRecord
{
/*------------------------------------------------------------------------------
additem.php is the bread and butter of IT CORE. addItem inserts the information
Method addRecord
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function addRecord($namedParams)
{
// start with default values
$newRecord = self::$defaultRecord;
Function addItem
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static private function addItem($strupc, $strdescription, $strtransType, $strtranssubType, $strtransstatus, $intdepartment, $dblquantity, $dblunitPrice, $dbltotal, $dblregPrice, $intscale, $inttax, $intfoodstamp, $dbldiscount, $dblmemDiscount, $intdiscountable, $intdiscounttype, $dblItemQtty, $intvolDiscType, $intvolume, $dblVolSpecial, $intmixMatch, $intmatched, $intvoided, $cost=0, $numflag=0, $charflag='')
{
//$dbltotal = MiscLib::truncate2(str_replace(",", "", $dbltotal)); replaced by apbw 7/27/05 with the next 4 lines -- to fix thousands place errors
$dbltotal = self::formatDouble($dbltotal);
$dblunitPrice = self::formatDouble($dblunitPrice);
- 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 addhousecoupon
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function addhousecoupon($strupc, $intdepartment, $dbltotal, $description='', $discountable=1, $tax=0)
Method addFlaggedTender
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function addFlaggedTender($strtenderdesc, $strtendercode, $dbltendered, $numflag, $charflag)
Method addBogoDiscount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function addBogoDiscount($intdepartment, $dbltotal, $tax=0, $fs=0, $mixmatch='')
Method addQueued
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
static public function addQueued($upc, $description, $numflag=0, $charflag='',$regPrice=0)
Function finalizeTransaction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
static public function finalizeTransaction($incomplete=false)
{
if (!$incomplete) {
self::addtransDiscount();
self::addTax();
- 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 emptyQueue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function emptyQueue()
{
$queue = CoreLocal::get("infoRecordQueue");
if (!is_array($queue)) {
$queue = array();
- 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"