Function writeItemsToScales
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
static public function writeItemsToScales($items, $scales=array())
{
$config = \FannieConfig::factory();
if (!isset($items[0])) {
$items = array($items);
- 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 readItemsFromFile
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
static public function readItemsFromFile($filename)
{
$dbc = \FannieDB::get(\FannieConfig::factory()->get('OP_DB'));
$product = new \ProductsModel($dbc);
- 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 writeItemsToScales
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function writeItemsToScales($items, $scales=array())
{
$config = \FannieConfig::factory();
if (!isset($items[0])) {
$items = array($items);
Function getItemLine
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
static public function getItemLine($item_info, $scaleType='HOBART_QUANTUMTCP')
{
$line = '';
// first write fields that are present
foreach(ServiceScaleLib::$WRITE_ITEM_FIELDS as $key => $field_info) {
- 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
File HobartDgwLib.php
has 308 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2014 Whole Foods Co-op, Duluth, MN
Method readItemsFromFile
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function readItemsFromFile($filename)
{
$dbc = \FannieDB::get(\FannieConfig::factory()->get('OP_DB'));
$product = new \ProductsModel($dbc);
Function deleteItemsFromScales
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
static public function deleteItemsFromScales($items, $scales=array())
{
$config = \FannieConfig::factory();
if (!is_array($items)) {
- 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 deleteItemsFromScales
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function deleteItemsFromScales($items, $scales=array())
{
$config = \FannieConfig::factory();
if (!is_array($items)) {
Function readTextsFromFile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
static public function readTextsFromFile($filename)
{
$dbc = \FannieDB::get(\FannieConfig::factory()->get('OP_DB'));
$product = new \ProductsModel($dbc);
- 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 readTextsFromFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function readTextsFromFile($filename)
{
$dbc = \FannieDB::get(\FannieConfig::factory()->get('OP_DB'));
$product = new \ProductsModel($dbc);
Method getItemLine
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
static public function getItemLine($item_info, $scaleType='HOBART_QUANTUMTCP')
{
$line = '';
// first write fields that are present
foreach(ServiceScaleLib::$WRITE_ITEM_FIELDS as $key => $field_info) {