Showing 8,683 of 8,684 total issues
Function hookAddColumnowner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function hookAddColumnowner()
{
// copy existing values from batchowner.owner to
// new batches.owner column
if ($this->connection->table_exists('batchowner')) {
- 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 hookAddColumnmargin
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function hookAddColumnmargin()
{
if ($this->connection->table_exists('deptMargin')) {
$dataR = $this->connection->query('SELECT dept_ID, margin FROM deptMargin');
$tempModel = new DepartmentsModel($this->connection);
- 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 expandUPCE
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function expandUPCE($entered)
{
$par6 = substr($entered, -1);
if ($par6 == 0) $entered = substr($entered, 0, 3)."00000".substr($entered, 3, 3);
elseif ($par6 == 1) $entered = substr($entered, 0, 3)."10000".substr($entered, 3, 3);
- 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 drawPDF
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function drawPDF()
{
$pdf = new \FPDF('P', 'mm', 'Letter');
$pdf->SetMargins(3.175, 3.175, 3.175);
$pdf->SetAutoPageBreak(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 getAllAccounts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function getAllAccounts($dbc)
{
$account = new CustomerAccountsModel($dbc);
$customers = new CustomersModel($dbc);
$accounts = 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"
Further reading
Function check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function check($key=false)
{
$FANNIE_ARCHIVE_DB = \FannieConfig::factory()->get('ARCHIVE_DB');
$dbc = \FannieDB::get($FANNIE_ARCHIVE_DB, $current_db);
$table = $FANNIE_ARCHIVE_DB.$dbc->sep()."reportDataCache";
- 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 txtToArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function txtToArray($filename, $limit=0)
{
$fptr = fopen($filename,'r');
if (!$fptr) {
return 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"
Further reading
Function getCustdataCustomers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function getCustdataCustomers($dbc, $id)
{
$query = '
SELECT c.personNum,
c.FirstName,
- 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 postMemberCards
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function postMemberCards($dbc, $id, $json, $ret)
{
if (isset($json['idCardUPC'])) {
$cards = self::getModel($dbc, 'MemberCardsModel');
$cards->card_no($id);
- 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 bestRoute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function bestRoute($try_routes)
{
// use the route with the most parameters
// set class variables to parameters
$num_params = array_keys($try_routes);
- 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 csvToArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function csvToArray($filename, $limit=0)
{
$fptr = fopen($filename,'r');
if (!$fptr) {
return 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"
Further reading
Function fastSearchResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function fastSearchResults($dbc, $ids)
{
list($inStr, $args) = $dbc->safeInClause($ids);
$config = FannieConfig::factory();
if ($config->get('CUST_SCHEMA') == 1 && $dbc->tableExists('CustomerAccounts') && $dbc->tableExists('Customers')) {
- 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 printItemRow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function printItemRow($row, $depts)
{
$ret = sprintf('<tr>
<td>%s</td>
<td>%s</td>
- 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_orderID_noteDept_noteText_ph1_ph2_email_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function post_orderID_noteDept_noteText_ph1_ph2_email_handler()
{
$dbc = $this->connection;
$dbc->selectDB($this->config->get('TRANS_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
Function getItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getItem($upc)
{
if (trim($upc) !== '' && !preg_match('/^0+$/', trim($upc))) {
$item = self::getItemByUPC($upc);
if ($item !== 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 labelToAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function labelToAttributes($label_number)
{
$ret = array(
'align' => 'vertical',
'fixed_weight' => 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 upcToPLU
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function upcToPLU($upc)
{
$upc = BarcodeLib::padUPC($upc);
$len = FannieConfig::config('SPLU_LENGTH');
if ($len != 4 && $len != 5) {
- 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_id_commID_handler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function post_id_commID_handler()
{
$dbc = $this->tdb();
$msg = '';
switch ($this->commID) {
- 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 resultToItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function resultToItem($dbc, $prodR)
{
$prodW = $dbc->fetchRow($prodR);
$ret = self::$generic_item;
foreach ($ret as $key => $val) {
- 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 getQueuedIDs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getQueuedIDs($oids)
{
$username = FannieAuth::checkLogin();
$cachepath = sys_get_temp_dir()."/ordercache/";
if (file_exists("{$cachepath}{$username}.prints")){
- 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"