Method showEditForm
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showEditForm($upc, $display_mode=1, $expand_mode=1)
{
$FANNIE_URL = FannieConfig::config('URL');
$upc = BarcodeLib::padUPC($upc);
File ProdUserModule.php
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*******************************************************************************
Copyright 2014 Whole Foods Co-op, Duluth, MN
Function showEditForm
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public function showEditForm($upc, $display_mode=1, $expand_mode=1)
{
$FANNIE_URL = FannieConfig::config('URL');
$upc = BarcodeLib::padUPC($upc);
- 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 SaveFormData
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SaveFormData($upc)
{
$upc = BarcodeLib::padUPC($upc);
$brand = FormLib::get('lf_brand');
$desc = FormLib::get('lf_desc');
Function SaveFormData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function SaveFormData($upc)
{
$upc = BarcodeLib::padUPC($upc);
$brand = FormLib::get('lf_brand');
$desc = FormLib::get('lf_desc');
- 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 saveLocation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function saveLocation($dbc, $upc, $floorIDs, $oldFloorIDs, $floorSubs)
{
$insP = $dbc->prepare('INSERT INTO FloorSectionProductMap (floorSectionID, upc) VALUES (?, ?)');
$upP = $dbc->prepare('UPDATE FloorSectionProductMap SET floorSectionID=? WHERE floorSectionID=? AND upc=?');
$delP = $dbc->prepare('DELETE FROM FloorSectionProductMap WHERE floorSectionID=? AND upc=?');
- 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 saveLocation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function saveLocation($dbc, $upc, $floorIDs, $oldFloorIDs, $floorSubs)